Refactor: Remove sample data and add invoice processing

Removed `SampleDataController`, `SampleData`, and `SampleOrder`
classes, along with the `DevExtreme` DataGrid in `Index.cshtml`,
to eliminate reliance on mock data and sample orders.

Updated `Index.cshtml` to introduce a welcome message and
informational section about ZUGFeRD/Factur-X invoice processing,
highlighting features like PDF/A upload, XML extraction, and
result PDF creation. Added navigation links for invoice-related
actions.

Updated `DXApp.TemplateKitProject.csproj` to include a new
`<ItemGroup>` for the `Controllers` folder, preparing the
project structure for future development.
This commit is contained in:
OlgunR
2026-06-02 16:21:18 +02:00
parent f7cac8c0a7
commit a55e53521f
5 changed files with 38 additions and 431 deletions

View File

@@ -1,24 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using DevExtreme.AspNet.Data;
using DevExtreme.AspNet.Mvc;
using DXApp.TemplateKitProject.Models;
using Microsoft.AspNetCore.Mvc;
namespace DXApp.TemplateKitProject.Controllers
{
[Route("api/[controller]")]
public class SampleDataController : Controller
{
[HttpGet]
public object Get(DataSourceLoadOptions loadOptions)
{
return DataSourceLoader.Load(SampleData.Orders, loadOptions);
}
}
}

View File

@@ -27,4 +27,8 @@
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="3.0.71" /> <PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="3.0.71" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Controllers\" />
</ItemGroup>
</Project> </Project>

View File

@@ -1,364 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DXApp.TemplateKitProject.Models
{
internal static class SampleData
{
public static List<SampleOrder> Orders = new List<SampleOrder>() {
new SampleOrder {
OrderID = 10248,
OrderDate = new DateTime(1996, 7, 4),
ShipCountry = "France",
ShipCity = "Reims",
CustomerName = "Paul Henriot"
},
new SampleOrder {
OrderID = 10249,
OrderDate = new DateTime(1996, 7, 5),
ShipCountry = "Germany",
ShipCity = "Münster",
CustomerName = "Karin Josephs"
},
new SampleOrder {
OrderID = 10250,
OrderDate = new DateTime(1996, 7, 8),
ShipCountry = "Brazil",
ShipCity = "Rio de Janeiro",
CustomerName = "Mario Pontes"
},
new SampleOrder {
OrderID = 10251,
OrderDate = new DateTime(1996, 7, 8),
ShipCountry = "France",
ShipCity = "Lyon",
CustomerName = "Mary Saveley"
},
new SampleOrder {
OrderID = 10252,
OrderDate = new DateTime(1996, 7, 9),
ShipCountry = "Belgium",
ShipCity = "Charleroi",
CustomerName = "Pascale Cartrain"
},
new SampleOrder {
OrderID = 10253,
OrderDate = new DateTime(1996, 7, 10),
ShipCountry = "Brazil",
ShipCity = "Rio de Janeiro",
CustomerName = "Mario Pontes"
},
new SampleOrder {
OrderID = 10254,
OrderDate = new DateTime(1996, 7, 11),
ShipCountry = "Switzerland",
ShipCity = "Bern",
CustomerName = "Yang Wang"
},
new SampleOrder {
OrderID = 10255,
OrderDate = new DateTime(1996, 7, 12),
ShipCountry = "Switzerland",
ShipCity = "Genève",
CustomerName = "Michael Holz"
},
new SampleOrder {
OrderID = 10256,
OrderDate = new DateTime(1996, 7, 15),
ShipCountry = "Brazil",
ShipCity = "Resende",
CustomerName = "Paula Parente"
},
new SampleOrder {
OrderID = 10257,
OrderDate = new DateTime(1996, 7, 16),
ShipCountry = "Venezuela",
ShipCity = "San Cristóbal",
CustomerName = "Carlos Hernández"
},
new SampleOrder {
OrderID = 10258,
OrderDate = new DateTime(1996, 7, 17),
ShipCountry = "Austria",
ShipCity = "Graz",
CustomerName = "Roland Mendel"
},
new SampleOrder {
OrderID = 10259,
OrderDate = new DateTime(1996, 7, 18),
ShipCountry = "Mexico",
ShipCity = "México D.F.",
CustomerName = "Francisco Chang"
},
new SampleOrder {
OrderID = 10260,
OrderDate = new DateTime(1996, 7, 19),
ShipCountry = "Germany",
ShipCity = "Köln",
CustomerName = "Henriette Pfalzheim"
},
new SampleOrder {
OrderID = 10261,
OrderDate = new DateTime(1996, 7, 19),
ShipCountry = "Brazil",
ShipCity = "Rio de Janeiro",
CustomerName = "Bernardo Batista"
},
new SampleOrder {
OrderID = 10262,
OrderDate = new DateTime(1996, 7, 22),
ShipCountry = "USA",
ShipCity = "Albuquerque",
CustomerName = "Paula Wilson"
},
new SampleOrder {
OrderID = 10263,
OrderDate = new DateTime(1996, 7, 23),
ShipCountry = "Austria",
ShipCity = "Graz",
CustomerName = "Roland Mendel"
},
new SampleOrder {
OrderID = 10264,
OrderDate = new DateTime(1996, 7, 24),
ShipCountry = "Sweden",
ShipCity = "Bräcke",
CustomerName = "Maria Larsson"
},
new SampleOrder {
OrderID = 10265,
OrderDate = new DateTime(1996, 7, 25),
ShipCountry = "France",
ShipCity = "Strasbourg",
CustomerName = "Frédérique Citeaux"
},
new SampleOrder {
OrderID = 10266,
OrderDate = new DateTime(1996, 7, 26),
ShipCountry = "Finland",
ShipCity = "Oulu",
CustomerName = "Pirkko Koskitalo"
},
new SampleOrder {
OrderID = 10267,
OrderDate = new DateTime(1996, 7, 29),
ShipCountry = "Germany",
ShipCity = "München",
CustomerName = "Peter Franken"
},
new SampleOrder {
OrderID = 10268,
OrderDate = new DateTime(1996, 7, 30),
ShipCountry = "Venezuela",
ShipCity = "Caracas",
CustomerName = "Manuel Pereira"
},
new SampleOrder {
OrderID = 10269,
OrderDate = new DateTime(1996, 7, 31),
ShipCountry = "USA",
ShipCity = "Seattle",
CustomerName = "Karl Jablonski"
},
new SampleOrder {
OrderID = 10270,
OrderDate = new DateTime(1996, 8, 1),
ShipCountry = "Finland",
ShipCity = "Oulu",
CustomerName = "Pirkko Koskitalo"
},
new SampleOrder {
OrderID = 10271,
OrderDate = new DateTime(1996, 8, 1),
ShipCountry = "USA",
ShipCity = "Lander",
CustomerName = "Art Braunschweiger"
},
new SampleOrder {
OrderID = 10272,
OrderDate = new DateTime(1996, 8, 2),
ShipCountry = "USA",
ShipCity = "Albuquerque",
CustomerName = "Paula Wilson"
},
new SampleOrder {
OrderID = 10273,
OrderDate = new DateTime(1996, 8, 5),
ShipCountry = "Germany",
ShipCity = "Cunewalde",
CustomerName = "Horst Kloss"
},
new SampleOrder {
OrderID = 10274,
OrderDate = new DateTime(1996, 8, 6),
ShipCountry = "France",
ShipCity = "Reims",
CustomerName = "Paul Henriot"
},
new SampleOrder {
OrderID = 10275,
OrderDate = new DateTime(1996, 8, 7),
ShipCountry = "Italy",
ShipCity = "Bergamo",
CustomerName = "Giovanni Rovelli"
},
new SampleOrder {
OrderID = 10276,
OrderDate = new DateTime(1996, 8, 8),
ShipCountry = "Mexico",
ShipCity = "México D.F.",
CustomerName = "Miguel Angel Paolino"
},
new SampleOrder {
OrderID = 10277,
OrderDate = new DateTime(1996, 8, 9),
ShipCountry = "Germany",
ShipCity = "Leipzig",
CustomerName = "Alexander Feuer"
},
new SampleOrder {
OrderID = 10278,
OrderDate = new DateTime(1996, 8, 12),
ShipCountry = "Sweden",
ShipCity = "Luleå",
CustomerName = "Christina Berglund"
},
new SampleOrder {
OrderID = 10279,
OrderDate = new DateTime(1996, 8, 13),
ShipCountry = "Germany",
ShipCity = "Frankfurt a.M.",
CustomerName = "Renate Messner"
},
new SampleOrder {
OrderID = 10280,
OrderDate = new DateTime(1996, 8, 14),
ShipCountry = "Sweden",
ShipCity = "Luleå",
CustomerName = "Christina Berglund"
},
new SampleOrder {
OrderID = 10281,
OrderDate = new DateTime(1996, 8, 14),
ShipCountry = "Spain",
ShipCity = "Madrid",
CustomerName = "Alejandra Camino"
},
new SampleOrder {
OrderID = 10282,
OrderDate = new DateTime(1996, 8, 15),
ShipCountry = "Spain",
ShipCity = "Madrid",
CustomerName = "Alejandra Camino"
},
new SampleOrder {
OrderID = 10283,
OrderDate = new DateTime(1996, 8, 16),
ShipCountry = "Venezuela",
ShipCity = "Barquisimeto",
CustomerName = "Carlos González"
},
new SampleOrder {
OrderID = 10284,
OrderDate = new DateTime(1996, 8, 19),
ShipCountry = "Germany",
ShipCity = "Frankfurt a.M.",
CustomerName = "Renate Messner"
},
new SampleOrder {
OrderID = 10285,
OrderDate = new DateTime(1996, 8, 20),
ShipCountry = "Germany",
ShipCity = "Cunewalde",
CustomerName = "Horst Kloss"
},
new SampleOrder {
OrderID = 10286,
OrderDate = new DateTime(1996, 8, 21),
ShipCountry = "Germany",
ShipCity = "Cunewalde",
CustomerName = "Horst Kloss"
},
new SampleOrder {
OrderID = 10287,
OrderDate = new DateTime(1996, 8, 22),
ShipCountry = "Brazil",
ShipCity = "Rio de Janeiro",
CustomerName = "Janete Limeira"
},
new SampleOrder {
OrderID = 10288,
OrderDate = new DateTime(1996, 8, 23),
ShipCountry = "Italy",
ShipCity = "Reggio Emilia",
CustomerName = "Maurizio Moroni"
},
new SampleOrder {
OrderID = 10289,
OrderDate = new DateTime(1996, 8, 26),
ShipCountry = "UK",
ShipCity = "London",
CustomerName = "Victoria Ashworth"
},
new SampleOrder {
OrderID = 10290,
OrderDate = new DateTime(1996, 8, 27),
ShipCountry = "Brazil",
ShipCity = "Sao Paulo",
CustomerName = "Pedro Afonso"
},
new SampleOrder {
OrderID = 10291,
OrderDate = new DateTime(1996, 8, 27),
ShipCountry = "Brazil",
ShipCity = "Rio de Janeiro",
CustomerName = "Bernardo Batista"
},
new SampleOrder {
OrderID = 10292,
OrderDate = new DateTime(1996, 8, 28),
ShipCountry = "Brazil",
ShipCity = "Sao Paulo",
CustomerName = "Anabela Domingues"
},
new SampleOrder {
OrderID = 10293,
OrderDate = new DateTime(1996, 8, 29),
ShipCountry = "Mexico",
ShipCity = "México D.F.",
CustomerName = "Miguel Angel Paolino"
},
new SampleOrder {
OrderID = 10294,
OrderDate = new DateTime(1996, 8, 30),
ShipCountry = "USA",
ShipCity = "Albuquerque",
CustomerName = "Paula Wilson"
},
new SampleOrder {
OrderID = 10295,
OrderDate = new DateTime(1996, 9, 2),
ShipCountry = "France",
ShipCity = "Reims",
CustomerName = "Paul Henriot"
},
new SampleOrder {
OrderID = 10296,
OrderDate = new DateTime(1996, 9, 3),
ShipCountry = "Venezuela",
ShipCity = "Barquisimeto",
CustomerName = "Carlos González"
},
new SampleOrder {
OrderID = 10297,
OrderDate = new DateTime(1996, 9, 4),
ShipCountry = "France",
ShipCity = "Strasbourg",
CustomerName = "Frédérique Citeaux"
}
};
}
}

View File

@@ -1,18 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DXApp.TemplateKitProject.Models
{
public class SampleOrder
{
public int OrderID { get; set; }
public DateTime OrderDate { get; set; }
public string CustomerID { get; set; }
public string CustomerName { get; set; }
public string ShipCountry { get; set; }
public string ShipCity { get; set; }
}
}

View File

@@ -1,28 +1,37 @@
@page @page
@using DXApp.TemplateKitProject.Models @model DXApp.TemplateKitProject.Pages.IndexModel
@{
ViewData["Title"] = "Home";
}
<h2 class="content-block">Home</h2> <div class="content-block">
<h2>Willkommen bei DXApp.TemplateKitProject</h2>
@(Html.DevExtreme().DataGrid<SampleOrder>() <div class="alert alert-info mt-4">
.ElementAttr(new { @class = "dx-card wide-card" }) <h4>?? ZUGFeRD-Rechnungsverarbeitung</h4>
.DataSource(d => d.Mvc().Controller("SampleData").LoadAction("Get").Key("OrderID")) <p>Diese Anwendung ermöglicht die Verarbeitung von ZUGFeRD/Factur-X Rechnungen:</p>
.ShowBorders(false) <ul>
.FilterRow(f => f.Visible(true)) <li>? Upload von PDF/A-Rechnungen</li>
.FocusedRowEnabled(true) <li>? Automatische Extraktion von ZUGFeRD-XML</li>
.FocusedRowIndex(0) <li>? Parsing und Speicherung in der Datenbank</li>
.ColumnAutoWidth(true) <li>? Erstellung von Result-PDFs mit Verarbeitungsstempel</li>
.ColumnHidingEnabled(true) <li>? Anzeige von Anhängen (XML, PDF, Bilder)</li>
.Columns(columns => { </ul>
columns.AddFor(m => m.OrderID); </div>
columns.AddFor(m => m.OrderDate);
columns.AddFor(m => m.CustomerName); <div class="mt-4">
columns.AddFor(m => m.ShipCountry); <h4>Navigation</h4>
columns.AddFor(m => m.ShipCity); <div class="list-group">
}) <a href="/Invoices/Upload" class="list-group-item list-group-item-action">
.Paging(p => p.PageSize(10)) <strong>?? PDF hochladen</strong>
.Pager(p => p <br/>
.ShowPageSizeSelector(true) <small class="text-muted">Laden Sie eine ZUGFeRD-Rechnung hoch und verarbeiten Sie diese.</small>
.AllowedPageSizes(new[] { 5, 10, 20 }) </a>
.ShowInfo(true) <a href="/Invoices" class="list-group-item list-group-item-action">
) <strong>?? Rechnungen</strong>
) <br/>
<small class="text-muted">Zeigen Sie alle importierten Rechnungen an.</small>
</a>
</div>
</div>
</div>