This repository has been archived on 2023-10-28. You can view files and clone it, but cannot push or open issues or pull requests.
pwt-0x01-ng/Areas/Customer/Views/CustomerOrders/Index.cshtml
surtur 4b42658671
All checks were successful
continuous-integration/drone/push Build is passing
feat: add Customer area
* controller
* views
* SessionExtensions class
2021-02-10 12:01:59 +01:00

76 lines
2.1 KiB
Plaintext

@model IList<Order>;
@{
ViewData["Title"] = "My Orders";
}
<h2>@ViewData["Title"]</h2>
<h3>@ViewData["Message"]</h3>
<br />
@{
if (Model != null && Model != null && Model.Count > 0)
{
foreach (var item in Model)
{
<table style="width:100%" class="table table-responsive table-striped table-bordered">
<tr>
<th class="col-sm-1">@nameof(Order.id)</th>
<th class="col-sm-2">@nameof(Order.Order_Number)</th>
<th class="col-sm-2">@nameof(Order.Price_total)</th>
<th class="col-sm-2">@nameof(Order.Created)</th>
<th class="col-sm-2">@nameof(Order.Updated)</th>
<th class="col-sm-3">@nameof(Order.usr.UserName)</th>
</tr>
<tr>
<td class="col-sm-1">@item.id</td>
<td class="col-sm-2">@item.Order_Number</td>
<td class="col-sm-2">@item.Price_total</td>
<td class="col-sm-2">@item.Created</td>
<td class="col-sm-2">@item.Updated</td>
<td class="col-sm-3">@item.usr.UserName</td>
</tr>
</table>
<button id="order_items_button_@item.id" class="btn-group btn-link" onclick="ViewHideDetails( 'order_items_' + @item.id, 'order_items_button_' + @item.id)">View Details</button>
<div id="order_items_@item.id" style="display:none">
<h4>Order Items</h4>
<table style="width:41.667%" class="table table-responsive table-bordered">
<tr>
<th class="col-sm-3">@nameof(Product.Name)</th>
<th class="col-sm-1">@nameof(OrderItem.Amount)</th>
<th class="col-sm-1">@nameof(OrderItem.Price)</th>
</tr>
@{
foreach (var order_items_item in item.OrderItems)
{
<tr>
<td class="col-sm-3">@order_items_item.Product.Name</td>
<td class="col-sm-1">@order_items_item.Amount</td>
<td class="col-sm-1">@order_items_item.Price</td>
</tr>
}
}
</table>
</div>
<br />
<br />
<br />
}
}
else
{
<h2>Orders are empty!</h2>
}
}
@section Scripts {
<environment include="Development">
<script defer src="~/js/Details.js"></script>
</environment>
<environment exclude="Development">
<script defer src="~/js/Details.min.js"></script>
</environment>
}