80 lines
1.5 KiB
Plaintext
80 lines
1.5 KiB
Plaintext
|
@using Contracts.ViewModels
|
||
|
|
||
|
@model List<WorkerViewModel>
|
||
|
|
||
|
@{
|
||
|
ViewData["Title"] = "Workers";
|
||
|
}
|
||
|
|
||
|
<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="CreateWorker">Создать работника</a>
|
||
|
</p>
|
||
|
<table class="table">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th>
|
||
|
Номер
|
||
|
</th>
|
||
|
<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.Name)
|
||
|
</td>
|
||
|
<td>
|
||
|
@Html.DisplayFor(modelItem => item.Birthday)
|
||
|
</td>
|
||
|
<td>
|
||
|
@Html.DisplayFor(modelItem => item.Specialization)
|
||
|
</td>
|
||
|
<td>
|
||
|
@Html.DisplayFor(modelItem => item.Salary)
|
||
|
</td>
|
||
|
<td>
|
||
|
<a asp-action="CreateWorker" asp-route-id="@item.Id" class="btn btn-primary">Изменить</a>
|
||
|
</td>
|
||
|
<td>
|
||
|
<a asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger">Удалить</a>
|
||
|
</td>
|
||
|
</tr>
|
||
|
}
|
||
|
</tbody>
|
||
|
</table>
|
||
|
}
|
||
|
</div>
|