67 lines
1.4 KiB
Plaintext
67 lines
1.4 KiB
Plaintext
@using ComputerShopContracts.ViewModels
|
|
|
|
@model List<ComponentViewModel>
|
|
|
|
@{
|
|
ViewData["Title"] = "IndexComponent";
|
|
}
|
|
<div class="text-center">
|
|
<h1 class="display-4">Комплектующие</h1>
|
|
</div>
|
|
|
|
<div class="text-center">
|
|
@{
|
|
<p>
|
|
<a asp-action="CreateComponent">Создать комплектующее</a>
|
|
</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
Номер
|
|
</th>
|
|
<th>
|
|
Название комплектующего
|
|
</th>
|
|
<th>
|
|
Цена
|
|
</th>
|
|
<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>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.Description)
|
|
</td>
|
|
<td>
|
|
<a asp-action="CreateDetail" asp-route-id="@item.Id" class="btn btn-primary">Изменить</a>
|
|
</td>
|
|
<td>
|
|
<a asp-action="DeleteDetail" asp-route-id="@item.Id" class="btn btn-danger">Удалить</a>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
</div> |