Files
marechai/cicm_web/Areas/Admin/Models/MachineViewModel.cs

25 lines
826 B
C#
Raw Normal View History

2019-05-19 23:51:16 +01:00
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
2020-02-10 02:10:18 +00:00
using Marechai.Database;
2019-05-19 23:51:16 +01:00
namespace cicm_web.Areas.Admin.Models
{
2019-05-27 11:47:28 +01:00
public class MachineViewModel : BaseViewModel<int>
2019-05-19 23:51:16 +01:00
{
[StringLength(255)]
public string Name { get; set; }
public MachineType Type { get; set; }
[DisplayFormat(DataFormatString = "{0:d}")]
[DataType(DataType.Date)]
public DateTime? Introduced { get; set; }
public string Family { get; set; }
[StringLength(50)]
2019-05-27 11:47:28 +01:00
public string Model { get; set; }
2019-05-19 23:51:16 +01:00
public string Company { get; set; }
[DisplayName("Introduced")]
public string IntroducedView =>
Introduced == DateTime.MinValue ? "Prototype" : Introduced?.ToShortDateString() ?? "Unknown";
}
}