CourseWorkElectronicsShop/ElectronicsShop/ElectronicsShopEmployeeApp/Views/Home/Index.cshtml
Илья Федотов 03ddb8eb00 fix
2024-05-28 18:52:21 +04:00

67 lines
1.2 KiB
Plaintext

@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>
<a asp-action="CreateProduct">Создать товар</a>
</p>
<p>
<a asp-action="UpdateCostItem">Изменить</a>
</p>
<p>
<a asp-action="CreateCostItem">Удалить</a>
</p>
<table class="table">
<thead>
<tr>
<th>
Номер продукта
</th>
<th>
Название продукта
</th>
<th>
Статья затрат
</th>
<th>
Сумма
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model) {
<tr>
<th>
@Html.DisplayFor(modelItem => item.ID)
</th>
<th>
@Html.DisplayFor(modelItem => item.ProductName)
</th>
<th>
@Html.DisplayFor(modelItem => item.CostItemName)
</th>
<th>
@Html.DisplayFor(modelItem => item.Price)
</th>
</tr>
}
</tbody>
</table>
}
</div>