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

24 lines
820 B
C#
Raw Normal View History

2020-05-24 02:12:37 +01:00
using System;
2019-05-19 23:51:16 +01:00
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
2020-02-10 02:20:48 +00:00
namespace Marechai.Areas.Admin.Models
2019-05-19 23:51:16 +01:00
{
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; }
2020-02-10 22:44:18 +00:00
[DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)]
2019-05-19 23:51:16 +01:00
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";
}
}