mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Implement details admin page for screens by machine.
This commit is contained in:
@@ -41,9 +41,20 @@ namespace cicm_web.Areas.Admin.Controllers
|
||||
{
|
||||
if(id == null) return NotFound();
|
||||
|
||||
ScreensByMachine screensByMachine = await _context.ScreensByMachine
|
||||
ScreensByMachineViewModel screensByMachine = await _context.ScreensByMachine
|
||||
.Include(s => s.Machine).Include(s => s.Screen)
|
||||
.FirstOrDefaultAsync(m => m.Id == id);
|
||||
.Select(s => new ScreensByMachineViewModel
|
||||
{
|
||||
Id = s.Id,
|
||||
Screen =
|
||||
s.Screen.NativeResolution !=
|
||||
null
|
||||
? $"{s.Screen.Diagonal}\" {s.Screen.Type} with {s.Screen.NativeResolution}"
|
||||
: $"{s.Screen.Diagonal}\" {s.Screen}",
|
||||
Machine =
|
||||
$"{s.Machine.Company.Name} {s.Machine.Name}"
|
||||
}).FirstOrDefaultAsync(m => m.Id ==
|
||||
id);
|
||||
if(screensByMachine == null) return NotFound();
|
||||
|
||||
return View(screensByMachine);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@model Cicm.Database.Models.ScreensByMachine
|
||||
@model cicm_web.Areas.Admin.Models.ScreensByMachineViewModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
@@ -7,27 +7,31 @@
|
||||
<h1>Details</h1>
|
||||
|
||||
<div>
|
||||
<h4>ScreensByMachine</h4>
|
||||
<h4>Screens by machine</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class="col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Screen)
|
||||
</dt>
|
||||
<dd class="col-sm-10">
|
||||
@Html.DisplayFor(model => model.Screen.Type)
|
||||
@Html.DisplayFor(model => model.Screen)
|
||||
</dd>
|
||||
<dt class="col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Machine)
|
||||
</dt>
|
||||
<dd class="col-sm-10">
|
||||
@Html.DisplayFor(model => model.Machine.Name)
|
||||
@Html.DisplayFor(model => model.Machine)
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-action="Edit"
|
||||
asp-route-id="@Model.Id">
|
||||
asp-route-id="@Model.Id"
|
||||
class="btn btn-primary">
|
||||
Edit
|
||||
</a> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</a>
|
||||
<a asp-action="Index"
|
||||
class="btn btn-secondary">
|
||||
Back to List
|
||||
</a>
|
||||
</div>
|
||||
@@ -2,7 +2,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<Version>3.0.99.747</Version>
|
||||
<Version>3.0.99.748</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