2024-05-25 17:47:14 +04:00
|
|
|
@using ElectronicsShopContracts.ViewModels
|
|
|
|
|
|
|
|
@model List<ProductViewModel>
|
|
|
|
|
|
|
|
@{
|
|
|
|
ViewData["Title"] = "Home Page";
|
|
|
|
}
|
|
|
|
|
|
|
|
<div class="text-center">
|
|
|
|
<h1 class="display-4">Товары</h1>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="text-center">
|
|
|
|
@{
|
|
|
|
if (Model == null) {
|
|
|
|
<h3 class="display-4">Авторизируйтесь</h3>
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
<p>
|
2024-05-28 18:22:47 +04:00
|
|
|
<a asp-action="CreateProduct">Создать товар</a>
|
2024-05-25 17:47:14 +04:00
|
|
|
</p>
|
|
|
|
<table class="table">
|
|
|
|
<thead>
|
2024-05-28 18:52:21 +04:00
|
|
|
<tr>
|
|
|
|
<th>
|
|
|
|
Номер продукта
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
Название продукта
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
Статья затрат
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
Сумма
|
|
|
|
</th>
|
|
|
|
</tr>
|
2024-05-25 17:47:14 +04:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-05-28 18:22:47 +04:00
|
|
|
@foreach (var item in Model) {
|
2024-05-28 18:52:21 +04:00
|
|
|
<tr>
|
2024-05-25 17:47:14 +04:00
|
|
|
<th>
|
|
|
|
@Html.DisplayFor(modelItem => item.ID)
|
|
|
|
</th>
|
|
|
|
<th>
|
2024-05-28 12:50:24 +04:00
|
|
|
@Html.DisplayFor(modelItem => item.ProductName)
|
2024-05-25 17:47:14 +04:00
|
|
|
</th>
|
|
|
|
<th>
|
2024-05-28 12:50:24 +04:00
|
|
|
@Html.DisplayFor(modelItem => item.CostItemName)
|
2024-05-25 17:47:14 +04:00
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
@Html.DisplayFor(modelItem => item.Price)
|
|
|
|
</th>
|
2024-05-29 21:21:17 +04:00
|
|
|
<td>
|
|
|
|
<a class="btn btn-primary btn-sm" asp-action="EditProduct" asp-route-ID="@item.ID">Изменить</a>
|
2024-05-29 21:45:37 +04:00
|
|
|
<a class="btn btn-primary btn-sm" asp-action="DeleteProduct" asp-route-ID="@item.ID">Удалить</a>
|
2024-05-29 21:21:17 +04:00
|
|
|
</td>
|
2024-05-28 18:52:21 +04:00
|
|
|
</tr>
|
2024-05-28 18:22:47 +04:00
|
|
|
}
|
2024-05-25 17:47:14 +04:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
}
|
|
|
|
</div>
|