using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; #nullable disable // // This is here so CodeMaid doesn't reorganize this document // namespace MP.Data.DatabaseModels { public partial class MappaStatoExpl { public int RowNum { get; set; } public DateTime? LastUpdate { get; set; } public string IdxMacchina { get; set; } public string CodMacchina { get; set; } public string Nome { get; set; } public string Url { get; set; } public int? IdxOdl { get; set; } = 0; public int? IdxPOdl { get; set; } = 0; public string CodArticolo { get; set; } public string Disegno { get; set; } public int NumPezzi { get; set; } = 0; public decimal TCAssegnato { get; set; } = 0; public DateTime? DataInizioOdl { get; set; } public string Semaforo { get; set; } public int? IdxStato { get; set; } public string DescrizioneStato { get; set; } public double? Durata { get; set; } public int PezziProd { get; set; } = 0; public int PezziConf { get; set; } = 0; public decimal? TempoOn { get; set; } public decimal? TempoAuto { get; set; } public decimal? TempoRun { get; set; } public decimal? TCMedio { get; set; } public decimal? TCLav { get; set; } public decimal? TCEff { get; set; } public decimal? TCMedioRt { get; set; } public decimal? TCLavRT { get; set; } public decimal? TCEffRT { get; set; } [NotMapped] public decimal TProd { get { return (TCAssegnato) * (PezziConf); } } [NotMapped] public string OEE_tot { get { string answ = "N/A"; decimal denom = TempoOn ?? 1; if (denom != 0) { var oee = ((TCAssegnato) * (PezziConf)) / denom; answ = $"{oee:P2}"; } return answ; } } [NotMapped] public int extraVal { get { int answ = 0; if(NumPezzi < PezziProd) { answ = Math.Abs(NumPezzi - PezziProd); } return answ; } } [NotMapped] public string OEE_wrk { get { string answ = "N/A"; decimal denom = TempoAuto ?? 1; if (denom != 0) { var oee = ((TCAssegnato) * (PezziConf)) / denom; answ = $"{oee:P2}"; } return answ; } } [NotMapped] public string OEE_run { get { string answ = "N/A"; decimal denom = TempoRun ?? 1; if (denom != 0) { var oee = ((TCAssegnato) * (PezziConf)) / denom; answ = $"{oee:P2}"; } return answ; } } [NotMapped] public string OEE_RT_tot { get { string answ = "N/A"; decimal denom = TCMedioRt ?? 1; if (denom != 0) { var oee = ((TCAssegnato)) / denom; answ = $"{oee:P2}"; } return answ; } } [NotMapped] public string OEE_RT_wrk { get { string answ = "N/A"; decimal denom = TCLavRT ?? 1; if (denom != 0) { var oee = ((TCAssegnato)) / denom; answ = $"{oee:P2}"; } return answ; } } [NotMapped] public string OEE_RT_run { get { string answ = "N/A"; decimal denom = TCEffRT ?? 1; if (denom != 0) { var oee = ((TCAssegnato)) / denom; answ = $"{oee:P2}"; } return answ; } } [NotMapped] public bool ReqFulfill { get { return PezziProd >= NumPezzi; } } } }