mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Set date datatypes in model.
This commit is contained in:
@@ -52,7 +52,8 @@ namespace Cicm.Database.Models
|
||||
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
[DisplayFormat(DataFormatString = "{0:d}")]
|
||||
[DisplayFormat(DataFormatString = "{0:d}", ApplyFormatInEditMode = true)]
|
||||
[DataType(DataType.Date)]
|
||||
public DateTime? Founded { get; set; }
|
||||
[Url]
|
||||
[StringLength(255)]
|
||||
@@ -62,6 +63,7 @@ namespace Cicm.Database.Models
|
||||
[StringLength(45)]
|
||||
public string Facebook { get; set; }
|
||||
[DisplayFormat(DataFormatString = "{0:d}")]
|
||||
[DataType(DataType.Date)]
|
||||
public DateTime? Sold { get; set; }
|
||||
public int? SoldToId { get; set; }
|
||||
[StringLength(80)]
|
||||
@@ -105,6 +107,6 @@ namespace Cicm.Database.Models
|
||||
: Sold.Value.ToShortDateString();
|
||||
|
||||
[NotMapped]
|
||||
public CompanyDescription Description => Descriptions.FirstOrDefault();
|
||||
public CompanyDescription Description => Descriptions?.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
@@ -53,6 +53,7 @@ namespace Cicm.Database.Models
|
||||
[StringLength(45)]
|
||||
public string ModelCode { get; set; }
|
||||
[DisplayFormat(DataFormatString = "{0:d}")]
|
||||
[DataType(DataType.Date)]
|
||||
public DateTime? Introduced { get; set; }
|
||||
[StringLength(45)]
|
||||
public string Package { get; set; }
|
||||
|
||||
@@ -55,6 +55,7 @@ namespace Cicm.Database.Models
|
||||
[Required]
|
||||
public MachineType Type { get; set; }
|
||||
[DisplayFormat(DataFormatString = "{0:d}")]
|
||||
[DataType(DataType.Date)]
|
||||
public DateTime? Introduced { get; set; }
|
||||
public int? FamilyId { get; set; }
|
||||
[StringLength(50)]
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace Cicm.Database.Models
|
||||
[StringLength(45)]
|
||||
public string ModelCode { get; set; }
|
||||
[DisplayFormat(DataFormatString = "{0:d}")]
|
||||
[DataType(DataType.Date)]
|
||||
public DateTime? Introduced { get; set; }
|
||||
[DisplayName("Instruction set")]
|
||||
public int? InstructionSetId { get; set; }
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace Cicm.Database.Models
|
||||
[StringLength(45)]
|
||||
public string ModelCode { get; set; }
|
||||
[DisplayFormat(DataFormatString = "{0:d}")]
|
||||
[DataType(DataType.Date)]
|
||||
public DateTime? Introduced { get; set; }
|
||||
[DisplayName("PCM voices")]
|
||||
[Range(1, int.MaxValue)]
|
||||
|
||||
Reference in New Issue
Block a user