CourseWorkElectronicsShop/ElectronicsShop/ElectronicsShopShopClientApp/Views/Home/OrderView.cshtml

56 lines
1.2 KiB
Plaintext
Raw Normal View History

@using ElectronicsShopContracts.ViewModels
@model OrderViewModel
@{
2024-05-30 23:49:53 +04:00
ViewData["Title"] = "OrderView";
}
<div class="text-center">
<h1 class="display-4">Создание корзины</h1>
</div>
<div class=" text-center">
2024-05-30 23:49:53 +04:00
<div class="row">
<label class="col-4">Номер корзины:</label>
<div class="col-8">
<input id="OrderID" class="form-control" type="text" name="OrderID" value="@Model.ID" readonly />
</div>
</div>
<p>
<a asp-action="AddProduct">Добавить товар</a>
</p>
<table class="table">
<thead>
<tr>
<th>
Продукт
</th>
<th>
Количество
</th>
<th>
Сумма
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.ProductList) {
<tr>
<th>
@Html.DisplayFor(modelItem => item.Value.Item1.ProductName);
</th>
<th>
@Html.DisplayFor(modelItem => item.Value.Item2);
</th>
<th>
@Html.DisplayFor(modelItem => (item.Value.Item1.Price * item.Value.Item2));
</th>
<td>
<a class="btn btn-primary btn-sm" asp-action="DeleteProductOrder" asp-></a>
</td>
</tr>
}
</tbody>
</table>
</div>