using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; #nullable disable // // This is here so CodeMaid doesn't reorganize this document // namespace MP.Data.DatabaseModels { [Table("v_ODL_exp")] public partial class ODLExpModel { #region Public Properties [Key] public int IdxOdl { get; set; } public string CodArticolo { get; set; } = ""; public string IdxMacchina { get; set; } public int NumPezzi { get; set; } public decimal Tcassegnato { get; set; } public decimal TCRichAttr { get; set; } public DateTime? DataInizio { get; set; } public DateTime? DataFine { get; set; } [MaxLength(2500)] public string Note { get; set; } = ""; public string KeyRichiesta { get; set; } public int PzPallet { get; set; } = 1; public string CodCli { get; set; } = ""; [NotMapped] public string DurataMinuti { get { string answ = ""; DateTime end = DataFine != null ? (DateTime)DataFine : DateTime.Now; var tsDurata = (end).Subtract((DateTime)DataInizio); if (tsDurata.TotalDays < 1) { answ = $"{tsDurata.Hours:00}h {tsDurata.Minutes:00}'"; } else { answ = $"{tsDurata.Days}gg {tsDurata.Hours:00}h"; } return answ; } } /// /// Navigazione oggetto Machine /// [ForeignKey("IdxMacchina")] public virtual Macchine MachineNav { get; set; } = null!; /// /// Navigazione oggetto Articolo /// [ForeignKey("CodArticolo")] public virtual AnagArticoli ArticoloNav { get; set; } = null!; public string DescArticolo { get; set; } = ""; public string CodMacchina { get; set; } = ""; public string Nome { get; set; } = ""; public string OperSetup { get; set; } #endregion Public Properties } }