CourseWork_CompShop/ComputerShopProvider/ComputerShopClientApp/Views/Home/Component.cshtml

63 lines
1.1 KiB
Plaintext
Raw Normal View History

@using ComputerShopContracts.ViewModels
@model List<ComponentViewModel>
@{
ViewData["Title"] = "Component";
}
<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="CreateComponent">Создать комплектующее</a>
</p>
2023-05-17 17:28:31 +04:00
<p>
<a asp-action="EditComponent">Изменить комплектующее</a>
</p>
2023-04-09 12:04:14 +04:00
<p>
<a asp-action="DeleteComponent">Удалить комплектующее</a>
</p>
<table class="table">
<thead>
<tr>
<th>
Номер
</th>
<th>
Компонент
</th>
<th>
Цена
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.ComponentName)
</td>
<td>
@Html.DisplayFor(modelItem => item.Cost)
</td>
</tr>
}
</tbody>
</table>
}
</div>