Files
DXApp/DXApp.TemplateKitProject/Pages/Invoices/Index.cshtml.cs
OlgunR 5221ee3594 Add invoices page and navigation menu items
Added new navigation menu items in `_Layout.cshtml` for "Rechnungen" (Invoices) and "PDF hochladen" (Upload PDF) with icons, paths, and selection logic.

Created a new Razor Page `Index.cshtml` to display imported invoices using a `DataGrid` with features like filtering, paging, and column formatting. Added a conditional message for when no invoices are available.

Implemented the `IndexModel` class in `Index.cshtml.cs` to handle backend logic, including fetching and sorting invoices from the database using `AppDbContext`.
2026-05-22 14:30:11 +02:00

19 lines
505 B
C#

using DXApp.TemplateKitProject.Data;
using DXApp.TemplateKitProject.Models;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.EntityFrameworkCore;
namespace DXApp.TemplateKitProject.Pages.Invoices;
public class IndexModel(AppDbContext db) : PageModel
{
public List<ZugferdInvoice> Invoices { get; private set; } = [];
public async Task OnGetAsync()
{
Invoices = await db.ZugferdInvoices
.OrderByDescending(i => i.ImportedAt)
.ToListAsync();
}
}