using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; namespace EgtBEAMWALL.DataLayer.DatabaseModels { // // This is here so CodeMaid doesn't reorganize this document // [Table("MaterialsList")] public partial class MaterialModel { /// /// Init classe /// public MaterialModel() { RawItemList = new HashSet(); } /// /// Primary Key AUTO /// [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int MatId { get; set; } /// /// Codice materiale (Identificativo DB esterno del magazzino in sync) /// public int MatCloudId { get; set; } = 0; /// /// Codice Materiale /// public string MatCode { get; set; } = ""; /// /// Descrizione Materiale /// public string MatDesc { get; set; } = ""; /// /// Lenght/Lunghezza in mm /// public decimal LMm { get; set; } = 0; /// /// Width/Larghezza in mm /// public decimal WMm { get; set; } = 0; /// /// Height (Thikness/Spessore) in mm /// public decimal HMm { get; set; } = 0; /// /// ID dell'ultimo articolo (variante) usato per il materiale /// public int RawItemIdLast { get; set; } = 0; #if false /// /// Lenght/Lunghezza in inch /// [NotMapped] public decimal LIn { get => Math.Round(LMm / (decimal)25.4, 3); } /// /// Width/Larghezza in inch /// [NotMapped] public decimal WIn { get => Math.Round(WMm / (decimal)25.4, 3); } /// /// Height/Altezza (Thikness/Spessore) in inch /// [NotMapped] public decimal HIn { get => Math.Round(HMm / (decimal)25.4, 3); } /// /// Codice materiale x QR/Datamatrix /// [NotMapped] public string MatDtmx { get => $"MT{MatExtId:00000000}"; } #endif /// /// Verifica che sia Beam, quando L == 0 /// [NotMapped] public bool IsBeam { get => (LMm == 0 && (HMm > 0 && WMm > 0)); } /// /// Verifica che sia Wall, quando W/L == 0 /// [NotMapped] public bool IsWall { get => (LMm == 0 && WMm == 0); } public virtual ICollection RawItemList { get; set; } } }