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 // //[Index(nameof(Installazione), nameof(Active), nameof(DiskStatus))] [Table("RawItemList")] public partial class RawItemModel { /// /// Primary Key AUTO /// [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int RawItemId { get; set; } /// /// Codice RawMat univoco e in sync (Identificativo DB esterno del magazzino in sync) /// public int RawItemCloudId { get; set; } = 0; /// /// ForeignKey Materiale /// public int MatId { get; set; } = 0; /// /// Qty available on wharehouse /// public int QtyAvail { get; set; } = 0; /// /// Active/ = can be used /// public bool IsActive { get; set; } = false; /// /// Remnant /// public bool IsRemn { get; set; } = false; /// /// Item's Lenght /// public decimal LMm { get; set; } = 0; /// /// Item's Width /// public decimal WMm { get; set; } = 0; /// /// Item's Height (Thikness/Spessore) in mm /// public decimal HMm { get; set; } = 0; /// /// Note (optional) /// public string Note { get; set; } = ""; /// /// Indica se debba usare qty effettiva o indefinita (x nesting/schedulazione a capacita illimitata) /// public bool UseQty { get; set; } = false; /// /// DataOra ultimo aggiornamento dal cloud dei dati (in particolare giacenza) /// public DateTime LastSync { get; set; } = DateTime.Today.AddYears(-10); #if false [NotMapped] public decimal LIn { get => Math.Round(LMm / (decimal)25.4, 3); } [NotMapped] public decimal WIn { get => Math.Round(WMm / (decimal)25.4, 3); } [NotMapped] public decimal HIn { get => Math.Round(HMm / (decimal)25.4, 3); } [NotMapped] public decimal Area { get => LMm * WMm; } [NotMapped] public string ItemDtmx { get { string answ = $"MT99999999-{LMm * 1000:00000000}"; if (MaterialNav != null) { answ = $"MT{MaterialNav.MatExtId:00000000}-{LMm * 1000:00000000}"; } return answ; } } #endif /// /// Navigation property to Material /// [ForeignKey("MatId")] public virtual MaterialModel MaterialNav { get; set; } } }