70 lines
1.4 KiB
Plaintext
70 lines
1.4 KiB
Plaintext
@using Contracts.ViewModels
|
|
|
|
@model List<DetailViewModel>
|
|
|
|
@{
|
|
ViewData["Title"] = "Details";
|
|
}
|
|
|
|
<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="CreateDetail" asp-route-id="0">Создать деталь</a>
|
|
</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<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.Name)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.Cost)
|
|
</td>
|
|
<td>
|
|
<a asp-action="CreateDetail" asp-route-id="@item.Id" class="btn btn-primary">Изменить</a>
|
|
</td>
|
|
<td>
|
|
<form method="post">
|
|
<input type="text" title="id" name="id" value="@item.Id" hidden="hidden"/>
|
|
<input type="submit" class="btn btn-danger" value="Удалить"/>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
</div> |