ComputerHardwareStore_YouAr.../ComputerHardwareStore/StoreKeeperClient/Views/Home/Components.cshtml

59 lines
1.5 KiB
Plaintext
Raw Normal View History

2024-05-01 19:43:56 +04:00
@using ComputerHardwareStoreContracts.ViewModels
@model List<ComponentViewModel>
@{
ViewData["Title"] = "Components";
}
<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 class="text-decoration-none me-3 text-black h5" asp-action="CreateComponent">Создать комплектующее</a>
<a class="text-decoration-none me-3 text-black h5" asp-action="UpdateComponent">Изменить комплектующее</a>
<a class="text-decoration-none me-3 text-black h5" asp-action="ComponentToBuild">Привязать комплектующее к сборке</a>
<a class="text-decoration-none text-black h5" asp-action="DeleteComponent">Удалить комплектующее</a>
</p>
<table class="componentTable">
<thead>
<tr>
<th>
Номер
</th>
<th>
Название
</th>
<th>
Цена
</th>
</tr>
</thead>
<tbody>
<tbody>
@foreach (var component in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => component.Id)
</td>
<td>
@Html.DisplayFor(modelItem => component.ComponentName)
</td>
<td>
@Html.DisplayFor(modelItem => component.ComponentPrice)
</td>
</tr>
}
</tbody>
</tbody>
</table>
}
</div>