69 lines
1.4 KiB
Plaintext

@using ServiceStationContracts.ViewModels
@{
ViewData["Title"] = "Home Page";
}
@model List<WorkViewModel>
<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="CreateWork">Создать работу</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>
<th>
@Html.DisplayFor(modelItem => item.Id)
</th>
<th>
@Html.DisplayFor(modelItem => item.Date)
</th>
<th>
@Html.DisplayFor(modelItem => item.Price)
</th>
<th>
@Html.DisplayFor(modelItem => item.TaskByWorkId)
</th>
<th>
@Html.DisplayFor(modelItem => item.TaskName)
</th>
<td>
<a class="btn btn-primary btn-sm" asp-action="EditWork" style="background-color:orange" asp-route-ID=" @item.Id">Изменить</a>
<a class="btn btn-primary btn-sm" asp-action="DeleteWork" style="background-color:red;" asp-route-ID="@item.Id">Удалить</a>
</td>
</tr>
}
</tbody>
</table>
}
</div>