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:
18
DXApp.TemplateKitProject/Pages/Invoices/Index.cshtml.cs
Normal file
18
DXApp.TemplateKitProject/Pages/Invoices/Index.cshtml.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user