Annotate GPU fields.

This commit is contained in:
2019-05-18 20:28:51 +01:00
parent c93b42e38e
commit 8bedb56cb7
5 changed files with 38 additions and 23 deletions

View File

@@ -31,6 +31,8 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
namespace Cicm.Database.Models
{
@@ -45,16 +47,22 @@ namespace Cicm.Database.Models
public int Id { get; set; }
public string Name { get; set; }
public int? CompanyId { get; set; }
[DisplayName("Model code")]
public string ModelCode { get; set; }
public DateTime? Introduced { get; set; }
public string Package { get; set; }
public string Process { get; set; }
[DisplayName("Process (nm)")]
public float? ProcessNm { get; set; }
[DisplayName("Die size (mm²)")]
public float? DieSize { get; set; }
public long? Transistors { get; set; }
public virtual Company Company { get; set; }
public virtual ICollection<GpusByMachine> GpusByMachine { get; set; }
public virtual ICollection<ResolutionsByGpu> ResolutionsByGpu { get; set; }
[NotMapped]
public string IntroducedView => Introduced?.ToShortDateString() ?? "Unknown";
}
}

View File

@@ -64,7 +64,7 @@
@Html.DisplayNameFor(model => model.Introduced)
</dt>
<dd>
@Html.DisplayFor(model => model.Introduced)
@Html.DisplayFor(model => model.IntroducedView)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Package)

View File

@@ -41,6 +41,12 @@
<h4>GPU</h4>
<hr />
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.Company)
</dt>
<dd>
@Html.DisplayFor(model => model.Company.Name)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Name)
</dt>
@@ -57,7 +63,7 @@
@Html.DisplayNameFor(model => model.Introduced)
</dt>
<dd>
@Html.DisplayFor(model => model.Introduced)
@Html.DisplayFor(model => model.IntroducedView)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Package)
@@ -89,15 +95,16 @@
<dd>
@Html.DisplayFor(model => model.Transistors)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Company)
</dt>
<dd>
@Html.DisplayFor(model => model.Company.Name)
</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>

View File

@@ -76,7 +76,7 @@
@Html.DisplayFor(modelItem => item.ModelCode)
</td>
<td>
@Html.DisplayFor(modelItem => item.Introduced)
@Html.DisplayFor(modelItem => item.IntroducedView)
</td>
<td>
<a asp-action="Details"

View File

@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>3.0.99.431</Version>
<Version>3.0.99.432</Version>
<Company>Canary Islands Computer Museum</Company>
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
<Product>Canary Islands Computer Museum Website</Product>