62 lines
2.7 KiB
Plaintext
62 lines
2.7 KiB
Plaintext
@model ProcessorViewModel
|
|
@{
|
|
ViewData["Title"] = "Processor Select";
|
|
}
|
|
<h2>@ViewData["Title"]</h2>
|
|
<h3>@ViewData["Message"]</h3>
|
|
|
|
<p>Select all data from processor.</p>
|
|
<br/>
|
|
<a asp-action="All">View all</a>
|
|
<br/><br/>
|
|
<a asp-action="Create">Create new processor item</a>
|
|
<br/><br/>
|
|
<br/>
|
|
|
|
@{
|
|
if (Model?.Processors != null && Model.Processors.Count > 0) {
|
|
<table style="width:100%">
|
|
<tr>
|
|
<th class="col-sm-1">@Html.DisplayNameFor(model => model.Processors[0].id)</th>
|
|
<th class="col-sm-2">@Html.DisplayNameFor(model => model.Processors[0].name)</th>
|
|
<th class="col-sm-2">@Html.DisplayNameFor(model => model.Processors[0].generation)</th>
|
|
<th class="col-sm-1">@Html.DisplayNameFor(model => model.Processors[0].clock_speed)</th>
|
|
<th class="col-sm-1">@Html.DisplayNameFor(model => model.Processors[0].cores)</th>
|
|
<th class="col-sm-1">@Html.DisplayNameFor(model => model.Processors[0].price)</th>
|
|
<th class="col-sm-2">@Html.DisplayNameFor(model => model.Processors[0].ImageSrc)</th>
|
|
<th class="col-sm-2">@Html.DisplayNameFor(model => model.Processors[0].ImageAlt)</th>
|
|
<th class="col-sm-4">@Html.DisplayNameFor(model => model.Processors[0].Description)</th>
|
|
<th class="col-sm-1">Edit</th>
|
|
<th class="col-sm-1">Delete</th>
|
|
</tr>
|
|
@{
|
|
foreach (var processor_item in Model.Processors)
|
|
{
|
|
<tr>
|
|
<td class="col-sm-1">@processor_item.id</td>
|
|
<td class="col-sm-2">@processor_item.name</td>
|
|
<td class="col-sm-2">@processor_item.generation</td>
|
|
<td class="col-sm-1">@processor_item.clock_speed</td>
|
|
<td class="col-sm-1">@processor_item.cores</td>
|
|
<td class="col-sm-1">@processor_item.price</td>
|
|
<td class="col-sm-2">@processor_item.ImageSrc</td>
|
|
<td class="col-sm-2">@processor_item.ImageAlt</td>
|
|
<td class="col-sm-4">@processor_item.Description</td>
|
|
<td class="col-sm-2"><a asp-action="Edit" asp-route-id="@processor_item.id">Edit</a></td>
|
|
<td class="col-sm-2"><a asp-action="Delete" asp-route-id="@processor_item.id" onclick="return p_item_deletion_confirmation();">Delete</a></td>
|
|
</tr>
|
|
}
|
|
}
|
|
</table>
|
|
}
|
|
else
|
|
{
|
|
<h2>Carousel is empty</h2>
|
|
}
|
|
}
|
|
|
|
@section Scripts
|
|
{
|
|
<script src="~/js/ultimate_script.js"></script>
|
|
}
|