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`.
This commit is contained in:
OlgunR
2026-05-22 14:30:11 +02:00
parent c45e837c2b
commit 5221ee3594
3 changed files with 85 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
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();
}
}