Added order item delete functionality

This commit is contained in:
2025-11-30 17:38:28 +01:00
parent bfda6dae0b
commit 8ad3085833
5 changed files with 49 additions and 1 deletions

View File

@@ -106,7 +106,9 @@
<th>@Localizer.Get("Participant")</th>
<th>@Localizer.Get("Item")</th>
<th>@Localizer.Get("Qty")</th>
<th>@Localizer.Get("Comments")</th>
<th>@Localizer.Get("Total")</th>
<th>@Localizer.Get("Actions")</th>
</tr>
</thead>
<tbody>
@@ -116,7 +118,17 @@
<td>@orderItem.ParticipantName</td>
<td>@orderItem.MenuItem?.Name</td>
<td>@orderItem.Quantity</td>
<td>@orderItem.Comments</td>
<td>@Localizer["Currency", (orderItem.MenuItem?.Price * orderItem.Quantity ?? 0).ToString("F2")]</td>
<td>
@if (User.Identity?.Name == orderItem.ParticipantEmail)
{
<form method="post" action="/order/deleteitem" onsubmit="return confirm('@Localizer.Get("ConfirmDeleteOrderItem")');">
<input type="hidden" name="orderItemId" value="@orderItem.Id" />
<button type="submit" class="btn btn-sm btn-danger">@Localizer.Get("Delete")</button>
</form>
}
</td>
</tr>
}
</tbody>