mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Sort processors by machine in admin page.
This commit is contained in:
@@ -28,14 +28,17 @@
|
||||
// Copyright © 2003-2018 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Cicm.Database.Models
|
||||
{
|
||||
public class ProcessorsByMachine
|
||||
{
|
||||
public int ProcessorId { get; set; }
|
||||
public int MachineId { get; set; }
|
||||
public float? Speed { get; set; }
|
||||
public long Id { get; set; }
|
||||
public int ProcessorId { get; set; }
|
||||
public int MachineId { get; set; }
|
||||
[DisplayName("Speed (MHz)")]
|
||||
public float? Speed { get; set; }
|
||||
public long Id { get; set; }
|
||||
|
||||
public virtual Machine Machine { get; set; }
|
||||
public virtual Processor Processor { get; set; }
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace cicm_web.Areas.Admin.Controllers
|
||||
{
|
||||
IIncludableQueryable<ProcessorsByMachine, Processor> cicmContext =
|
||||
_context.ProcessorsByMachine.Include(p => p.Machine).Include(p => p.Processor);
|
||||
return View(await cicmContext.ToListAsync());
|
||||
return View(await cicmContext.OrderBy(p => p.Machine.Name).ThenBy(p => p.Processor.Name).ToListAsync());
|
||||
}
|
||||
|
||||
// GET: Admin/ProcessorsByMachines/Details/5
|
||||
|
||||
@@ -45,6 +45,15 @@
|
||||
<div asp-validation-summary="ModelOnly"
|
||||
class="text-danger">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Machine"
|
||||
class="control-label">
|
||||
</label>
|
||||
<select asp-for="Machine"
|
||||
class="form-control"
|
||||
asp-items="ViewBag.MachineId">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="ProcessorId"
|
||||
class="control-label">
|
||||
@@ -54,15 +63,6 @@
|
||||
asp-items="ViewBag.ProcessorId">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="MachineId"
|
||||
class="control-label">
|
||||
</label>
|
||||
<select asp-for="MachineId"
|
||||
class="form-control"
|
||||
asp-items="ViewBag.MachineId">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Speed"
|
||||
class="control-label">
|
||||
|
||||
@@ -42,12 +42,6 @@
|
||||
<h4>Processors by machine</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Speed)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Speed)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Machine)
|
||||
</dt>
|
||||
@@ -60,6 +54,12 @@
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Processor.Name)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Speed)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Speed)
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<form asp-action="Delete">
|
||||
|
||||
@@ -41,12 +41,6 @@
|
||||
<h4>Processors by machine</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Speed)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Speed)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Machine)
|
||||
</dt>
|
||||
@@ -59,9 +53,22 @@
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Processor.Name)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Speed)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Speed)
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-primary">Edit</a>
|
||||
<a asp-action="Index" class="btn btn-secondary">Back to List</a>
|
||||
<a asp-action="Edit"
|
||||
asp-route-id="@Model.Id"
|
||||
class="btn btn-primary">
|
||||
Edit
|
||||
</a>
|
||||
<a asp-action="Index"
|
||||
class="btn btn-secondary">
|
||||
Back to List
|
||||
</a>
|
||||
</div>
|
||||
@@ -46,19 +46,7 @@
|
||||
class="text-danger">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="ProcessorId"
|
||||
class="control-label">
|
||||
</label>
|
||||
<select asp-for="ProcessorId"
|
||||
class="form-control"
|
||||
asp-items="ViewBag.ProcessorId">
|
||||
</select>
|
||||
<span asp-validation-for="ProcessorId"
|
||||
class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="MachineId"
|
||||
<label asp-for="Machine"
|
||||
class="control-label">
|
||||
</label>
|
||||
<select asp-for="MachineId"
|
||||
@@ -69,6 +57,18 @@
|
||||
class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Processor"
|
||||
class="control-label">
|
||||
</label>
|
||||
<select asp-for="ProcessorId"
|
||||
class="form-control"
|
||||
asp-items="ViewBag.ProcessorId">
|
||||
</select>
|
||||
<span asp-validation-for="ProcessorId"
|
||||
class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Speed"
|
||||
class="control-label">
|
||||
|
||||
@@ -47,15 +47,15 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Speed)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Machine)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Processor)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Speed)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -63,15 +63,15 @@
|
||||
@foreach(ProcessorsByMachine item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Speed)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Machine.Name)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Processor.Name)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Speed)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Details"
|
||||
asp-route-id="@item.Id"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<Version>3.0.99.443</Version>
|
||||
<Version>3.0.99.445</Version>
|
||||
<Company>Canary Islands Computer Museum</Company>
|
||||
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
|
||||
<Product>Canary Islands Computer Museum Website</Product>
|
||||
|
||||
Reference in New Issue
Block a user