Add invoice details page and grid column link

Added a "Details" column to the grid in `Index.cshtml` with a button linking to the new invoice details page. The button dynamically generates the URL using the invoice ID.

Created `Details.cshtml` to display detailed invoice information, including metadata such as seller, buyer, amounts, and dates. Added a back button and error handling for missing invoices.

Introduced `DetailsModel` in `Details.cshtml.cs` to fetch invoice data using `AppDbContext`. Implemented the `OnGetAsync` method to retrieve data asynchronously and handle cases where the invoice is not found.
This commit is contained in:
OlgunR
2026-05-28 16:53:50 +02:00
parent 8e329c2b50
commit 9adc9ac4ed
3 changed files with 76 additions and 0 deletions

View File

@@ -27,6 +27,16 @@ else
)
.Columns(cols =>
{
cols.Add()
.Caption("Details")
.Width(80)
.CellTemplate(new JS(@"function(container, options) {
$('<a>')
.attr('href', '/Invoices/Details?id=' + options.data.Id)
.attr('class', 'btn btn-sm btn-outline-primary')
.text('Details')
.appendTo(container);
}"));
cols.Add().DataField("Id").Caption("ID").Width(60).AllowEditing(false);
cols.Add().DataField("InvoiceNumber").Caption("Rechnungsnr.");
cols.Add().DataField("InvoiceDate").Caption("Datum")