using System; using System.ComponentModel.DataAnnotations.Schema; #nullable disable // // This is here so CodeMaid doesn't reorganize this document // namespace MP.Data.DbModels { public partial class MappaStatoExplModel { 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; } } public override bool Equals(object obj) { if (!(obj is MappaStatoExplModel item)) return false; if (RowNum != item.RowNum) return false; if (LastUpdate != item.LastUpdate) return false; if (IdxMacchina != item.IdxMacchina) return false; if (CodMacchina != item.CodMacchina) return false; if (Nome != item.Nome) return false; if (Url != item.Url) return false; if (IdxOdl != item.IdxOdl) return false; if (IdxPOdl != item.IdxPOdl) return false; if (CodArticolo != item.CodArticolo) return false; if (Disegno != item.Disegno) return false; if (NumPezzi != item.NumPezzi) return false; if (TCAssegnato != item.TCAssegnato) return false; if (DataInizioOdl != item.DataInizioOdl) return false; if (Semaforo != item.Semaforo) return false; if (IdxStato != item.IdxStato) return false; if (DescrizioneStato != item.DescrizioneStato) return false; if (Durata != item.Durata) return false; if (PezziProd != item.PezziProd) return false; if (PezziConf != item.PezziConf) return false; if (TempoOn != item.TempoOn) return false; if (TempoAuto != item.TempoAuto) return false; if (TempoRun != item.TempoRun) return false; if (TCMedio != item.TCMedio) return false; if (TCLav != item.TCLav) return false; if (TCEff != item.TCEff) return false; if (TCMedioRt != item.TCMedioRt) return false; if (TCLavRT != item.TCLavRT) return false; if (TCEffRT != item.TCEffRT) return false; return true; } public bool MostlyEquals(object obj) { if (!(obj is MappaStatoExplModel item)) return false; if (RowNum != item.RowNum) return false; //if (LastUpdate != item.LastUpdate) // return false; if (IdxMacchina != item.IdxMacchina) return false; if (CodMacchina != item.CodMacchina) return false; if (Nome != item.Nome) return false; if (Url != item.Url) return false; if (IdxOdl != item.IdxOdl) return false; if (IdxPOdl != item.IdxPOdl) return false; if (CodArticolo != item.CodArticolo) return false; if (Disegno != item.Disegno) return false; if (NumPezzi != item.NumPezzi) return false; if (TCAssegnato != item.TCAssegnato) return false; if (DataInizioOdl != item.DataInizioOdl) return false; if (Semaforo != item.Semaforo) return false; if (IdxStato != item.IdxStato) return false; //if (DescrizioneStato != item.DescrizioneStato) // return false; //if (Durata != item.Durata) // return false; if (PezziProd != item.PezziProd) return false; if (PezziConf != item.PezziConf) return false; //if (TempoOn != item.TempoOn) // return false; //if (TempoAuto != item.TempoAuto) // return false; //if (TempoRun != item.TempoRun) // return false; //if (TCMedio != item.TCMedio) // return false; //if (TCLav != item.TCLav) // return false; //if (TCEff != item.TCEff) // return false; //if (TCMedioRt != item.TCMedioRt) // return false; //if (TCLavRT != item.TCLavRT) // return false; //if (TCEffRT != item.TCEffRT) // return false; return true; } public override int GetHashCode() { return base.GetHashCode(); } } }