diff --git a/Cicm.Database/Models/Processor.cs b/Cicm.Database/Models/Processor.cs index a39bf6ec..bbdc331a 100644 --- a/Cicm.Database/Models/Processor.cs +++ b/Cicm.Database/Models/Processor.cs @@ -31,6 +31,8 @@ using System; using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations.Schema; namespace Cicm.Database.Models { @@ -42,36 +44,58 @@ namespace Cicm.Database.Models ProcessorsByMachine = new HashSet(); } - public int Id { get; set; } - public string Name { get; set; } - public int? CompanyId { get; set; } - public string ModelCode { get; set; } - public DateTime? Introduced { get; set; } - public int? InstructionSetId { get; set; } - public double? Speed { get; set; } - public string Package { get; set; } - public int? Gprs { get; set; } - public int? GprSize { get; set; } - public int? Fprs { get; set; } - public int? FprSize { get; set; } - public int? Cores { get; set; } - public int? ThreadsPerCore { get; set; } - public string Process { get; set; } - public float? ProcessNm { get; set; } - public float? DieSize { get; set; } - public long? Transistors { get; set; } - public int? DataBus { get; set; } - public int? AddrBus { get; set; } - public int? SimdRegisters { get; set; } - public int? SimdSize { get; set; } - public float? L1Instruction { get; set; } - public float? L1Data { get; set; } - public float? L2 { get; set; } - public float? L3 { get; set; } + 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; } + [DisplayName("Instruction set")] + public int? InstructionSetId { get; set; } + [DisplayName("Nominal speed (MHz)")] + public double? Speed { get; set; } + public string Package { get; set; } + [DisplayName("General Purpose Registers")] + public int? Gprs { get; set; } + [DisplayName("General Purporse Register size")] + public int? GprSize { get; set; } + [DisplayName("Floating Point Registers")] + public int? Fprs { get; set; } + [DisplayName("Floating Point Register Size")] + public int? FprSize { get; set; } + public int? Cores { get; set; } + [DisplayName("Threads per core")] + public int? ThreadsPerCore { 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; } + [DisplayName("Data bus size")] + public int? DataBus { get; set; } + [DisplayName("Address bus size")] + public int? AddrBus { get; set; } + [DisplayName("SIMD registers")] + public int? SimdRegisters { get; set; } + [DisplayName("SIMD register size")] + public int? SimdSize { get; set; } + [DisplayName("L1 instruction cache (KiB)")] + public float? L1Instruction { get; set; } + [DisplayName("L1 data cache (KiB)")] + public float? L1Data { get; set; } + [DisplayName("L2 cache (KiB)")] + public float? L2 { get; set; } + [DisplayName("L3 cache (KiB)")] + public float? L3 { get; set; } - public virtual Company Company { get; set; } - public virtual InstructionSet InstructionSet { get; set; } + public virtual Company Company { get; set; } + [DisplayName("Instruction set")] + public virtual InstructionSet InstructionSet { get; set; } public virtual ICollection InstructionSetExtensions { get; set; } public virtual ICollection ProcessorsByMachine { get; set; } + + [NotMapped] + public string IntroducedView => Introduced?.ToShortDateString() ?? "Unknown"; } } \ No newline at end of file diff --git a/cicm_web/Areas/Admin/Controllers/ProcessorsController.cs b/cicm_web/Areas/Admin/Controllers/ProcessorsController.cs index b9e39b68..1d15c2dd 100644 --- a/cicm_web/Areas/Admin/Controllers/ProcessorsController.cs +++ b/cicm_web/Areas/Admin/Controllers/ProcessorsController.cs @@ -55,7 +55,7 @@ namespace cicm_web.Areas.Admin.Controllers { IIncludableQueryable cicmContext = _context.Processors.Include(p => p.Company).Include(p => p.InstructionSet); - return View(await cicmContext.ToListAsync()); + return View(await cicmContext.OrderBy(p => p.Company.Name).ThenBy(p => p.Name).ToListAsync()); } // GET: Admin/Processors/Details/5 diff --git a/cicm_web/Areas/Admin/Views/Processors/Create.cshtml b/cicm_web/Areas/Admin/Views/Processors/Create.cshtml index b9fd9a03..c94099f6 100644 --- a/cicm_web/Areas/Admin/Views/Processors/Create.cshtml +++ b/cicm_web/Areas/Admin/Views/Processors/Create.cshtml @@ -46,7 +46,7 @@ class="text-danger">
-
+
+ + + + +
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
- Edit - Back to List -
+ + Edit + + + Back to List + + \ No newline at end of file diff --git a/cicm_web/Areas/Admin/Views/Processors/Edit.cshtml b/cicm_web/Areas/Admin/Views/Processors/Edit.cshtml index 5acbaf8a..78d1c5e6 100644 --- a/cicm_web/Areas/Admin/Views/Processors/Edit.cshtml +++ b/cicm_web/Areas/Admin/Views/Processors/Edit.cshtml @@ -48,24 +48,21 @@
- - - - -
-
- - +
+ + +
@@ -97,9 +94,6 @@ class="form-control" asp-items="ViewBag.InstructionSetId"> - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +