From a90a62cd7a8fd8bcfb76c972176331d80a463f45 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 17 May 2021 13:33:13 +0200 Subject: [PATCH] COmpleto rename MP.Data --- MP.Data/Constants.cs | 12 + MP.Data/Controllers/MpStatsController.cs | 85 + MP.Data/DatabaseModels/Aaul.cs | 13 + MP.Data/DatabaseModels/Cal.cs | 18 + MP.Data/DatabaseModels/Config.cs | 15 + MP.Data/DatabaseModels/Ddb.cs | 15 + MP.Data/DatabaseModels/Ddb1.cs | 24 + MP.Data/DatabaseModels/DdbTurni.cs | 30 + MP.Data/DatabaseModels/DdbTurniNew.cs | 30 + MP.Data/DatabaseModels/DdbTurniSummary.cs | 21 + MP.Data/DatabaseModels/DdbTurniSummaryNew.cs | 21 + MP.Data/DatabaseModels/Ecp.cs | 23 + MP.Data/DatabaseModels/Ecp1.cs | 21 + MP.Data/DatabaseModels/Kit.cs | 14 + MP.Data/DatabaseModels/Odl.cs | 26 + MP.Data/DatabaseModels/Odl1.cs | 30 + MP.Data/DatabaseModels/R.cs | 23 + MP.Data/DatabaseModels/R1.cs | 22 + MP.Data/DatabaseModels/Rc.cs | 19 + MP.Data/DatabaseModels/ResControlli.cs | 23 + MP.Data/DatabaseModels/ResScarti.cs | 26 + MP.Data/DatabaseModels/Tally.cs | 12 + MP.Data/DatabaseModels/TcStat.cs | 16 + MP.Data/DatabaseModels/Tcr.cs | 19 + MP.Data/DatabaseModels/Tcr1.cs | 20 + MP.Data/DatabaseModels/TcrDay.cs | 19 + MP.Data/DatabaseModels/TcrDayTest.cs | 19 + MP.Data/DatabaseModels/TestJason.cs | 14 + MP.Data/DatabaseModels/Ul.cs | 21 + MP.Data/DatabaseModels/UserActionLog.cs | 25 + MP.Data/DatabaseModels/VDdb.cs | 24 + MP.Data/DatabaseModels/VDdbLight.cs | 18 + MP.Data/DatabaseModels/VDdbLightOld.cs | 18 + MP.Data/DatabaseModels/VDdbTurni.cs | 26 + MP.Data/DatabaseModels/VEcp.cs | 21 + MP.Data/DatabaseModels/VEcp1.cs | 25 + MP.Data/DatabaseModels/VEcpExtended.cs | 27 + MP.Data/DatabaseModels/VKit.cs | 14 + MP.Data/DatabaseModels/VOdl.cs | 30 + MP.Data/DatabaseModels/VOdl1.cs | 28 + MP.Data/DatabaseModels/VPodlNonChiusi.cs | 30 + MP.Data/DatabaseModels/VR1.cs | 23 + MP.Data/DatabaseModels/VTcStat.cs | 18 + MP.Data/DatabaseModels/VTcr.cs | 20 + MP.Data/DatabaseModels/VTcr1.cs | 21 + MP.Data/DatabaseModels/VTcrDay.cs | 21 + MP.Data/DatabaseModels/VetoTc.cs | 15 + MP.Data/Enums.cs | 8 + MP.Data/MP.Data.csproj | 65 + MP.Data/MoonPro_STATSContext.cs | 1606 ++++++++++++++++++ MP.Data/Resources/Readme.md | 23 + MP.Data/StatsDbContext.cs | 12 + 52 files changed, 2769 insertions(+) create mode 100644 MP.Data/Constants.cs create mode 100644 MP.Data/Controllers/MpStatsController.cs create mode 100644 MP.Data/DatabaseModels/Aaul.cs create mode 100644 MP.Data/DatabaseModels/Cal.cs create mode 100644 MP.Data/DatabaseModels/Config.cs create mode 100644 MP.Data/DatabaseModels/Ddb.cs create mode 100644 MP.Data/DatabaseModels/Ddb1.cs create mode 100644 MP.Data/DatabaseModels/DdbTurni.cs create mode 100644 MP.Data/DatabaseModels/DdbTurniNew.cs create mode 100644 MP.Data/DatabaseModels/DdbTurniSummary.cs create mode 100644 MP.Data/DatabaseModels/DdbTurniSummaryNew.cs create mode 100644 MP.Data/DatabaseModels/Ecp.cs create mode 100644 MP.Data/DatabaseModels/Ecp1.cs create mode 100644 MP.Data/DatabaseModels/Kit.cs create mode 100644 MP.Data/DatabaseModels/Odl.cs create mode 100644 MP.Data/DatabaseModels/Odl1.cs create mode 100644 MP.Data/DatabaseModels/R.cs create mode 100644 MP.Data/DatabaseModels/R1.cs create mode 100644 MP.Data/DatabaseModels/Rc.cs create mode 100644 MP.Data/DatabaseModels/ResControlli.cs create mode 100644 MP.Data/DatabaseModels/ResScarti.cs create mode 100644 MP.Data/DatabaseModels/Tally.cs create mode 100644 MP.Data/DatabaseModels/TcStat.cs create mode 100644 MP.Data/DatabaseModels/Tcr.cs create mode 100644 MP.Data/DatabaseModels/Tcr1.cs create mode 100644 MP.Data/DatabaseModels/TcrDay.cs create mode 100644 MP.Data/DatabaseModels/TcrDayTest.cs create mode 100644 MP.Data/DatabaseModels/TestJason.cs create mode 100644 MP.Data/DatabaseModels/Ul.cs create mode 100644 MP.Data/DatabaseModels/UserActionLog.cs create mode 100644 MP.Data/DatabaseModels/VDdb.cs create mode 100644 MP.Data/DatabaseModels/VDdbLight.cs create mode 100644 MP.Data/DatabaseModels/VDdbLightOld.cs create mode 100644 MP.Data/DatabaseModels/VDdbTurni.cs create mode 100644 MP.Data/DatabaseModels/VEcp.cs create mode 100644 MP.Data/DatabaseModels/VEcp1.cs create mode 100644 MP.Data/DatabaseModels/VEcpExtended.cs create mode 100644 MP.Data/DatabaseModels/VKit.cs create mode 100644 MP.Data/DatabaseModels/VOdl.cs create mode 100644 MP.Data/DatabaseModels/VOdl1.cs create mode 100644 MP.Data/DatabaseModels/VPodlNonChiusi.cs create mode 100644 MP.Data/DatabaseModels/VR1.cs create mode 100644 MP.Data/DatabaseModels/VTcStat.cs create mode 100644 MP.Data/DatabaseModels/VTcr.cs create mode 100644 MP.Data/DatabaseModels/VTcr1.cs create mode 100644 MP.Data/DatabaseModels/VTcrDay.cs create mode 100644 MP.Data/DatabaseModels/VetoTc.cs create mode 100644 MP.Data/Enums.cs create mode 100644 MP.Data/MP.Data.csproj create mode 100644 MP.Data/MoonPro_STATSContext.cs create mode 100644 MP.Data/Resources/Readme.md create mode 100644 MP.Data/StatsDbContext.cs diff --git a/MP.Data/Constants.cs b/MP.Data/Constants.cs new file mode 100644 index 00000000..4abf10f1 --- /dev/null +++ b/MP.Data/Constants.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MP.Data +{ + class Constants + { + } +} diff --git a/MP.Data/Controllers/MpStatsController.cs b/MP.Data/Controllers/MpStatsController.cs new file mode 100644 index 00000000..0b1d43eb --- /dev/null +++ b/MP.Data/Controllers/MpStatsController.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Configuration; +using NLog; +using Microsoft.Extensions.Configuration; + +namespace MP.Data.Controllers +{ + public class MpStatsController : IDisposable + { + #region Private Fields + + private static IConfiguration _configuration; + private static MoonPro_STATSContext dbCtx; + private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); + + #endregion Private Fields + + #region Public Constructors + + public MpStatsController(IConfiguration configuration) + { + _configuration = configuration; + dbCtx = new MoonPro_STATSContext(configuration); + Log.Info("Avviata classe MpStatsController.MpStatsController"); + } + + #endregion Public Constructors + + #region Public Methods + + public void Dispose() + { + // Clear database context + dbCtx.Dispose(); + } + + /// + /// Annulla modifiche su una specifica entity (cancel update) + /// + /// + /// + public bool rollBackEntity(object item) + { + bool answ = false; + try + { + if (dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Deleted || dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Modified) + { + dbCtx.Entry(item).Reload(); + } + } + catch (Exception exc) + { + Log.Error($"Eccezione in rollBackEntity{Environment.NewLine}{exc}"); + } + return answ; + } + + /// + /// Elenco tabella scarti da filtro + /// + /// + /// + /// + public List ScartiGetAll(int numRecord, string searchVal = "") + { + List dbResult = new List(); + + dbResult = dbCtx + .DbSetScarti + .Where(x => x.KeyRichiesta.Contains(searchVal) || x.Descrizione.Contains(searchVal) || x.CodArticolo.Contains(searchVal) || string.IsNullOrEmpty(searchVal)) + .OrderByDescending(x => x.DataOra) + .Take(numRecord) + .ToList(); + + return dbResult; + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/MP.Data/DatabaseModels/Aaul.cs b/MP.Data/DatabaseModels/Aaul.cs new file mode 100644 index 00000000..f639d8c7 --- /dev/null +++ b/MP.Data/DatabaseModels/Aaul.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Aaul + { + public string Azione { get; set; } + public string Descrizione { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/Cal.cs b/MP.Data/DatabaseModels/Cal.cs new file mode 100644 index 00000000..62ac75a3 --- /dev/null +++ b/MP.Data/DatabaseModels/Cal.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Cal + { + public DateTime Giorno { get; set; } + public bool? DoDdb { get; set; } + public bool? DoTcr { get; set; } + public bool? DoUl { get; set; } + public bool? DoEcp { get; set; } + public bool? DoRs { get; set; } + public bool? DoOdl { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/Config.cs b/MP.Data/DatabaseModels/Config.cs new file mode 100644 index 00000000..e994d899 --- /dev/null +++ b/MP.Data/DatabaseModels/Config.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Config + { + public string Chiave { get; set; } + public string Valore { get; set; } + public string ValoreStd { get; set; } + public string Note { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/Ddb.cs b/MP.Data/DatabaseModels/Ddb.cs new file mode 100644 index 00000000..01eb95f0 --- /dev/null +++ b/MP.Data/DatabaseModels/Ddb.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Ddb + { + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public int IdxStato { get; set; } + public decimal DurataMinuti { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/Ddb1.cs b/MP.Data/DatabaseModels/Ddb1.cs new file mode 100644 index 00000000..60291b02 --- /dev/null +++ b/MP.Data/DatabaseModels/Ddb1.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Ddb1 + { + public string IdxMacchina { get; set; } + public DateTime InizioStato { get; set; } + public DateTime? FineStato { get; set; } + public int IdxStato { get; set; } + public double? DurataMinuti { get; set; } + public string Value { get; set; } + public string CodArticolo { get; set; } + public double? TempoCicloBase { get; set; } + public int? PzPalletProd { get; set; } + public int? MatrOpr { get; set; } + public string Pallet { get; set; } + public string Descrizione { get; set; } + public string ClasseTempo { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/DdbTurni.cs b/MP.Data/DatabaseModels/DdbTurni.cs new file mode 100644 index 00000000..4fc7e14d --- /dev/null +++ b/MP.Data/DatabaseModels/DdbTurni.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class DdbTurni + { + public DateTime DataRif { get; set; } + public string IdxMacchina { get; set; } + public string Turno { get; set; } + public int IdxStato { get; set; } + public string CodArticolo { get; set; } + public DateTime InizioStato { get; set; } + public DateTime FineStato { get; set; } + public string Pallet { get; set; } + public int? PzPalletProd { get; set; } + public decimal? TempoCicloBase { get; set; } + public string Descrizione { get; set; } + public string ClasseTempo { get; set; } + public DateTime? DataTurnoInizio { get; set; } + public DateTime? DataTurnoFine { get; set; } + public long? DurataStato { get; set; } + public DateTime InizioPeriodo { get; set; } + public DateTime? FinePeriodo { get; set; } + public long? DurataPeriodo { get; set; } + public int TotPzProd { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/DdbTurniNew.cs b/MP.Data/DatabaseModels/DdbTurniNew.cs new file mode 100644 index 00000000..37bf31d9 --- /dev/null +++ b/MP.Data/DatabaseModels/DdbTurniNew.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class DdbTurniNew + { + public DateTime DataRif { get; set; } + public string IdxMacchina { get; set; } + public string Turno { get; set; } + public int IdxStato { get; set; } + public string CodArticolo { get; set; } + public DateTime InizioStato { get; set; } + public DateTime FineStato { get; set; } + public string Pallet { get; set; } + public int? PzPalletProd { get; set; } + public decimal? TempoCicloBase { get; set; } + public string Descrizione { get; set; } + public string ClasseTempo { get; set; } + public DateTime? DataTurnoInizio { get; set; } + public DateTime? DataTurnoFine { get; set; } + public long? DurataStato { get; set; } + public DateTime InizioPeriodo { get; set; } + public DateTime? FinePeriodo { get; set; } + public long? DurataPeriodo { get; set; } + public int TotPzProd { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/DdbTurniSummary.cs b/MP.Data/DatabaseModels/DdbTurniSummary.cs new file mode 100644 index 00000000..5db34143 --- /dev/null +++ b/MP.Data/DatabaseModels/DdbTurniSummary.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class DdbTurniSummary + { + public string IdxMacchina { get; set; } + public DateTime DataRif { get; set; } + public string Turno { get; set; } + public string CodArticolo { get; set; } + public int IdxStato { get; set; } + public decimal TempoCicloBase { get; set; } + public DateTime? Inizio { get; set; } + public int PzPalletProd { get; set; } + public decimal? Durata { get; set; } + public int? PzProd { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/DdbTurniSummaryNew.cs b/MP.Data/DatabaseModels/DdbTurniSummaryNew.cs new file mode 100644 index 00000000..1460328b --- /dev/null +++ b/MP.Data/DatabaseModels/DdbTurniSummaryNew.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class DdbTurniSummaryNew + { + public string IdxMacchina { get; set; } + public DateTime DataRif { get; set; } + public string Turno { get; set; } + public string CodArticolo { get; set; } + public int IdxStato { get; set; } + public decimal TempoCicloBase { get; set; } + public DateTime? Inizio { get; set; } + public int PzPalletProd { get; set; } + public decimal? Durata { get; set; } + public int? PzProd { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/Ecp.cs b/MP.Data/DatabaseModels/Ecp.cs new file mode 100644 index 00000000..09fb32dc --- /dev/null +++ b/MP.Data/DatabaseModels/Ecp.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Ecp + { + public int IdxEcp { get; set; } + public DateTime DataOraConf { get; set; } + public string IdxMacchina { get; set; } + public string KeyRichiesta { get; set; } + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public int PezziConf { get; set; } + public int PezziScar { get; set; } + public int PezziDaRilav { get; set; } + public int MatrOpr { get; set; } + public string Cognome { get; set; } + public string Nome { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/Ecp1.cs b/MP.Data/DatabaseModels/Ecp1.cs new file mode 100644 index 00000000..33a3a973 --- /dev/null +++ b/MP.Data/DatabaseModels/Ecp1.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Ecp1 + { + public DateTime DataOraConf { get; set; } + public string IdxMacchina { get; set; } + public int MatrApp { get; set; } + public DateTime DataFrom { get; set; } + public DateTime DataTo { get; set; } + public int PezziConf { get; set; } + public int PezziScar { get; set; } + public int PezziDaRilav { get; set; } + public string CommessaEsterna { get; set; } + public int TipoConf { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/Kit.cs b/MP.Data/DatabaseModels/Kit.cs new file mode 100644 index 00000000..cb25c5c0 --- /dev/null +++ b/MP.Data/DatabaseModels/Kit.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Kit + { + public string KeyKit { get; set; } + public string KeyExtOrd { get; set; } + public string CodArtParent { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/Odl.cs b/MP.Data/DatabaseModels/Odl.cs new file mode 100644 index 00000000..fa8f8bfa --- /dev/null +++ b/MP.Data/DatabaseModels/Odl.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Odl + { + public int IdxOdl { get; set; } + public string KeyRichiesta { get; set; } + public string CodArticolo { get; set; } + public decimal Tcassegnato { get; set; } + public string IdxMacchina { get; set; } + public int NumPezzi { get; set; } + public int NumPezziEv { get; set; } + public int NumPezziSca { get; set; } + public int NumPezziRil { get; set; } + public DateTime? DataInizio { get; set; } + public DateTime? DataFine { get; set; } + public string KeyRichiestaParent { get; set; } + public string CodArticoloParent { get; set; } + public DateTime? DueDate { get; set; } + public int? PzPallet { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/Odl1.cs b/MP.Data/DatabaseModels/Odl1.cs new file mode 100644 index 00000000..50436e07 --- /dev/null +++ b/MP.Data/DatabaseModels/Odl1.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Odl1 + { + 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 DateTime? DataInizio { get; set; } + public DateTime? DataFine { get; set; } + public string Note { get; set; } + public bool NeedAppr { get; set; } + public string UserAppr { get; set; } + public DateTime? DataAppr { get; set; } + public decimal? TcrichAttr { get; set; } + public string KeyRichiesta { get; set; } + public int PzPallet { get; set; } + public bool Provvisorio { get; set; } + public int MatrOpr { get; set; } + public string CommessaAs400 { get; set; } + public int ToAs400 { get; set; } + public DateTime? DueDate { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/R.cs b/MP.Data/DatabaseModels/R.cs new file mode 100644 index 00000000..8e58bf74 --- /dev/null +++ b/MP.Data/DatabaseModels/R.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class R + { + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public string Causale { get; set; } + public string Descrizione { get; set; } + public string Note { get; set; } + public int Qta { get; set; } + public string KeyRichiesta { get; set; } + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public int MatrOpr { get; set; } + public string Cognome { get; set; } + public string Nome { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/R1.cs b/MP.Data/DatabaseModels/R1.cs new file mode 100644 index 00000000..e4abb10d --- /dev/null +++ b/MP.Data/DatabaseModels/R1.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class R1 + { + public string IdxMacchina { get; set; } + public DateTime DataOra { get; set; } + public string Causale { get; set; } + public int Qta { get; set; } + public string Note { get; set; } + public string CodArticolo { get; set; } + public int MatrOpr { get; set; } + public DateTime? DataOraProdRec { get; set; } + public string Descrizione { get; set; } + public string KeyRichiesta { get; set; } + public int IdxOdl { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/Rc.cs b/MP.Data/DatabaseModels/Rc.cs new file mode 100644 index 00000000..8578e1a4 --- /dev/null +++ b/MP.Data/DatabaseModels/Rc.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Rc + { + public int IdxControllo { get; set; } + public DateTime DataOra { get; set; } + public string IdxMacchina { get; set; } + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public int MatrOpr { get; set; } + public bool EsitoOk { get; set; } + public string Note { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/ResControlli.cs b/MP.Data/DatabaseModels/ResControlli.cs new file mode 100644 index 00000000..77f46ee9 --- /dev/null +++ b/MP.Data/DatabaseModels/ResControlli.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class ResControlli + { + #region Public Properties + + public string CodArticolo { get; set; } + public DateTime DataOra { get; set; } + public bool EsitoOk { get; set; } + public int IdxControllo { get; set; } + public string IdxMacchina { get; set; } + public int IdxOdl { get; set; } + public int MatrOpr { get; set; } + public string Note { get; set; } + + #endregion Public Properties + } +} \ No newline at end of file diff --git a/MP.Data/DatabaseModels/ResScarti.cs b/MP.Data/DatabaseModels/ResScarti.cs new file mode 100644 index 00000000..4d66d124 --- /dev/null +++ b/MP.Data/DatabaseModels/ResScarti.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class ResScarti + { + #region Public Properties + + public string Causale { get; set; } + public string CodArticolo { get; set; } + public DateTime DataOra { get; set; } + public DateTime? DataOraProdRec { get; set; } + public string Descrizione { get; set; } + public string IdxMacchina { get; set; } + public int IdxOdl { get; set; } + public string KeyRichiesta { get; set; } + public int MatrOpr { get; set; } + public string Note { get; set; } + public int Qta { get; set; } + + #endregion Public Properties + } +} \ No newline at end of file diff --git a/MP.Data/DatabaseModels/Tally.cs b/MP.Data/DatabaseModels/Tally.cs new file mode 100644 index 00000000..e64cf735 --- /dev/null +++ b/MP.Data/DatabaseModels/Tally.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Tally + { + public int N { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/TcStat.cs b/MP.Data/DatabaseModels/TcStat.cs new file mode 100644 index 00000000..eef51348 --- /dev/null +++ b/MP.Data/DatabaseModels/TcStat.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class TcStat + { + public string CodArticolo { get; set; } + public string CodGruppo { get; set; } + public string IdxMacchina { get; set; } + public decimal TcStat1 { get; set; } + public int TcType { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/Tcr.cs b/MP.Data/DatabaseModels/Tcr.cs new file mode 100644 index 00000000..d0ba1c26 --- /dev/null +++ b/MP.Data/DatabaseModels/Tcr.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Tcr + { + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public string CodArticolo { get; set; } + public int PzProd { get; set; } + public decimal? Tcmedio { get; set; } + public decimal? Tcmin { get; set; } + public decimal? Tcmax { get; set; } + public decimal? Tc50p { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/Tcr1.cs b/MP.Data/DatabaseModels/Tcr1.cs new file mode 100644 index 00000000..444d2669 --- /dev/null +++ b/MP.Data/DatabaseModels/Tcr1.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Tcr1 + { + public string IdxMacchina { get; set; } + public string CodArticolo { get; set; } + public DateTime DataOraRif { get; set; } + public decimal Tcmedio { get; set; } + public int PzProd { get; set; } + public int IdxOdl { get; set; } + public decimal Tcassegnato { get; set; } + public string KeyRichiesta { get; set; } + public int PzPallet { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/TcrDay.cs b/MP.Data/DatabaseModels/TcrDay.cs new file mode 100644 index 00000000..20c3fbdf --- /dev/null +++ b/MP.Data/DatabaseModels/TcrDay.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class TcrDay + { + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public string CodArticolo { get; set; } + public int PzProd { get; set; } + public decimal? Tcmedio { get; set; } + public decimal? Tcmin { get; set; } + public decimal? Tcmax { get; set; } + public decimal? Tc50p { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/TcrDayTest.cs b/MP.Data/DatabaseModels/TcrDayTest.cs new file mode 100644 index 00000000..904d7c7f --- /dev/null +++ b/MP.Data/DatabaseModels/TcrDayTest.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class TcrDayTest + { + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public string CodArticolo { get; set; } + public int PzProd { get; set; } + public decimal? Tcmedio { get; set; } + public decimal? Tcmin { get; set; } + public decimal? Tcmax { get; set; } + public decimal? Tc50p { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/TestJason.cs b/MP.Data/DatabaseModels/TestJason.cs new file mode 100644 index 00000000..8f921d40 --- /dev/null +++ b/MP.Data/DatabaseModels/TestJason.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class TestJason + { + public DateTime Data { get; set; } + public byte[] Json { get; set; } + public int? Rows { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/Ul.cs b/MP.Data/DatabaseModels/Ul.cs new file mode 100644 index 00000000..54b11f82 --- /dev/null +++ b/MP.Data/DatabaseModels/Ul.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Ul + { + public int IdxLog { get; set; } + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public int MatrOpr { get; set; } + public string Cognome { get; set; } + public string Nome { get; set; } + public string CodArticolo { get; set; } + public string Azione { get; set; } + public string Valore { get; set; } + public decimal Qta { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/UserActionLog.cs b/MP.Data/DatabaseModels/UserActionLog.cs new file mode 100644 index 00000000..15426401 --- /dev/null +++ b/MP.Data/DatabaseModels/UserActionLog.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class UserActionLog + { + #region Public Properties + + public string Azione { get; set; } + public string CodArticolo { get; set; } + public string Cognome { get; set; } + public DateTime DataOraRif { get; set; } + public int IdxLog { get; set; } + public string IdxMacchina { get; set; } + public int MatrOpr { get; set; } + public string Nome { get; set; } + public decimal Qta { get; set; } + public string Valore { get; set; } + + #endregion Public Properties + } +} \ No newline at end of file diff --git a/MP.Data/DatabaseModels/VDdb.cs b/MP.Data/DatabaseModels/VDdb.cs new file mode 100644 index 00000000..4aeccff6 --- /dev/null +++ b/MP.Data/DatabaseModels/VDdb.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VDdb + { + public string IdxMacchina { get; set; } + public DateTime InizioStato { get; set; } + public DateTime? FineStato { get; set; } + public int IdxStato { get; set; } + public double? DurataMinuti { get; set; } + public string Value { get; set; } + public string CodArticolo { get; set; } + public double? TempoCicloBase { get; set; } + public int? PzPalletProd { get; set; } + public int? MatrOpr { get; set; } + public string Pallet { get; set; } + public string Descrizione { get; set; } + public string ClasseTempo { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VDdbLight.cs b/MP.Data/DatabaseModels/VDdbLight.cs new file mode 100644 index 00000000..f1bafcbc --- /dev/null +++ b/MP.Data/DatabaseModels/VDdbLight.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VDdbLight + { + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public DateTime InizioStato { get; set; } + public string Stato { get; set; } + public double? DurataMinuti { get; set; } + public string CodArticolo { get; set; } + public string Operatore { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VDdbLightOld.cs b/MP.Data/DatabaseModels/VDdbLightOld.cs new file mode 100644 index 00000000..d636177a --- /dev/null +++ b/MP.Data/DatabaseModels/VDdbLightOld.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VDdbLightOld + { + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public DateTime InizioStato { get; set; } + public string Stato { get; set; } + public double? DurataMinuti { get; set; } + public string CodArticolo { get; set; } + public string Operatore { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VDdbTurni.cs b/MP.Data/DatabaseModels/VDdbTurni.cs new file mode 100644 index 00000000..fbdc6046 --- /dev/null +++ b/MP.Data/DatabaseModels/VDdbTurni.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VDdbTurni + { + public string IdxMacchina { get; set; } + public DateTime DataRif { get; set; } + public string Turno { get; set; } + public string CodArticolo { get; set; } + public int IdxStato { get; set; } + public decimal TempoCicloBase { get; set; } + public int PzPalletProd { get; set; } + public decimal? Durata { get; set; } + public int? PzProd { get; set; } + public string ClasseTempo { get; set; } + public string DescClasseTempo { get; set; } + public string Semaforo { get; set; } + public string SemColore { get; set; } + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VEcp.cs b/MP.Data/DatabaseModels/VEcp.cs new file mode 100644 index 00000000..c90a45b6 --- /dev/null +++ b/MP.Data/DatabaseModels/VEcp.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VEcp + { + public DateTime DataOraConf { get; set; } + public string IdxMacchina { get; set; } + public int MatrApp { get; set; } + public DateTime DataFrom { get; set; } + public DateTime DataTo { get; set; } + public int PezziConf { get; set; } + public int PezziScar { get; set; } + public int PezziDaRilav { get; set; } + public string CommessaEsterna { get; set; } + public int TipoConf { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VEcp1.cs b/MP.Data/DatabaseModels/VEcp1.cs new file mode 100644 index 00000000..3c63b654 --- /dev/null +++ b/MP.Data/DatabaseModels/VEcp1.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VEcp1 + { + public int IdxEcp { get; set; } + public DateTime DataOraConf { get; set; } + public string IdxMacchina { get; set; } + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public string KeyRichiesta { get; set; } + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public int PezziConf { get; set; } + public int PezziScar { get; set; } + public int PezziDaRilav { get; set; } + public int MatrOpr { get; set; } + public string Cognome { get; set; } + public string Nome { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VEcpExtended.cs b/MP.Data/DatabaseModels/VEcpExtended.cs new file mode 100644 index 00000000..c2d75bc9 --- /dev/null +++ b/MP.Data/DatabaseModels/VEcpExtended.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VEcpExtended + { + public int IdxEcp { get; set; } + public DateTime DataOraConf { get; set; } + public string IdxMacchina { get; set; } + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public string KeyRichiesta { get; set; } + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public int PezziConf { get; set; } + public int PezziScar { get; set; } + public int PezziDaRilav { get; set; } + public int MatrOpr { get; set; } + public string Cognome { get; set; } + public string Nome { get; set; } + public decimal Tcassegnato { get; set; } + public DateTime DueDate { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VKit.cs b/MP.Data/DatabaseModels/VKit.cs new file mode 100644 index 00000000..f84ce903 --- /dev/null +++ b/MP.Data/DatabaseModels/VKit.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VKit + { + public string KeyKit { get; set; } + public string KeyExtOrd { get; set; } + public string CodArtParent { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VOdl.cs b/MP.Data/DatabaseModels/VOdl.cs new file mode 100644 index 00000000..8600135a --- /dev/null +++ b/MP.Data/DatabaseModels/VOdl.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VOdl + { + 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 DateTime? DataInizio { get; set; } + public DateTime? DataFine { get; set; } + public string Note { get; set; } + public bool NeedAppr { get; set; } + public string UserAppr { get; set; } + public DateTime? DataAppr { get; set; } + public decimal? TcrichAttr { get; set; } + public string KeyRichiesta { get; set; } + public int PzPallet { get; set; } + public bool Provvisorio { get; set; } + public int MatrOpr { get; set; } + public string CommessaAs400 { get; set; } + public int ToAs400 { get; set; } + public DateTime? DueDate { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VOdl1.cs b/MP.Data/DatabaseModels/VOdl1.cs new file mode 100644 index 00000000..97fda075 --- /dev/null +++ b/MP.Data/DatabaseModels/VOdl1.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VOdl1 + { + public int IdxOdl { get; set; } + public string KeyRichiesta { get; set; } + public string CodArticolo { get; set; } + public decimal Tcassegnato { get; set; } + public string IdxMacchina { get; set; } + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public int NumPezzi { get; set; } + public int NumPezziEv { get; set; } + public int NumPezziSca { get; set; } + public int NumPezziRil { get; set; } + public DateTime? DataInizio { get; set; } + public DateTime? DataFine { get; set; } + public string KeyRichiestaParent { get; set; } + public string CodArticoloParent { get; set; } + public DateTime? DueDate { get; set; } + public int? PzPallet { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VPodlNonChiusi.cs b/MP.Data/DatabaseModels/VPodlNonChiusi.cs new file mode 100644 index 00000000..fa806e0d --- /dev/null +++ b/MP.Data/DatabaseModels/VPodlNonChiusi.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VPodlNonChiusi + { + public int IdxPromessa { get; set; } + public string KeyRichiesta { get; set; } + public string KeyBcode { get; set; } + public bool Attivabile { get; set; } + public int IdxOdl { get; set; } + public DateTime? DataInizio { get; set; } + public string CodArticolo { get; set; } + public string DescArticolo { get; set; } + public string CodGruppo { get; set; } + public string IdxMacchina { get; set; } + public string CodMacchina { get; set; } + public string Nome { get; set; } + public int NumPezzi { get; set; } + public decimal Tcassegnato { get; set; } + public DateTime DueDate { get; set; } + public int Priorita { get; set; } + public int PzPallet { get; set; } + public decimal? TotMinProg { get; set; } + public decimal? TotOreProg { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VR1.cs b/MP.Data/DatabaseModels/VR1.cs new file mode 100644 index 00000000..956f8786 --- /dev/null +++ b/MP.Data/DatabaseModels/VR1.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VR1 + { + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public string Causale { get; set; } + public string Descrizione { get; set; } + public string Note { get; set; } + public int Qta { get; set; } + public string KeyRichiesta { get; set; } + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public int MatrOpr { get; set; } + public string Cognome { get; set; } + public string Nome { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VTcStat.cs b/MP.Data/DatabaseModels/VTcStat.cs new file mode 100644 index 00000000..2c048219 --- /dev/null +++ b/MP.Data/DatabaseModels/VTcStat.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VTcStat + { + public string CodArticolo { get; set; } + public string CodGruppo { get; set; } + public string IdxMacchina { get; set; } + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public decimal TcStat { get; set; } + public int TcType { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VTcr.cs b/MP.Data/DatabaseModels/VTcr.cs new file mode 100644 index 00000000..a3adb842 --- /dev/null +++ b/MP.Data/DatabaseModels/VTcr.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VTcr + { + public string IdxMacchina { get; set; } + public string CodArticolo { get; set; } + public DateTime DataOraRif { get; set; } + public decimal Tcmedio { get; set; } + public int PzProd { get; set; } + public int IdxOdl { get; set; } + public decimal Tcassegnato { get; set; } + public string KeyRichiesta { get; set; } + public int PzPallet { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VTcr1.cs b/MP.Data/DatabaseModels/VTcr1.cs new file mode 100644 index 00000000..55061b57 --- /dev/null +++ b/MP.Data/DatabaseModels/VTcr1.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VTcr1 + { + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public string CodArticolo { get; set; } + public int PzProd { get; set; } + public decimal? Tcmedio { get; set; } + public decimal? Tcmin { get; set; } + public decimal? Tcmax { get; set; } + public decimal? Tc50p { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VTcrDay.cs b/MP.Data/DatabaseModels/VTcrDay.cs new file mode 100644 index 00000000..5d591407 --- /dev/null +++ b/MP.Data/DatabaseModels/VTcrDay.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VTcrDay + { + public DateTime? DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public string CodArticolo { get; set; } + public int PzProd { get; set; } + public decimal? Tcmedio { get; set; } + public decimal? Tcmin { get; set; } + public decimal? Tcmax { get; set; } + public decimal? Tc50p { get; set; } + } +} diff --git a/MP.Data/DatabaseModels/VetoTc.cs b/MP.Data/DatabaseModels/VetoTc.cs new file mode 100644 index 00000000..b48ad96b --- /dev/null +++ b/MP.Data/DatabaseModels/VetoTc.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class VetoTc + { + public string IdxMacchina { get; set; } + public string CodArticolo { get; set; } + public bool? VetoTc1 { get; set; } + public decimal SogliaTc { get; set; } + } +} diff --git a/MP.Data/Enums.cs b/MP.Data/Enums.cs new file mode 100644 index 00000000..421dd601 --- /dev/null +++ b/MP.Data/Enums.cs @@ -0,0 +1,8 @@ +using System; + +namespace MP.Data +{ + public class Enums + { + } +} \ No newline at end of file diff --git a/MP.Data/MP.Data.csproj b/MP.Data/MP.Data.csproj new file mode 100644 index 00000000..a8360e39 --- /dev/null +++ b/MP.Data/MP.Data.csproj @@ -0,0 +1,65 @@ + + + + net5.0 + MP.Data + MP.Data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + diff --git a/MP.Data/MoonPro_STATSContext.cs b/MP.Data/MoonPro_STATSContext.cs new file mode 100644 index 00000000..ee404307 --- /dev/null +++ b/MP.Data/MoonPro_STATSContext.cs @@ -0,0 +1,1606 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.Extensions.Configuration; +using MP.Data.DatabaseModels; +using NLog; + +#nullable disable + +namespace MP.Data +{ + public partial class MoonPro_STATSContext : DbContext + { + #region Private Fields + + private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); + + private IConfiguration _configuration; + + #endregion Private Fields + + #region Public Constructors + + public MoonPro_STATSContext(IConfiguration configuration) + { + _configuration = configuration; + } + + public MoonPro_STATSContext(DbContextOptions options) + : base(options) + { + } + + #endregion Public Constructors + +#if false + public virtual DbSet Aauls { get; set; } + public virtual DbSet Cals { get; set; } + public virtual DbSet Configs { get; set; } + public virtual DbSet Ddbs { get; set; } + public virtual DbSet Ddbs1 { get; set; } + public virtual DbSet DdbTurniNews { get; set; } + public virtual DbSet DdbTurnis { get; set; } + public virtual DbSet DdbTurniSummaries { get; set; } + public virtual DbSet DdbTurniSummaryNews { get; set; } + public virtual DbSet Ecps { get; set; } + public virtual DbSet Ecps1 { get; set; } + public virtual DbSet Kits { get; set; } + public virtual DbSet Odls { get; set; } + public virtual DbSet Odls1 { get; set; } + public virtual DbSet Rcs { get; set; } + public virtual DbSet Rs { get; set; } + public virtual DbSet Rs1 { get; set; } + public virtual DbSet Tallies { get; set; } + public virtual DbSet TcrDays { get; set; } + public virtual DbSet TcrDayTests { get; set; } + public virtual DbSet Tcrs { get; set; } + public virtual DbSet Tcrs1 { get; set; } + public virtual DbSet TcStats { get; set; } + public virtual DbSet TestJasons { get; set; } + public virtual DbSet
    Uls { get; set; } +#endif + +#if false + public virtual DbSet VDdbLightOlds { get; set; } + public virtual DbSet VDdbLights { get; set; } + public virtual DbSet VDdbs { get; set; } + public virtual DbSet VDdbTurnis { get; set; } + public virtual DbSet VEcpExtendeds { get; set; } + public virtual DbSet VEcps { get; set; } + public virtual DbSet VEcps1 { get; set; } + public virtual DbSet VetoTcs { get; set; } + public virtual DbSet VKits { get; set; } + public virtual DbSet VOdls { get; set; } + public virtual DbSet VOdls1 { get; set; } + public virtual DbSet VPodlNonChiusis { get; set; } +#endif + + #region Public Properties + + public virtual DbSet DbSetControlli { get; set; } + public virtual DbSet DbSetScarti { get; set; } +#if false + public virtual DbSet VRs1 { get; set; } + public virtual DbSet VTcrDays { get; set; } + public virtual DbSet VTcrs { get; set; } + public virtual DbSet VTcrs1 { get; set; } + public virtual DbSet VTcStats { get; set; } +#endif + public virtual DbSet DbSetUserLog { get; set; } + + #endregion Public Properties + + #region Private Methods + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); + + #endregion Private Methods + + #region Protected Methods + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + if (!optionsBuilder.IsConfigured) + { + string connString = _configuration.GetConnectionString("Mp.Stats"); + + optionsBuilder.UseSqlServer(_configuration.GetConnectionString("Mp.Stats")); + +#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263. + //optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;"); + } + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS"); + +#if false + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Azione); + + entity.ToTable("AAUL"); + + entity.Property(e => e.Azione) + .HasMaxLength(50) + .HasDefaultValueSql("('ND')") + .HasComment("Azione dell'operatore"); + + entity.Property(e => e.Descrizione) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Giorno) + .HasName("PK_Calendario"); + + entity.ToTable("CAL"); + + entity.Property(e => e.Giorno) + .HasColumnType("datetime") + .HasColumnName("giorno"); + + entity.Property(e => e.DoDdb) + .IsRequired() + .HasColumnName("doDDB") + .HasDefaultValueSql("((1))") + .HasComment("Indica che è necessario ricalcolare statistiche derivate da DDB (DiarioDiBordo)"); + + entity.Property(e => e.DoEcp) + .IsRequired() + .HasColumnName("doECP") + .HasDefaultValueSql("((1))") + .HasComment("Indica che è necessario ricalcolare statistiche derivate da DPO (DatiProduzione Operatore) - conferme manuali operatore"); + + entity.Property(e => e.DoOdl) + .IsRequired() + .HasColumnName("doODL") + .HasDefaultValueSql("((1))") + .HasComment("Indica che è necessario ricalcolare statistiche ODL"); + + entity.Property(e => e.DoRs) + .IsRequired() + .HasColumnName("doRS") + .HasDefaultValueSql("((1))") + .HasComment("Indica che è necessario ricalcolare statistiche derivate da RS (Registro Scarti)"); + + entity.Property(e => e.DoTcr) + .IsRequired() + .HasColumnName("doTCR") + .HasDefaultValueSql("((1))") + .HasComment("Indica che è necessario ricalcolare statistiche derivate da rilevazione TCR (TempiCicloRilevati)"); + + entity.Property(e => e.DoUl) + .IsRequired() + .HasColumnName("doUL") + .HasDefaultValueSql("((1))") + .HasComment("Indica che è necessario ricalcolare statistiche derivate da DSO (Dichiarazioni Scarti Operatore)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Chiave); + + entity.ToTable("Config"); + + entity.Property(e => e.Chiave) + .HasMaxLength(50) + .HasColumnName("chiave"); + + entity.Property(e => e.Note).HasColumnName("note"); + + entity.Property(e => e.Valore).HasColumnName("valore"); + + entity.Property(e => e.ValoreStd) + .HasColumnName("valoreStd") + .HasComment("Valore di default/riferimento per la variabile"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DataOraRif, e.IdxMacchina, e.IdxStato }) + .HasName("PK_DDB_1"); + + entity.ToTable("DDB"); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.DurataMinuti).HasColumnType("decimal(18, 8)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("DDB", "raw"); + + entity.HasIndex(e => e.InizioStato, "ci_DDB_Data") + .IsClustered(); + + entity.HasIndex(e => e.CodArticolo, "i_DDB_CodArt"); + + entity.HasIndex(e => e.IdxMacchina, "i_DDB_IdxMacc"); + + entity.HasIndex(e => e.IdxStato, "i_DDB_IdxStato"); + + entity.HasIndex(e => e.MatrOpr, "i_DDB_MatrOpr"); + + entity.Property(e => e.ClasseTempo).HasMaxLength(50); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.Descrizione).HasMaxLength(50); + + entity.Property(e => e.FineStato).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.InizioStato).HasColumnType("datetime"); + + entity.Property(e => e.Pallet) + .HasMaxLength(20) + .HasColumnName("pallet"); + + entity.Property(e => e.Value).HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DataRif, e.IdxMacchina, e.Turno, e.IdxStato, e.CodArticolo, e.InizioPeriodo }); + + entity.ToTable("DDB_Turni"); + + entity.Property(e => e.DataRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.Turno).HasMaxLength(5); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.InizioPeriodo).HasColumnType("datetime"); + + entity.Property(e => e.ClasseTempo).HasMaxLength(50); + + entity.Property(e => e.DataTurnoFine).HasColumnType("datetime"); + + entity.Property(e => e.DataTurnoInizio).HasColumnType("datetime"); + + entity.Property(e => e.Descrizione).HasMaxLength(50); + + entity.Property(e => e.FinePeriodo).HasColumnType("datetime"); + + entity.Property(e => e.FineStato).HasColumnType("datetime"); + + entity.Property(e => e.InizioStato).HasColumnType("datetime"); + + entity.Property(e => e.Pallet) + .HasMaxLength(20) + .HasColumnName("pallet"); + + entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DataRif, e.IdxMacchina, e.Turno, e.IdxStato, e.CodArticolo, e.InizioPeriodo }); + + entity.ToTable("DDB_TurniNew"); + + entity.Property(e => e.DataRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.Turno).HasMaxLength(5); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.InizioPeriodo).HasColumnType("datetime"); + + entity.Property(e => e.ClasseTempo).HasMaxLength(50); + + entity.Property(e => e.DataTurnoFine).HasColumnType("datetime"); + + entity.Property(e => e.DataTurnoInizio).HasColumnType("datetime"); + + entity.Property(e => e.Descrizione).HasMaxLength(50); + + entity.Property(e => e.FinePeriodo).HasColumnType("datetime"); + + entity.Property(e => e.FineStato).HasColumnType("datetime"); + + entity.Property(e => e.InizioStato).HasColumnType("datetime"); + + entity.Property(e => e.Pallet) + .HasMaxLength(20) + .HasColumnName("pallet"); + + entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.IdxMacchina, e.DataRif, e.Turno, e.CodArticolo, e.IdxStato, e.TempoCicloBase, e.PzPalletProd }); + + entity.ToTable("DDB_TurniSummary"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.DataRif).HasColumnType("datetime"); + + entity.Property(e => e.Turno).HasMaxLength(5); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)"); + + entity.Property(e => e.Durata).HasColumnType("numeric(27, 7)"); + + entity.Property(e => e.Inizio).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.IdxMacchina, e.DataRif, e.Turno, e.CodArticolo, e.IdxStato, e.TempoCicloBase, e.PzPalletProd }); + + entity.ToTable("DDB_TurniSummaryNew"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.DataRif).HasColumnType("datetime"); + + entity.Property(e => e.Turno).HasMaxLength(5); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)"); + + entity.Property(e => e.Durata).HasColumnType("numeric(27, 7)"); + + entity.Property(e => e.Inizio).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IdxEcp); + + entity.ToTable("ECP"); + + entity.Property(e => e.IdxEcp).HasColumnName("idxECP"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Cognome) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + + entity.Property(e => e.DataOraConf).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("idxMacchina"); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + + entity.Property(e => e.PezziConf).HasColumnName("pezziConf"); + + entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav"); + + entity.Property(e => e.PezziScar).HasColumnName("pezziScar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ECP", "raw"); + + entity.HasIndex(e => e.DataOraConf, "ci_ECP_Data") + .IsClustered(); + + entity.HasIndex(e => e.IdxMacchina, "i_ECP_IdxMacc"); + + entity.HasIndex(e => e.MatrApp, "i_ECP_MatrApp"); + + entity.HasIndex(e => e.IdxMacchina, "i_ODL_IdxMacc"); + + entity.Property(e => e.CommessaEsterna) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataFrom) + .HasColumnType("datetime") + .HasColumnName("dataFrom"); + + entity.Property(e => e.DataOraConf).HasColumnType("datetime"); + + entity.Property(e => e.DataTo) + .HasColumnType("datetime") + .HasColumnName("dataTo"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("idxMacchina"); + + entity.Property(e => e.PezziConf).HasColumnName("pezziConf"); + + entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav"); + + entity.Property(e => e.PezziScar).HasColumnName("pezziScar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.KeyKit); + + entity.ToTable("KIT", "raw"); + + entity.Property(e => e.KeyKit).HasMaxLength(50); + + entity.Property(e => e.CodArtParent).IsRequired(); + + entity.Property(e => e.KeyExtOrd).IsRequired(); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IdxOdl) + .HasName("PK_ODL_1"); + + entity.ToTable("ODL"); + + entity.Property(e => e.IdxOdl) + .ValueGeneratedNever() + .HasColumnName("IdxODL"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodArticoloParent) + .IsRequired() + .HasDefaultValueSql("('')"); + + entity.Property(e => e.DataFine).HasColumnType("datetime"); + + entity.Property(e => e.DataInizio).HasColumnType("datetime"); + + entity.Property(e => e.DueDate).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50) + .HasComment("Chiave: ordine esterno o KIT"); + + entity.Property(e => e.KeyRichiestaParent) + .IsRequired() + .HasDefaultValueSql("('')") + .HasComment("Chiave: ordine esterno o KIT"); + + entity.Property(e => e.PzPallet).HasDefaultValueSql("((1))"); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IdxOdl) + .IsClustered(false); + + entity.ToTable("ODL", "raw"); + + entity.HasIndex(e => e.IdxOdl, "ci_ODL_Data") + .IsClustered(); + + entity.HasIndex(e => e.IdxMacchina, "i_ODL_IdxMacc"); + + entity.HasIndex(e => e.KeyRichiesta, "i_ODL_KeyRic"); + + entity.Property(e => e.IdxOdl) + .ValueGeneratedNever() + .HasColumnName("IdxODL"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CommessaAs400) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataAppr).HasColumnType("datetime"); + + entity.Property(e => e.DataFine).HasColumnType("datetime"); + + entity.Property(e => e.DataInizio).HasColumnType("datetime"); + + entity.Property(e => e.DueDate).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Note).HasMaxLength(2500); + + entity.Property(e => e.Provvisorio).HasColumnName("provvisorio"); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + + entity.Property(e => e.TcrichAttr) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCRichAttr"); + + entity.Property(e => e.UserAppr).HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DataOraRif, e.IdxMacchina, e.Causale, e.IdxOdl }); + + entity.ToTable("RS"); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.Causale).HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Cognome) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + + entity.Property(e => e.Descrizione) + .IsRequired() + .HasMaxLength(250); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + + entity.Property(e => e.Note) + .IsRequired() + .HasMaxLength(250); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("RS", "raw"); + + entity.HasIndex(e => e.DataOra, "ci_RS_Data") + .IsClustered(); + + entity.HasIndex(e => e.Causale, "i_RS_Causale"); + + entity.HasIndex(e => e.CodArticolo, "i_RS_CodArt"); + + entity.HasIndex(e => e.IdxMacchina, "i_RS_IdxMacc"); + + entity.HasIndex(e => e.MatrOpr, "i_RS_MatrOpr"); + + entity.Property(e => e.Causale) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOra).HasColumnType("datetime"); + + entity.Property(e => e.DataOraProdRec).HasColumnType("datetime"); + + entity.Property(e => e.Descrizione) + .IsRequired() + .HasMaxLength(250); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Note) + .IsRequired() + .HasMaxLength(250); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IdxControllo) + .IsClustered(false); + + entity.ToTable("RC", "raw"); + + entity.HasIndex(e => e.DataOra, "ci_RC_Data") + .IsClustered(); + + entity.HasIndex(e => e.CodArticolo, "i_RC_CodArt"); + + entity.HasIndex(e => e.EsitoOk, "i_RC_EsitoOk"); + + entity.HasIndex(e => e.IdxMacchina, "i_RC_IdxMacc"); + + entity.HasIndex(e => e.MatrOpr, "i_RC_MatrOpr"); + + entity.Property(e => e.IdxControllo).ValueGeneratedNever(); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOra).HasColumnType("datetime"); + + entity.Property(e => e.EsitoOk).HasColumnName("EsitoOK"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.Note) + .IsRequired() + .HasMaxLength(250); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.N) + .HasName("PK_Tally_N"); + + entity.ToTable("Tally"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.CodArticolo, e.CodGruppo, e.IdxMacchina }); + + entity.ToTable("TC_Stat"); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.CodGruppo).HasMaxLength(50); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.TcStat1) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TC_Stat"); + + entity.Property(e => e.TcType).HasColumnName("TC_Type"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.IdxMacchina, e.CodArticolo, e.DataOraRif }) + .IsClustered(false); + + entity.ToTable("TCR"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.Tc50p) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TC50p") + .HasComment("Valore percentile 50"); + + entity.Property(e => e.Tcmax) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMax") + .HasComment("Valore MASSIMO"); + + entity.Property(e => e.Tcmedio) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMedio") + .HasComment("Valore di MEDIA arimetica"); + + entity.Property(e => e.Tcmin) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMin") + .HasComment("Valore minimo"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("TCR", "raw"); + + entity.HasIndex(e => e.DataOraRif, "ci_TCR_Data") + .IsClustered(); + + entity.HasIndex(e => e.CodArticolo, "i_TCR_CodArt"); + + entity.HasIndex(e => e.IdxMacchina, "i_TCR_IdxMacc"); + + entity.HasIndex(e => e.KeyRichiesta, "i_TCR_KeyRich"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + + entity.Property(e => e.Tcmedio) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMedio"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.IdxMacchina, e.CodArticolo, e.DataOraRif }) + .HasName("PK_TCRDay") + .IsClustered(false); + + entity.ToTable("TCR_Day"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("date"); + + entity.Property(e => e.Tc50p) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TC50p") + .HasComment("Valore percentile 50"); + + entity.Property(e => e.Tcmax) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMax") + .HasComment("Valore MASSIMO"); + + entity.Property(e => e.Tcmedio) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMedio") + .HasComment("Valore di MEDIA arimetica"); + + entity.Property(e => e.Tcmin) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMin") + .HasComment("Valore minimo"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("TCR_DayTest"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("date"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Tc50p) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TC50p"); + + entity.Property(e => e.Tcmax) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMax"); + + entity.Property(e => e.Tcmedio) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMedio"); + + entity.Property(e => e.Tcmin) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMin"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("TestJason"); + + entity.Property(e => e.Data).HasColumnType("date"); + }); + + modelBuilder.Entity
      (entity => + { + entity.HasKey(e => e.IdxLog) + .HasName("PK_UserLog"); + + entity.ToTable("UL"); + + entity.HasIndex(e => e.DataOraRif, "i_UL_DataOra"); + + entity.Property(e => e.Azione) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('ND')") + .HasComment("Azione dell'operatore"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Cognome) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + + entity.Property(e => e.Qta).HasColumnType("decimal(18, 8)"); + + entity.Property(e => e.Valore) + .IsRequired() + .HasMaxLength(250) + .HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vDDB"); + + entity.Property(e => e.ClasseTempo).HasMaxLength(50); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.Descrizione).HasMaxLength(50); + + entity.Property(e => e.FineStato).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.InizioStato).HasColumnType("datetime"); + + entity.Property(e => e.Pallet) + .HasMaxLength(20) + .HasColumnName("pallet"); + + entity.Property(e => e.Value).HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_DDB_Light", "export"); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.InizioStato).HasColumnType("datetime"); + + entity.Property(e => e.Operatore) + .IsRequired() + .HasMaxLength(101); + + entity.Property(e => e.Stato).HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vDDB_Light_OLD"); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.InizioStato).HasColumnType("datetime"); + + entity.Property(e => e.Operatore) + .IsRequired() + .HasMaxLength(101); + + entity.Property(e => e.Stato).HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_DDB_Turni", "export"); + + entity.Property(e => e.ClasseTempo).HasMaxLength(50); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.DataRif).HasColumnType("datetime"); + + entity.Property(e => e.DescClasseTempo).HasMaxLength(50); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.Durata).HasColumnType("numeric(38, 7)"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.SemColore) + .IsRequired() + .HasMaxLength(6) + .IsUnicode(false); + + entity.Property(e => e.Semaforo).HasMaxLength(50); + + entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)"); + + entity.Property(e => e.Turno) + .IsRequired() + .HasMaxLength(5); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vECP"); + + entity.Property(e => e.CommessaEsterna) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataFrom) + .HasColumnType("datetime") + .HasColumnName("dataFrom"); + + entity.Property(e => e.DataOraConf).HasColumnType("datetime"); + + entity.Property(e => e.DataTo) + .HasColumnType("datetime") + .HasColumnName("dataTo"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("idxMacchina"); + + entity.Property(e => e.PezziConf).HasColumnName("pezziConf"); + + entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav"); + + entity.Property(e => e.PezziScar).HasColumnName("pezziScar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_ECP", "export"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.Cognome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOraConf).HasColumnType("datetime"); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.IdxEcp).HasColumnName("idxECP"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("idxMacchina"); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.PezziConf).HasColumnName("pezziConf"); + + entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav"); + + entity.Property(e => e.PezziScar).HasColumnName("pezziScar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_ECP_Extended", "export"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.Cognome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOraConf).HasColumnType("datetime"); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.DueDate).HasColumnType("datetime"); + + entity.Property(e => e.IdxEcp).HasColumnName("idxECP"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("idxMacchina"); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.PezziConf).HasColumnName("pezziConf"); + + entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav"); + + entity.Property(e => e.PezziScar).HasColumnName("pezziScar"); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vKIT"); + + entity.Property(e => e.KeyKit) + .IsRequired() + .HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vODL"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CommessaAs400) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataAppr).HasColumnType("datetime"); + + entity.Property(e => e.DataFine).HasColumnType("datetime"); + + entity.Property(e => e.DataInizio).HasColumnType("datetime"); + + entity.Property(e => e.DueDate).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Note).HasMaxLength(2500); + + entity.Property(e => e.Provvisorio).HasColumnName("provvisorio"); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + + entity.Property(e => e.TcrichAttr) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCRichAttr"); + + entity.Property(e => e.UserAppr).HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_ODL", "export"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodArticoloParent).IsRequired(); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.DataFine).HasColumnType("datetime"); + + entity.Property(e => e.DataInizio).HasColumnType("datetime"); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.DueDate).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.KeyRichiestaParent).IsRequired(); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_PODL_NonChiusi", "export"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodGruppo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataInizio).HasColumnType("datetime"); + + entity.Property(e => e.DescArticolo).HasMaxLength(301); + + entity.Property(e => e.DueDate).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.IdxPromessa).HasColumnName("idxPromessa"); + + entity.Property(e => e.KeyBcode) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("KeyBCode"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome).HasMaxLength(50); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + + entity.Property(e => e.TotMinProg).HasColumnType("decimal(29, 8)"); + + entity.Property(e => e.TotOreProg).HasColumnType("decimal(32, 11)"); + }); +#endif + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vRS"); + + entity.Property(e => e.Causale) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOra).HasColumnType("datetime"); + + entity.Property(e => e.DataOraProdRec).HasColumnType("datetime"); + + entity.Property(e => e.Descrizione) + .IsRequired() + .HasMaxLength(250); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Note) + .IsRequired() + .HasMaxLength(250); + }); +#if false + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_RS", "export"); + + entity.Property(e => e.Causale) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Cognome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.Descrizione) + .IsRequired() + .HasMaxLength(250); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Note) + .IsRequired() + .HasMaxLength(250); + }); +#endif + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vRC"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOra).HasColumnType("datetime"); + + entity.Property(e => e.EsitoOk).HasColumnName("EsitoOK"); + + entity.Property(e => e.IdxControllo).ValueGeneratedOnAdd(); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.Note) + .IsRequired() + .HasMaxLength(250); + }); + +#if false + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_TC_Stat", "export"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodGruppo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.TcStat) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TC_Stat"); + + entity.Property(e => e.TcType).HasColumnName("TC_Type"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vTCR"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + + entity.Property(e => e.Tcmedio) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMedio"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_TCR", "export"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Tc50p) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TC50p"); + + entity.Property(e => e.Tcmax) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMax"); + + entity.Property(e => e.Tcmedio) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMedio"); + + entity.Property(e => e.Tcmin) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMin"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_TCR_Day", "export"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Tc50p) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TC50p"); + + entity.Property(e => e.Tcmax) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMax"); + + entity.Property(e => e.Tcmedio) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMedio"); + + entity.Property(e => e.Tcmin) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMin"); + }); +#endif + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_UL", "export"); + + entity.Property(e => e.Azione) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Cognome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxLog).ValueGeneratedOnAdd(); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Qta).HasColumnType("decimal(18, 8)"); + + entity.Property(e => e.Valore) + .IsRequired() + .HasMaxLength(250); + }); +#if false + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.IdxMacchina, e.CodArticolo }); + + entity.ToTable("VetoTC"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.SogliaTc) + .HasColumnType("decimal(18, 8)") + .HasColumnName("SogliaTC"); + + entity.Property(e => e.VetoTc1) + .IsRequired() + .HasColumnName("VetoTC") + .HasDefaultValueSql("((1))"); + }); +#endif + + OnModelCreatingPartial(modelBuilder); + } + + #endregion Protected Methods + } +} \ No newline at end of file diff --git a/MP.Data/Resources/Readme.md b/MP.Data/Resources/Readme.md new file mode 100644 index 00000000..29cc121b --- /dev/null +++ b/MP.Data/Resources/Readme.md @@ -0,0 +1,23 @@ +# Appunti gestione MP-STAT DB + + +Per la gestione dell'accesso al DB statistiche si opera con EFCore --> apop blazor server + +## Scaffolding DB iniziale + + Scaffold-DbContext "Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir DatabaseModels + +## Scaffolding SOLO di tabelle/viste selezionate (con force update) + + Scaffold-DbContext "Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir DatabaseModels -Tables v_RS, v_TC_Stat, v_TCR, v_TCR_Day, v_UL + + + +## Approfondimenti + +Qualche link di approfondimento: + + - https://docs.microsoft.com/en-us/ef/core/ + - https://docs.microsoft.com/en-us/ef/core/extensions/ + - https://www.entityframeworktutorial.net/efcore/create-model-for-existing-database-in-ef-core.aspx + - https://entityframework.net/ef-code-first \ No newline at end of file diff --git a/MP.Data/StatsDbContext.cs b/MP.Data/StatsDbContext.cs new file mode 100644 index 00000000..e52f398f --- /dev/null +++ b/MP.Data/StatsDbContext.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MP.Data +{ + public class StatsDbContext + { + } +} \ No newline at end of file