Files
rent-a-car/RentACar/WebApp/Views/Rents/Index.cshtml
ani_konarcheva@abv.bg 4e25e34b99 UsersController
2022-04-07 23:52:54 +03:00

46 lines
1.1 KiB
Plaintext

@model IEnumerable<Data.Entities.Rents>
@{
ViewData["Title"] = "Index";
}
<h1>Rents</h1>
<h2>Available cars</h2>
<p>
<a asp-action="Create">Create New</a>
</p>
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.StartDate)
</th>
<th>
@Html.DisplayNameFor(model => model.EndDate)
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.StartDate)
</td>
<td>
@Html.DisplayFor(modelItem => item.EndDate)
</td>
@if (this.User.IsInRole("Admin"))
{
<td>
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
</td>
}
</tr>
}
</tbody>
</table>