59 lines
1.6 KiB
Plaintext
59 lines
1.6 KiB
Plaintext
@model IEnumerable<Data.Entities.Rents>
|
|
|
|
@{
|
|
ViewData["Title"] = "Index";
|
|
}
|
|
|
|
<h1>Rents</h1>
|
|
|
|
<p>
|
|
<a type="button" class="btn btn-primary" asp-action="Create">Rent a car</a>
|
|
</p>
|
|
@if (this.User.IsInRole("Admin"))
|
|
{
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
Car ID
|
|
</th>
|
|
<th>
|
|
Start Date
|
|
</th>
|
|
<th>
|
|
End Date
|
|
</th>
|
|
@if (this.User.IsInRole("Admin"))
|
|
{
|
|
<th>
|
|
Actions
|
|
</th>
|
|
}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in Model)
|
|
{
|
|
<tr>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.CarId)
|
|
</td>
|
|
<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>
|
|
} |