CourseWorkElectronicsShop/ElectronicsShop/ElectronicsShopEmployeeApp/Views/Home/Index.cshtml

65 lines
1.3 KiB
Plaintext
Raw Normal View History

@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>
</p>
<table class="table">
<thead>
2024-05-28 18:52:21 +04:00
<tr>
<th>
Номер продукта
</th>
<th>
Название продукта
</th>
<th>
Статья затрат
</th>
<th>
Сумма
</th>
</tr>
</thead>
<tbody>
2024-05-28 18:22:47 +04:00
@foreach (var item in Model) {
2024-05-28 18:52:21 +04:00
<tr>
<th>
@Html.DisplayFor(modelItem => item.ID)
</th>
<th>
2024-05-28 12:50:24 +04:00
@Html.DisplayFor(modelItem => item.ProductName)
</th>
<th>
2024-05-28 12:50:24 +04:00
@Html.DisplayFor(modelItem => item.CostItemName)
</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
}
</tbody>
</table>
}
</div>