80 lines
2.1 KiB
Plaintext
80 lines
2.1 KiB
Plaintext
@model IEnumerable<Data.Entities.Car>
|
|
|
|
@{
|
|
ViewData["Title"] = "Cars";
|
|
}
|
|
|
|
<h1>Vehicles</h1>
|
|
<p>
|
|
@if (this.User.IsInRole("Admin"))
|
|
{
|
|
<a type="button" class="btn btn-primary" asp-action="Create">Add new car</a>
|
|
}
|
|
</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
ID
|
|
</th>
|
|
<th>
|
|
@Html.DisplayNameFor(model => model.Brand)
|
|
</th>
|
|
<th>
|
|
@Html.DisplayNameFor(model => model.Model)
|
|
</th>
|
|
<th>
|
|
@Html.DisplayNameFor(model => model.Year)
|
|
</th>
|
|
<th>
|
|
Seats
|
|
</th>
|
|
<th>
|
|
@Html.DisplayNameFor(model => model.Description)
|
|
</th>
|
|
<th>
|
|
Daily price
|
|
</th>
|
|
<th>
|
|
Actions
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in Model)
|
|
{
|
|
<tr>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.Id)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.Brand)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.Model)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.Year)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.CountPassengerSeats)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.Description)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.PriceForDay)
|
|
</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>
|