From f04d739e7b432bb3ccc0e3b98601096d41bbeaf0 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 18 Sep 2021 10:55:24 +0200 Subject: [PATCH] Prima vers land da completare --- MP-LAND.sln | 6 - MP.AppAuth/Controllers/AppAuthController.cs | 70 + MP.AppAuth/DatabaseModels/AnagraficaEventi.cs | 26 - .../DatabaseModels/FamigliaTipoIngressi.cs | 22 - MP.AppAuth/DatabaseModels/FamiglieMacchine.cs | 24 - MP.AppAuth/DatabaseModels/Lingue.cs | 20 - MP.AppAuth/DatabaseModels/Macchine.cs | 52 - MP.AppAuth/MP.AppAuth.csproj | 1 - MP.AppAuth/ModelBuilderExtensions.cs | 28 + .../AnagArticoli.cs | 20 +- .../AnagClassiTempo.cs | 8 +- .../AnagKeyValue.cs | 16 +- .../AnagraficaCausaliScarto.cs | 13 +- .../AnagraficaFlussi.cs | 8 +- .../AnagraficaGruppi.cs | 21 +- .../AnagraficaIngressi.cs | 10 +- .../AnagraficaMicroStati.cs | 10 +- .../AnagraficaOperatori.cs | 27 +- .../{DatabaseModels => Models}/Config.cs | 10 +- .../DatiMacchine.cs | 26 +- MP.AppAuth/Models/FamigliaTipoIngressi.cs | 17 + MP.AppAuth/Models/FamiglieMacchine.cs | 19 + .../Gruppi2Macchine.cs | 11 +- .../Gruppi2Operatori.cs | 11 +- .../{DatabaseModels => Models}/KeepAlive.cs | 12 +- .../{DatabaseModels => Models}/LinkMenuJqm.cs | 14 +- .../{DatabaseModels => Models}/ListValue.cs | 12 +- MP.AppAuth/Models/Macchine.cs | 35 + .../{DatabaseModels => Models}/UpdMan.cs | 18 +- MP.AppAuth/MoonProContext.cs | 2945 +---------------- MP.Land/Data/AppAuthService.cs | 101 + MP.Land/MP.Land.csproj | 66 +- MP.Land/Resources/ChangeLog.html | 2 +- MP.Land/Resources/VersNum.txt | 2 +- MP.Land/Resources/manifest.xml | 2 +- MP.Land/Startup.cs | 6 +- 36 files changed, 464 insertions(+), 3227 deletions(-) create mode 100644 MP.AppAuth/Controllers/AppAuthController.cs delete mode 100644 MP.AppAuth/DatabaseModels/AnagraficaEventi.cs delete mode 100644 MP.AppAuth/DatabaseModels/FamigliaTipoIngressi.cs delete mode 100644 MP.AppAuth/DatabaseModels/FamiglieMacchine.cs delete mode 100644 MP.AppAuth/DatabaseModels/Lingue.cs delete mode 100644 MP.AppAuth/DatabaseModels/Macchine.cs create mode 100644 MP.AppAuth/ModelBuilderExtensions.cs rename MP.AppAuth/{DatabaseModels => Models}/AnagArticoli.cs (54%) rename MP.AppAuth/{DatabaseModels => Models}/AnagClassiTempo.cs (68%) rename MP.AppAuth/{DatabaseModels => Models}/AnagKeyValue.cs (77%) rename MP.AppAuth/{DatabaseModels => Models}/AnagraficaCausaliScarto.cs (58%) rename MP.AppAuth/{DatabaseModels => Models}/AnagraficaFlussi.cs (68%) rename MP.AppAuth/{DatabaseModels => Models}/AnagraficaGruppi.cs (78%) rename MP.AppAuth/{DatabaseModels => Models}/AnagraficaIngressi.cs (73%) rename MP.AppAuth/{DatabaseModels => Models}/AnagraficaMicroStati.cs (73%) rename MP.AppAuth/{DatabaseModels => Models}/AnagraficaOperatori.cs (58%) rename MP.AppAuth/{DatabaseModels => Models}/Config.cs (73%) rename MP.AppAuth/{DatabaseModels => Models}/DatiMacchine.cs (87%) create mode 100644 MP.AppAuth/Models/FamigliaTipoIngressi.cs create mode 100644 MP.AppAuth/Models/FamiglieMacchine.cs rename MP.AppAuth/{DatabaseModels => Models}/Gruppi2Macchine.cs (78%) rename MP.AppAuth/{DatabaseModels => Models}/Gruppi2Operatori.cs (78%) rename MP.AppAuth/{DatabaseModels => Models}/KeepAlive.cs (76%) rename MP.AppAuth/{DatabaseModels => Models}/LinkMenuJqm.cs (78%) rename MP.AppAuth/{DatabaseModels => Models}/ListValue.cs (76%) create mode 100644 MP.AppAuth/Models/Macchine.cs rename MP.AppAuth/{DatabaseModels => Models}/UpdMan.cs (80%) create mode 100644 MP.Land/Data/AppAuthService.cs diff --git a/MP-LAND.sln b/MP-LAND.sln index 577743d6..bba25374 100644 --- a/MP-LAND.sln +++ b/MP-LAND.sln @@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.31229.75 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.FileData", "MP.FileData\MP.FileData.csproj", "{48693321-1FA6-4DBB-A730-B8EF3E0B68D2}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Land", "MP.Land\MP.Land.csproj", "{D949AB45-9B65-4594-A97E-182BC3831707}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MP.AppAuth", "MP.AppAuth\MP.AppAuth.csproj", "{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}" @@ -15,10 +13,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {48693321-1FA6-4DBB-A730-B8EF3E0B68D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {48693321-1FA6-4DBB-A730-B8EF3E0B68D2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {48693321-1FA6-4DBB-A730-B8EF3E0B68D2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {48693321-1FA6-4DBB-A730-B8EF3E0B68D2}.Release|Any CPU.Build.0 = Release|Any CPU {D949AB45-9B65-4594-A97E-182BC3831707}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D949AB45-9B65-4594-A97E-182BC3831707}.Debug|Any CPU.Build.0 = Debug|Any CPU {D949AB45-9B65-4594-A97E-182BC3831707}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/MP.AppAuth/Controllers/AppAuthController.cs b/MP.AppAuth/Controllers/AppAuthController.cs new file mode 100644 index 00000000..0349ed07 --- /dev/null +++ b/MP.AppAuth/Controllers/AppAuthController.cs @@ -0,0 +1,70 @@ +using Microsoft.Extensions.Configuration; +using NLog; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MP.AppAuth.Controllers +{ + public class AppAuthController : IDisposable + { + #region Private Fields + + private static IConfiguration _configuration; + private static AppAuthContext dbCtx; + private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); + + #endregion Private Fields + + #region Public Constructors + + public AppAuthController(IConfiguration configuration) + { + _configuration = configuration; + dbCtx = new AppAuthContext(configuration); + Log.Info("Avviata classe AppAuthController"); + } + + #endregion Public Constructors + + #region Public Methods + + public void Dispose() + { + // Clear database context + dbCtx.Dispose(); + } + + public void ResetController() + { + dbCtx = new AppAuthContext(_configuration); + Log.Info("Effettuato reset AppAuthController"); + } + + /// + /// 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; + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/AnagraficaEventi.cs b/MP.AppAuth/DatabaseModels/AnagraficaEventi.cs deleted file mode 100644 index e3c3207d..00000000 --- a/MP.AppAuth/DatabaseModels/AnagraficaEventi.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; - -#nullable disable - -namespace MP.AppAuth -{ - public partial class AnagraficaEventi - { - public AnagraficaEventi() - { - EventLists = new HashSet(); - TransizioneIngressis = new HashSet(); - TransizioneStatis = new HashSet(); - } - - public int IdxTipo { get; set; } - public string Nome { get; set; } - public string TabAzione { get; set; } - public string Azione { get; set; } - - public virtual ICollection EventLists { get; set; } - public virtual ICollection TransizioneIngressis { get; set; } - public virtual ICollection TransizioneStatis { get; set; } - } -} diff --git a/MP.AppAuth/DatabaseModels/FamigliaTipoIngressi.cs b/MP.AppAuth/DatabaseModels/FamigliaTipoIngressi.cs deleted file mode 100644 index c0d6afd4..00000000 --- a/MP.AppAuth/DatabaseModels/FamigliaTipoIngressi.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; - -#nullable disable - -namespace MP.AppAuth -{ - public partial class FamigliaTipoIngressi - { - public FamigliaTipoIngressi() - { - Macchine2FamigliaIngressis = new HashSet(); - TransizioneIngressis = new HashSet(); - } - - public int IdxFamigliaIngresso { get; set; } - public string DescrizioneIngresso { get; set; } - - public virtual ICollection Macchine2FamigliaIngressis { get; set; } - public virtual ICollection TransizioneIngressis { get; set; } - } -} diff --git a/MP.AppAuth/DatabaseModels/FamiglieMacchine.cs b/MP.AppAuth/DatabaseModels/FamiglieMacchine.cs deleted file mode 100644 index 28613907..00000000 --- a/MP.AppAuth/DatabaseModels/FamiglieMacchine.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; - -#nullable disable - -namespace MP.AppAuth -{ - public partial class FamiglieMacchine - { - public FamiglieMacchine() - { - Macchine2FamiglieMacchines = new HashSet(); - TransizioneStatis = new HashSet(); - } - - public int IdxFamiglia { get; set; } - public string Descrizione { get; set; } - public bool? HasIob { get; set; } - public bool? HasUdi { get; set; } - - public virtual ICollection Macchine2FamiglieMacchines { get; set; } - public virtual ICollection TransizioneStatis { get; set; } - } -} diff --git a/MP.AppAuth/DatabaseModels/Lingue.cs b/MP.AppAuth/DatabaseModels/Lingue.cs deleted file mode 100644 index 56e8a54b..00000000 --- a/MP.AppAuth/DatabaseModels/Lingue.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; - -#nullable disable - -namespace MP.AppAuth -{ - public partial class Lingue - { - public Lingue() - { - Vocabolarios = new HashSet(); - } - - public string Lingua { get; set; } - public string DescrizioneLingua { get; set; } - - public virtual ICollection Vocabolarios { get; set; } - } -} diff --git a/MP.AppAuth/DatabaseModels/Macchine.cs b/MP.AppAuth/DatabaseModels/Macchine.cs deleted file mode 100644 index 46ba09f0..00000000 --- a/MP.AppAuth/DatabaseModels/Macchine.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Collections.Generic; - -#nullable disable - -namespace MP.AppAuth -{ - public partial class Macchine - { - public Macchine() - { - DiarioDiBordos = new HashSet(); - EventLists = new HashSet(); - Gruppi2Macchines = new HashSet(); - Macchine2FamigliaIngressis = new HashSet(); - Macchine2SlaveIdxMacchinaNavigations = new HashSet(); - Macchine2SlaveIdxMacchinaSlaveNavigations = new HashSet(); - Mappas = new HashSet(); - Odls = new HashSet(); - PostazioniMapos = new HashSet(); - PromesseOdls = new HashSet(); - TempiCicloRilevatis = new HashSet(); - TempiCicloTeoricis = new HashSet(); - } - - public string IdxMacchina { get; set; } - public string CodMacchina { get; set; } - public string Nome { get; set; } - public string Descrizione { get; set; } - public string Note { get; set; } - public string Url { get; set; } - public string Locazione { get; set; } - public string Css { get; set; } - public int RowNum { get; set; } - public int ColNum { get; set; } - - public virtual Macchine2FamiglieMacchine Macchine2FamiglieMacchine { get; set; } - public virtual StatoMacchine StatoMacchine { get; set; } - public virtual ICollection DiarioDiBordos { get; set; } - public virtual ICollection EventLists { get; set; } - public virtual ICollection Gruppi2Macchines { get; set; } - public virtual ICollection Macchine2FamigliaIngressis { get; set; } - public virtual ICollection Macchine2SlaveIdxMacchinaNavigations { get; set; } - public virtual ICollection Macchine2SlaveIdxMacchinaSlaveNavigations { get; set; } - public virtual ICollection Mappas { get; set; } - public virtual ICollection Odls { get; set; } - public virtual ICollection PostazioniMapos { get; set; } - public virtual ICollection PromesseOdls { get; set; } - public virtual ICollection TempiCicloRilevatis { get; set; } - public virtual ICollection TempiCicloTeoricis { get; set; } - } -} diff --git a/MP.AppAuth/MP.AppAuth.csproj b/MP.AppAuth/MP.AppAuth.csproj index 1a01bb4f..807df801 100644 --- a/MP.AppAuth/MP.AppAuth.csproj +++ b/MP.AppAuth/MP.AppAuth.csproj @@ -5,7 +5,6 @@ - diff --git a/MP.AppAuth/ModelBuilderExtensions.cs b/MP.AppAuth/ModelBuilderExtensions.cs new file mode 100644 index 00000000..78f56cb6 --- /dev/null +++ b/MP.AppAuth/ModelBuilderExtensions.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MP.AppAuth +{ + public static class ModelBuilderExtensions + { + #region Public Methods + + /// + /// Estensione per seed iniziale dei dati nel DB + /// + /// + public static void Seed(this ModelBuilder modelBuilder) + { + //// inizializzazione dei valori di default x MACCHINA + //modelBuilder.Entity().HasData( + // new MacchinaModel { IdxMacchina = "0", RuleName = "0", Descrizione = "--- Tutte ---", Nome = "--- Tutte ---", BasePath = "", ImgUrl = "", Note = "", ShowOrder = 0 } + // ); + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/AnagArticoli.cs b/MP.AppAuth/Models/AnagArticoli.cs similarity index 54% rename from MP.AppAuth/DatabaseModels/AnagArticoli.cs rename to MP.AppAuth/Models/AnagArticoli.cs index caeb90c2..c368ae68 100644 --- a/MP.AppAuth/DatabaseModels/AnagArticoli.cs +++ b/MP.AppAuth/Models/AnagArticoli.cs @@ -3,26 +3,20 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class AnagArticoli { - public AnagArticoli() - { - DiarioDiBordos = new HashSet(); - Odls = new HashSet(); - } + #region Public Properties public string CodArticolo { get; set; } - public string Disegno { get; set; } - public string DescArticolo { get; set; } public string CurrRev { get; set; } - public string ProdRev { get; set; } + public string DescArticolo { get; set; } + public string Disegno { get; set; } public bool? FlagIsNew { get; set; } + public string ProdRev { get; set; } public string Tipo { get; set; } - public virtual StActual StActual { get; set; } - public virtual ICollection DiarioDiBordos { get; set; } - public virtual ICollection Odls { get; set; } + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/AnagClassiTempo.cs b/MP.AppAuth/Models/AnagClassiTempo.cs similarity index 68% rename from MP.AppAuth/DatabaseModels/AnagClassiTempo.cs rename to MP.AppAuth/Models/AnagClassiTempo.cs index b7c54e56..89e5d83c 100644 --- a/MP.AppAuth/DatabaseModels/AnagClassiTempo.cs +++ b/MP.AppAuth/Models/AnagClassiTempo.cs @@ -3,11 +3,15 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class AnagClassiTempo { + #region Public Properties + public string ClasseTempo { get; set; } public string Descrizione { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/AnagKeyValue.cs b/MP.AppAuth/Models/AnagKeyValue.cs similarity index 77% rename from MP.AppAuth/DatabaseModels/AnagKeyValue.cs rename to MP.AppAuth/Models/AnagKeyValue.cs index 3adc7d57..bdeede66 100644 --- a/MP.AppAuth/DatabaseModels/AnagKeyValue.cs +++ b/MP.AppAuth/Models/AnagKeyValue.cs @@ -3,14 +3,18 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class AnagKeyValue { - public string NomeVar { get; set; } - public int? ValInt { get; set; } - public double? ValFloat { get; set; } - public string ValString { get; set; } + #region Public Properties + public string Descrizione { get; set; } + public string NomeVar { get; set; } + public double? ValFloat { get; set; } + public int? ValInt { get; set; } + public string ValString { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/AnagraficaCausaliScarto.cs b/MP.AppAuth/Models/AnagraficaCausaliScarto.cs similarity index 58% rename from MP.AppAuth/DatabaseModels/AnagraficaCausaliScarto.cs rename to MP.AppAuth/Models/AnagraficaCausaliScarto.cs index 0daeeaf5..b65a6458 100644 --- a/MP.AppAuth/DatabaseModels/AnagraficaCausaliScarto.cs +++ b/MP.AppAuth/Models/AnagraficaCausaliScarto.cs @@ -3,20 +3,17 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class AnagraficaCausaliScarto { - public AnagraficaCausaliScarto() - { - RegistroScartis = new HashSet(); - } + #region Public Properties public string Causale { get; set; } - public string Descrizione { get; set; } public string CssClass { get; set; } + public string Descrizione { get; set; } public string Icona { get; set; } - public virtual ICollection RegistroScartis { get; set; } + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/AnagraficaFlussi.cs b/MP.AppAuth/Models/AnagraficaFlussi.cs similarity index 68% rename from MP.AppAuth/DatabaseModels/AnagraficaFlussi.cs rename to MP.AppAuth/Models/AnagraficaFlussi.cs index 7a1ffa23..c004c9b8 100644 --- a/MP.AppAuth/DatabaseModels/AnagraficaFlussi.cs +++ b/MP.AppAuth/Models/AnagraficaFlussi.cs @@ -3,11 +3,15 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class AnagraficaFlussi { + #region Public Properties + public string CodFlux { get; set; } public string DescrFlux { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/AnagraficaGruppi.cs b/MP.AppAuth/Models/AnagraficaGruppi.cs similarity index 78% rename from MP.AppAuth/DatabaseModels/AnagraficaGruppi.cs rename to MP.AppAuth/Models/AnagraficaGruppi.cs index d27241ca..8ffc922b 100644 --- a/MP.AppAuth/DatabaseModels/AnagraficaGruppi.cs +++ b/MP.AppAuth/Models/AnagraficaGruppi.cs @@ -3,24 +3,29 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class AnagraficaGruppi { + #region Public Constructors + public AnagraficaGruppi() { Gruppi2Macchines = new HashSet(); Gruppi2Operatoris = new HashSet(); - PromesseOdls = new HashSet(); } - public string CodGruppo { get; set; } - public string TipoGruppo { get; set; } - public string DescrGruppo { get; set; } - public bool SelEnabled { get; set; } + #endregion Public Constructors + #region Public Properties + + public string CodGruppo { get; set; } + public string DescrGruppo { get; set; } public virtual ICollection Gruppi2Macchines { get; set; } public virtual ICollection Gruppi2Operatoris { get; set; } - public virtual ICollection PromesseOdls { get; set; } + public bool SelEnabled { get; set; } + public string TipoGruppo { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/AnagraficaIngressi.cs b/MP.AppAuth/Models/AnagraficaIngressi.cs similarity index 73% rename from MP.AppAuth/DatabaseModels/AnagraficaIngressi.cs rename to MP.AppAuth/Models/AnagraficaIngressi.cs index 1f3d606e..c6e9e6f1 100644 --- a/MP.AppAuth/DatabaseModels/AnagraficaIngressi.cs +++ b/MP.AppAuth/Models/AnagraficaIngressi.cs @@ -3,12 +3,16 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class AnagraficaIngressi { + #region Public Properties + + public string Descrizione { get; set; } public int IdxFamigliaIngresso { get; set; } public int ValoreIngresso { get; set; } - public string Descrizione { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/AnagraficaMicroStati.cs b/MP.AppAuth/Models/AnagraficaMicroStati.cs similarity index 73% rename from MP.AppAuth/DatabaseModels/AnagraficaMicroStati.cs rename to MP.AppAuth/Models/AnagraficaMicroStati.cs index cdcb3041..3d5dadb9 100644 --- a/MP.AppAuth/DatabaseModels/AnagraficaMicroStati.cs +++ b/MP.AppAuth/Models/AnagraficaMicroStati.cs @@ -3,12 +3,16 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class AnagraficaMicroStati { + #region Public Properties + + public string Descrizione { get; set; } public int IdxFamigliaIngresso { get; set; } public int IdxMicroStato { get; set; } - public string Descrizione { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/AnagraficaOperatori.cs b/MP.AppAuth/Models/AnagraficaOperatori.cs similarity index 58% rename from MP.AppAuth/DatabaseModels/AnagraficaOperatori.cs rename to MP.AppAuth/Models/AnagraficaOperatori.cs index e202a835..675260c1 100644 --- a/MP.AppAuth/DatabaseModels/AnagraficaOperatori.cs +++ b/MP.AppAuth/Models/AnagraficaOperatori.cs @@ -3,28 +3,29 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class AnagraficaOperatori { + #region Public Constructors + public AnagraficaOperatori() { - DiarioDiBordos = new HashSet(); - EventLists = new HashSet(); Gruppi2Operatoris = new HashSet(); - StatoMacchines = new HashSet(); } - public int MatrOpr { get; set; } - public string Cognome { get; set; } - public string Nome { get; set; } - public bool? IsAdmin { get; set; } + #endregion Public Constructors + + #region Public Properties + public string AuthKey { get; set; } public string CodOprExt { get; set; } - - public virtual ICollection DiarioDiBordos { get; set; } - public virtual ICollection EventLists { get; set; } + public string Cognome { get; set; } public virtual ICollection Gruppi2Operatoris { get; set; } - public virtual ICollection StatoMacchines { get; set; } + public bool? IsAdmin { get; set; } + public int MatrOpr { get; set; } + public string Nome { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/Config.cs b/MP.AppAuth/Models/Config.cs similarity index 73% rename from MP.AppAuth/DatabaseModels/Config.cs rename to MP.AppAuth/Models/Config.cs index a39c20a9..995d09aa 100644 --- a/MP.AppAuth/DatabaseModels/Config.cs +++ b/MP.AppAuth/Models/Config.cs @@ -3,13 +3,17 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class Config { + #region Public Properties + public string Chiave { get; set; } + public string Note { get; set; } public string Valore { get; set; } public string ValoreStd { get; set; } - public string Note { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/DatiMacchine.cs b/MP.AppAuth/Models/DatiMacchine.cs similarity index 87% rename from MP.AppAuth/DatabaseModels/DatiMacchine.cs rename to MP.AppAuth/Models/DatiMacchine.cs index 6bf49340..72344603 100644 --- a/MP.AppAuth/DatabaseModels/DatiMacchine.cs +++ b/MP.AppAuth/Models/DatiMacchine.cs @@ -3,21 +3,25 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class DatiMacchine { - public string IdxMacchina { get; set; } - public bool? PalletChange { get; set; } + #region Public Properties + public string CodArticoloA { get; set; } public string CodArticoloB { get; set; } - public string SerialPort { get; set; } - public int? RefreshPeriod { get; set; } - public bool? Simulazione { get; set; } - public bool? SimplePallet { get; set; } - public bool? InsEnabled { get; set; } - public bool SLogEnabled { get; set; } - public bool? IsTrigerDbon { get; set; } public bool HasCounter { get; set; } + public string IdxMacchina { get; set; } + public bool? InsEnabled { get; set; } + public bool? IsTrigerDbon { get; set; } + public bool? PalletChange { get; set; } + public int? RefreshPeriod { get; set; } + public string SerialPort { get; set; } + public bool? SimplePallet { get; set; } + public bool? Simulazione { get; set; } + public bool SLogEnabled { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/Models/FamigliaTipoIngressi.cs b/MP.AppAuth/Models/FamigliaTipoIngressi.cs new file mode 100644 index 00000000..2ace2783 --- /dev/null +++ b/MP.AppAuth/Models/FamigliaTipoIngressi.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.AppAuth.Models +{ + public partial class FamigliaTipoIngressi + { + #region Public Properties + + public string DescrizioneIngresso { get; set; } + public int IdxFamigliaIngresso { get; set; } + + #endregion Public Properties + } +} \ No newline at end of file diff --git a/MP.AppAuth/Models/FamiglieMacchine.cs b/MP.AppAuth/Models/FamiglieMacchine.cs new file mode 100644 index 00000000..a1596e74 --- /dev/null +++ b/MP.AppAuth/Models/FamiglieMacchine.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.AppAuth.Models +{ + public partial class FamiglieMacchine + { + #region Public Properties + + public string Descrizione { get; set; } + public bool? HasIob { get; set; } + public bool? HasUdi { get; set; } + public int IdxFamiglia { get; set; } + + #endregion Public Properties + } +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/Gruppi2Macchine.cs b/MP.AppAuth/Models/Gruppi2Macchine.cs similarity index 78% rename from MP.AppAuth/DatabaseModels/Gruppi2Macchine.cs rename to MP.AppAuth/Models/Gruppi2Macchine.cs index 37723c50..9bb3f661 100644 --- a/MP.AppAuth/DatabaseModels/Gruppi2Macchine.cs +++ b/MP.AppAuth/Models/Gruppi2Macchine.cs @@ -3,14 +3,17 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class Gruppi2Macchine { - public string IdxMacchina { get; set; } - public string CodGruppo { get; set; } + #region Public Properties + public string CodGruppo { get; set; } public virtual AnagraficaGruppi CodGruppoNavigation { get; set; } + public string IdxMacchina { get; set; } public virtual Macchine IdxMacchinaNavigation { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/Gruppi2Operatori.cs b/MP.AppAuth/Models/Gruppi2Operatori.cs similarity index 78% rename from MP.AppAuth/DatabaseModels/Gruppi2Operatori.cs rename to MP.AppAuth/Models/Gruppi2Operatori.cs index 26800d18..f701f0aa 100644 --- a/MP.AppAuth/DatabaseModels/Gruppi2Operatori.cs +++ b/MP.AppAuth/Models/Gruppi2Operatori.cs @@ -3,14 +3,17 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class Gruppi2Operatori { - public int MatrOpr { get; set; } - public string CodGruppo { get; set; } + #region Public Properties + public string CodGruppo { get; set; } public virtual AnagraficaGruppi CodGruppoNavigation { get; set; } + public int MatrOpr { get; set; } public virtual AnagraficaOperatori MatrOprNavigation { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/KeepAlive.cs b/MP.AppAuth/Models/KeepAlive.cs similarity index 76% rename from MP.AppAuth/DatabaseModels/KeepAlive.cs rename to MP.AppAuth/Models/KeepAlive.cs index 442e6fb1..6de6cf5a 100644 --- a/MP.AppAuth/DatabaseModels/KeepAlive.cs +++ b/MP.AppAuth/Models/KeepAlive.cs @@ -3,13 +3,17 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class KeepAlive { - public string IdxMacchina { get; set; } - public DateTime? DataOraServer { get; set; } + #region Public Properties + public DateTime? DataOraMacchina { get; set; } + public DateTime? DataOraServer { get; set; } public DateTime? DataOraStart { get; set; } + public string IdxMacchina { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/LinkMenuJqm.cs b/MP.AppAuth/Models/LinkMenuJqm.cs similarity index 78% rename from MP.AppAuth/DatabaseModels/LinkMenuJqm.cs rename to MP.AppAuth/Models/LinkMenuJqm.cs index 7e68fa82..761f9c21 100644 --- a/MP.AppAuth/DatabaseModels/LinkMenuJqm.cs +++ b/MP.AppAuth/Models/LinkMenuJqm.cs @@ -3,15 +3,19 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class LinkMenuJqm { + #region Public Properties + + public string Icona { get; set; } public int IdxLink { get; set; } - public string TipoLink { get; set; } + public string NavigateUrl { get; set; } public int? Ordine { get; set; } public string Testo { get; set; } - public string NavigateUrl { get; set; } - public string Icona { get; set; } + public string TipoLink { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/ListValue.cs b/MP.AppAuth/Models/ListValue.cs similarity index 76% rename from MP.AppAuth/DatabaseModels/ListValue.cs rename to MP.AppAuth/Models/ListValue.cs index 27aae03c..cb1132fe 100644 --- a/MP.AppAuth/DatabaseModels/ListValue.cs +++ b/MP.AppAuth/Models/ListValue.cs @@ -3,14 +3,18 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class ListValue { - public string TableName { get; set; } + #region Public Properties + public string FieldName { get; set; } - public string Value { get; set; } public string Label { get; set; } public int? Ordinal { get; set; } + public string TableName { get; set; } + public string Value { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/Models/Macchine.cs b/MP.AppAuth/Models/Macchine.cs new file mode 100644 index 00000000..259e0029 --- /dev/null +++ b/MP.AppAuth/Models/Macchine.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.AppAuth.Models +{ + public partial class Macchine + { + #region Public Constructors + + public Macchine() + { + Gruppi2Macchines = new HashSet(); + } + + #endregion Public Constructors + + #region Public Properties + + public string CodMacchina { get; set; } + public int ColNum { get; set; } + public string Css { get; set; } + public string Descrizione { get; set; } + public virtual ICollection Gruppi2Macchines { get; set; } + public string IdxMacchina { get; set; } + public string Locazione { get; set; } + public string Nome { get; set; } + public string Note { get; set; } + public int RowNum { get; set; } + public string Url { get; set; } + + #endregion Public Properties + } +} \ No newline at end of file diff --git a/MP.AppAuth/DatabaseModels/UpdMan.cs b/MP.AppAuth/Models/UpdMan.cs similarity index 80% rename from MP.AppAuth/DatabaseModels/UpdMan.cs rename to MP.AppAuth/Models/UpdMan.cs index 286b947a..da21e648 100644 --- a/MP.AppAuth/DatabaseModels/UpdMan.cs +++ b/MP.AppAuth/Models/UpdMan.cs @@ -3,16 +3,20 @@ using System.Collections.Generic; #nullable disable -namespace MP.AppAuth +namespace MP.AppAuth.Models { public partial class UpdMan { + #region Public Properties + public string AppName { get; set; } - public string ManifestUrl { get; set; } - public bool? IsAuth { get; set; } - public string LocalRepo { get; set; } - public string PackName { get; set; } - public string LicenseKey { get; set; } public string AppUrl { get; set; } + public bool? IsAuth { get; set; } + public string LicenseKey { get; set; } + public string LocalRepo { get; set; } + public string ManifestUrl { get; set; } + public string PackName { get; set; } + + #endregion Public Properties } -} +} \ No newline at end of file diff --git a/MP.AppAuth/MoonProContext.cs b/MP.AppAuth/MoonProContext.cs index 036a8a1c..ef7a9291 100644 --- a/MP.AppAuth/MoonProContext.cs +++ b/MP.AppAuth/MoonProContext.cs @@ -1,6 +1,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; +using MP.AppAuth.Models; #nullable disable @@ -27,7 +28,6 @@ namespace MP.AppAuth public virtual DbSet AnagClassiTempos { get; set; } public virtual DbSet AnagKeyValues { get; set; } public virtual DbSet AnagraficaCausaliScartos { get; set; } - public virtual DbSet AnagraficaEventis { get; set; } public virtual DbSet AnagraficaFlussis { get; set; } public virtual DbSet AnagraficaGruppis { get; set; } public virtual DbSet AnagraficaIngressis { get; set; } @@ -40,7 +40,6 @@ namespace MP.AppAuth public virtual DbSet Gruppi2Macchines { get; set; } public virtual DbSet Gruppi2Operatoris { get; set; } public virtual DbSet KeepAlives { get; set; } - public virtual DbSet Lingues { get; set; } public virtual DbSet LinkMenuJqms { get; set; } public virtual DbSet ListValues { get; set; } public virtual DbSet Macchines { get; set; } @@ -60,7 +59,6 @@ namespace MP.AppAuth { if (!optionsBuilder.IsConfigured) { -#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("Data Source=SQL2016DEV;Initial Catalog=MoonPro;Trusted_Connection=True;"); } } @@ -174,25 +172,6 @@ namespace MP.AppAuth .HasDefaultValueSql("('')"); }); - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxTipo); - - entity.ToTable("AnagraficaEventi"); - - entity.Property(e => e.IdxTipo).ValueGeneratedNever(); - - entity.Property(e => e.Azione) - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.Nome).HasMaxLength(50); - - entity.Property(e => e.TabAzione) - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - }); - modelBuilder.Entity(entity => { entity.HasKey(e => e.CodFlux); @@ -270,90 +249,6 @@ namespace MP.AppAuth entity.Property(e => e.Nome).HasMaxLength(50); }); - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.MatrOpr); - - entity.Property(e => e.MatrOpr).ValueGeneratedNever(); - - entity.Property(e => e.Cognome).HasMaxLength(50); - - entity.Property(e => e.Nome).HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxStato); - - entity.ToTable("AnagraficaStati"); - - entity.Property(e => e.IdxStato).ValueGeneratedNever(); - - entity.Property(e => e.ClasseTempo).HasMaxLength(50); - - entity.Property(e => e.Descrizione).HasMaxLength(50); - - entity.Property(e => e.Priorita).HasComment("livello di precedenza (il minore precede e sovrascrive i livelli successivi)"); - - entity.Property(e => e.Semaforo).HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("AnagraficaStatiNew"); - - entity.Property(e => e.ClasseTempo).HasMaxLength(50); - - entity.Property(e => e.Descrizione).HasMaxLength(50); - - entity.Property(e => e.Semaforo).HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.NumGg); - - entity.ToTable("CalendApertura"); - - entity.Property(e => e.NumGg) - .ValueGeneratedNever() - .HasColumnName("NumGG"); - - entity.Property(e => e.OraFine).HasColumnName("oraFine"); - - entity.Property(e => e.OraInizio).HasColumnName("oraInizio"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.Data); - - entity.ToTable("CalendFesteFerie"); - - entity.Property(e => e.Data) - .HasColumnType("datetime") - .HasColumnName("data"); - - entity.Property(e => e.Descrizione) - .HasMaxLength(50) - .HasColumnName("descrizione"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.StoredName); - - entity.ToTable("CmdExeLog"); - - entity.Property(e => e.StoredName).HasMaxLength(50); - - entity.Property(e => e.LastExeTime) - .HasColumnType("datetime") - .HasDefaultValueSql("(getdate())"); - }); - modelBuilder.Entity(entity => { entity.HasKey(e => e.Chiave); @@ -373,175 +268,6 @@ namespace MP.AppAuth .HasComment("Valore di default/riferimento per la variabile"); }); - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.Sorgente, e.Chiave }); - - entity.ToTable("ConfigTmp"); - - entity.Property(e => e.Sorgente) - .HasMaxLength(50) - .HasColumnName("sorgente"); - - entity.Property(e => e.Chiave) - .HasMaxLength(50) - .HasColumnName("chiave"); - - entity.Property(e => e.Note) - .IsRequired() - .HasMaxLength(250) - .HasColumnName("note") - .HasDefaultValueSql("('')"); - - entity.Property(e => e.Valore) - .IsRequired() - .HasMaxLength(250) - .HasColumnName("valore") - .HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ControlloDefrag"); - - entity.Property(e => e.AvgFragmentationInPercent) - .HasColumnType("decimal(5, 2)") - .HasColumnName("avg_fragmentation_in_percent"); - - entity.Property(e => e.CmdRebuild) - .HasMaxLength(410) - .HasColumnName("cmdREBUILD"); - - entity.Property(e => e.CmdReorganize) - .HasMaxLength(413) - .HasColumnName("cmdREORGANIZE"); - - entity.Property(e => e.Data).HasColumnType("datetime"); - - entity.Property(e => e.Db) - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnName("DB"); - - entity.Property(e => e.FillFactor).HasColumnName("Fill_Factor"); - - entity.Property(e => e.IndexName) - .HasMaxLength(128) - .HasColumnName("index_name"); - - entity.Property(e => e.Oggetto) - .HasMaxLength(257) - .HasColumnName("oggetto"); - - entity.Property(e => e.PageCount).HasColumnName("page_count"); - - entity.Property(e => e.TypeDesc) - .HasMaxLength(60) - .HasColumnName("type_desc"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxConferma); - - entity.ToTable("DatiConfermati"); - - entity.HasIndex(e => new { e.IdxOdl, e.CodArticolo, e.DataRif }, "idx_DatiConf_update") - .HasFillFactor((byte)100); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - entity.Property(e => e.DataOraApp).HasColumnType("datetime"); - - entity.Property(e => e.DataOraFrom).HasColumnType("datetime"); - - entity.Property(e => e.DataOraTo).HasColumnType("datetime"); - - entity.Property(e => e.DataRif).HasColumnType("datetime"); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); - - entity.Property(e => e.MatrApp).HasComment("matricola dell'approvatore del record"); - - entity.Property(e => e.MatrOpr).HasComment("matricola dell'operatore che ha lavorato sulla macchina"); - - entity.Property(e => e.Tcassegnato) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCAssegnato"); - - entity.Property(e => e.TempoApertura) - .HasColumnType("decimal(18, 8)") - .HasDefaultValueSql("((0))") - .HasComment("Tempo cronologico - fermate calendario TempoND"); - - entity.Property(e => e.TempoAuto) - .HasColumnType("decimal(18, 8)") - .HasDefaultValueSql("((0))") - .HasComment("Totale tempo macchina in automatico (in apertura)"); - - entity.Property(e => e.TempoCron) - .HasColumnType("decimal(18, 8)") - .HasDefaultValueSql("((0))") - .HasComment("Fine - inizio reale"); - - entity.Property(e => e.TempoFermoAuto) - .HasColumnType("decimal(18, 8)") - .HasDefaultValueSql("((0))") - .HasComment("Totale tempo macchina in fermo (macchian in automatico)"); - - entity.Property(e => e.TempoFermoOn) - .HasColumnType("decimal(18, 8)") - .HasDefaultValueSql("((0))") - .HasComment("Totale tempo macchina in fermo (in apertura)"); - - entity.Property(e => e.TempoNd) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TempoND") - .HasDefaultValueSql("((0))") - .HasComment("Totale tempo macchina ND per fermate programmate (calendario)"); - - entity.Property(e => e.TempoOff) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TempoOFF") - .HasDefaultValueSql("((0))") - .HasComment("Totale tempo macchina spenta ma in TempoApertura"); - - entity.Property(e => e.TempoOn) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TempoON") - .HasDefaultValueSql("((0))") - .HasComment("TempoApertura - TempoOFF"); - - entity.Property(e => e.TempoProdotto) - .HasColumnType("decimal(18, 8)") - .HasComment("TCAssegnato x num pezzi prodotti"); - - entity.Property(e => e.TempoRun) - .HasColumnType("decimal(18, 8)") - .HasDefaultValueSql("((0))") - .HasComment("Totale tempo macchina in automatico ed in lavoro"); - - entity.Property(e => e.TotPzFermo) - .HasDefaultValueSql("((0))") - .HasComment("pezzi prodotti durante la fermata (es setup)"); - - entity.Property(e => e.TotPzProd).HasComment("pezzi prodotti in ciclo"); - - entity.Property(e => e.TotPzScar).HasComment("pezzi prodotti in ciclo"); - - entity.HasOne(d => d.IdxOdlNavigation) - .WithMany(p => p.DatiConfermatis) - .HasForeignKey(d => d.IdxOdl) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_DatiConfermati_ODL"); - }); - modelBuilder.Entity(entity => { entity.HasKey(e => e.IdxMacchina); @@ -592,202 +318,6 @@ namespace MP.AppAuth entity.Property(e => e.Simulazione).HasColumnName("simulazione"); }); - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxConferma); - - entity.ToTable("DatiProduzione"); - - entity.HasIndex(e => new { e.IdxOdl, e.ClasseTempo }, "ix_DatiProduzione_IdxODL_ClasseTempo") - .HasFillFactor((byte)100); - - entity.Property(e => e.Causale).HasMaxLength(50); - - entity.Property(e => e.ClasseTempo).HasMaxLength(50); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - entity.Property(e => e.DataOraApp).HasColumnType("datetime"); - - entity.Property(e => e.DataOraFrom).HasColumnType("datetime"); - - entity.Property(e => e.DataOraTo).HasColumnType("datetime"); - - entity.Property(e => e.DataRif).HasColumnType("datetime"); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); - - entity.Property(e => e.MatrApp).HasComment("matricola dell'approvatore del record"); - - entity.Property(e => e.MatrOpr).HasComment("matricola dell'operatore che ha lavorato sulla macchina"); - - entity.Property(e => e.Tcassegnato) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCAssegnato"); - - entity.Property(e => e.Tempo) - .HasColumnType("decimal(18, 8)") - .HasComment("TCAssegnato x num pezzi prodotti"); - - entity.Property(e => e.TotPzProd).HasComment("pezzi prodotti in ciclo"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.IdxMacchina, e.InizioStato }); - - entity.ToTable("DiarioDiBordo"); - - entity.HasIndex(e => e.FineStato, "idx_DiarioDiBordo_FineStato") - .HasFillFactor((byte)95); - - entity.HasIndex(e => new { e.FineStato, e.IdxMacchina, e.InizioStato }, "idx_DiarioDiBordo_FineStatoNULL") - .HasFilter("([FineStato] IS NULL)"); - - entity.HasIndex(e => new { e.IdxMacchina, e.IdxStato, e.InizioStato, e.FineStato }, "ix_DiarioDiBordo_IdxMacchina_IdxStato_InizioStato_FineStato") - .HasFillFactor((byte)95); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.InizioStato).HasColumnType("datetime"); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - entity.Property(e => e.FineStato).HasColumnType("datetime"); - - entity.Property(e => e.Pallet) - .HasMaxLength(20) - .HasColumnName("pallet"); - - entity.Property(e => e.Value).HasMaxLength(50); - - entity.HasOne(d => d.CodArticoloNavigation) - .WithMany(p => p.DiarioDiBordos) - .HasForeignKey(d => d.CodArticolo) - .HasConstraintName("FK_DiarioDiBordo_AnagArticoli"); - - entity.HasOne(d => d.IdxMacchinaNavigation) - .WithMany(p => p.DiarioDiBordos) - .HasForeignKey(d => d.IdxMacchina) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_DiarioDiBordo_Macchine"); - - entity.HasOne(d => d.IdxStatoNavigation) - .WithMany(p => p.DiarioDiBordos) - .HasForeignKey(d => d.IdxStato) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_DiarioDiBordo_AnagraficaStati"); - - entity.HasOne(d => d.MatrOprNavigation) - .WithMany(p => p.DiarioDiBordos) - .HasForeignKey(d => d.MatrOpr) - .HasConstraintName("FK_DiarioDiBordo_AnagraficaOperatori"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.DataOraConf, e.IdxMacchina }); - - entity.ToTable("ElencoConfermeProd"); - - entity.HasIndex(e => new { e.IdxMacchina, e.DataTo }, "ix_ElencoConfermeProduzione_Idxmacchina_DataTo"); - - entity.Property(e => e.DataOraConf).HasColumnType("datetime"); - - entity.Property(e => e.IdxMacchina) - .HasMaxLength(50) - .HasColumnName("idxMacchina"); - - entity.Property(e => e.CommessaEsterna) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')") - .HasComment("Commessa Gestionale Esterno"); - - entity.Property(e => e.DataFrom) - .HasColumnType("datetime") - .HasColumnName("dataFrom"); - - entity.Property(e => e.DataTo) - .HasColumnType("datetime") - .HasColumnName("dataTo"); - - 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 => new { e.IdxMacchina, e.InizioStato, e.IdxTipo }); - - entity.ToTable("EventList"); - - entity.HasIndex(e => e.IdxTipo, "ix_EventList_IdxTipo_Filter999") - .HasFilter("([IdxTipo]=(999))"); - - entity.HasIndex(e => new { e.InizioStato, e.IdxMacchina }, "ix_EventList_InizioStato") - .HasFillFactor((byte)100); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.InizioStato).HasColumnType("datetime"); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - entity.Property(e => e.Pallet) - .HasMaxLength(20) - .HasColumnName("pallet"); - - entity.Property(e => e.Value).HasMaxLength(250); - - entity.HasOne(d => d.IdxMacchinaNavigation) - .WithMany(p => p.EventLists) - .HasForeignKey(d => d.IdxMacchina) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EventList_Macchine"); - - entity.HasOne(d => d.IdxTipoNavigation) - .WithMany(p => p.EventLists) - .HasForeignKey(d => d.IdxTipo) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EventList_AnagraficaEventi"); - - entity.HasOne(d => d.MatrOprNavigation) - .WithMany(p => p.EventLists) - .HasForeignKey(d => d.MatrOpr) - .HasConstraintName("FK_EventList_AnagraficaOperatori"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("EventListLog"); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - entity.Property(e => e.DataInsert).HasDefaultValueSql("(sysdatetime())"); - - 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(250); - }); - modelBuilder.Entity(entity => { entity.HasKey(e => e.IdxFamigliaIngresso); @@ -822,26 +352,6 @@ namespace MP.AppAuth .HasComment("Indica se la famiglia macchina prevede UserDataInput ovvero inserimento MANUALE informazioni"); }); - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.DtEvento, e.IdxMacchina, e.CodFlux }); - - entity.ToTable("FluxLog"); - - entity.Property(e => e.DtEvento) - .HasColumnType("datetime") - .HasColumnName("dtEvento"); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.CodFlux).HasMaxLength(50); - - entity.Property(e => e.Valore) - .IsRequired() - .HasMaxLength(250) - .HasDefaultValueSql("('')"); - }); - modelBuilder.Entity(entity => { entity.HasKey(e => new { e.IdxMacchina, e.CodGruppo }); @@ -886,59 +396,6 @@ namespace MP.AppAuth .HasConstraintName("FK_Gruppi2Operatori_AnagraficaOperatori"); }); - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("InputRawAll", "batch"); - - entity.Property(e => e.Altro) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Data) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.DataOra).HasColumnType("datetime"); - - entity.Property(e => e.IdxMacchina).HasColumnName("idxMacchina"); - - entity.Property(e => e.Ora) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Origine) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CodArticolo); - - entity.ToTable("Kanban"); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - entity.Property(e => e.KanbanCode).HasMaxLength(50); - - entity.Property(e => e.MatricolaKanban) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.PzPallet).HasDefaultValueSql("((1))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.MatricolaKanban); - - entity.Property(e => e.MatricolaKanban).HasMaxLength(50); - - entity.Property(e => e.KanbanCode).HasMaxLength(50); - }); - modelBuilder.Entity(entity => { entity.HasKey(e => e.IdxMacchina); @@ -952,19 +409,6 @@ namespace MP.AppAuth entity.Property(e => e.DataOraStart).HasColumnType("datetime"); }); - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.Lingua); - - entity.ToTable("Lingue"); - - entity.Property(e => e.Lingua).HasMaxLength(3); - - entity.Property(e => e.DescrizioneLingua) - .IsRequired() - .HasMaxLength(50); - }); - modelBuilder.Entity(entity => { entity.HasKey(e => e.IdxLink) @@ -1006,17 +450,6 @@ namespace MP.AppAuth entity.Property(e => e.Ordinal).HasColumnName("ordinal"); }); - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.Versione); - - entity.ToTable("LogUpdateDb"); - - entity.Property(e => e.Versione).ValueGeneratedNever(); - - entity.Property(e => e.Data).HasColumnType("datetime"); - }); - modelBuilder.Entity(entity => { entity.HasKey(e => e.IdxMacchina); @@ -1049,1260 +482,6 @@ namespace MP.AppAuth .HasColumnName("url"); }); - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.IdxFamigliaIngresso, e.IdxMacchina }); - - entity.ToTable("Macchine2FamigliaIngressi"); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.BitFilt) - .HasDefaultValueSql("((255))") - .HasComment("Indica la maschera di FILTRAGGIO da applicare ai dati: 11111111 non filtra nulla, 11110000 tiene solo 4 bit a SX"); - - entity.Property(e => e.Bsr) - .HasColumnName("BSR") - .HasComment("BitShiftRight: Indica numero di Bit per shift verso destra del valore: es IN:10010000, BSR 4 --> 00001001"); - - entity.Property(e => e.ExplodeBit).HasComment("Indica se si debbano esplodere i valori letti in BIT: es se ho 2 bit (0..3) --> esploderò in 4 bit ESCLUSIVI (0001 | 0010 | 0100 | 1000)"); - - entity.Property(e => e.MaxVal) - .HasDefaultValueSql("((255))") - .HasComment("valore MASSIMO ATTESO (se diverso da bitFilt --> macchina MULTI)"); - - entity.Property(e => e.Multi) - .HasComputedColumnSql("(case when [BitFilt]=[MaxVal] then (0) else (1) end)", false) - .HasComment("Indica se ci sia una gestione MULTI state Machine (+ SM ingressi indipendenti)"); - - entity.Property(e => e.NumBit) - .HasDefaultValueSql("((8))") - .HasComment("Numero di BIT esclusivi in cui (se va esploso) deve essere convertito valore"); - - entity.HasOne(d => d.IdxFamigliaIngressoNavigation) - .WithMany(p => p.Macchine2FamigliaIngressis) - .HasForeignKey(d => d.IdxFamigliaIngresso) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Macchine2FamigliaIngressi_FamigliaTipoIngressi"); - - entity.HasOne(d => d.IdxMacchinaNavigation) - .WithMany(p => p.Macchine2FamigliaIngressis) - .HasForeignKey(d => d.IdxMacchina) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Macchine2FamigliaIngressi_Macchine"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxMacchina) - .HasName("PK_Macchine2FamiglieMacchine_1"); - - entity.ToTable("Macchine2FamiglieMacchine"); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.HasOne(d => d.IdxFamigliaNavigation) - .WithMany(p => p.Macchine2FamiglieMacchines) - .HasForeignKey(d => d.IdxFamiglia) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Macchine2FamiglieMacchine_FamiglieMacchine"); - - entity.HasOne(d => d.IdxMacchinaNavigation) - .WithOne(p => p.Macchine2FamiglieMacchine) - .HasForeignKey(d => d.IdxMacchina) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Macchine2FamiglieMacchine_Macchine"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.IdxMacchina, e.IdxMacchinaSlave }) - .HasName("PK_Macc2Slave"); - - entity.ToTable("Macchine2Slave"); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.IdxMacchinaSlave).HasMaxLength(50); - - entity.HasOne(d => d.IdxMacchinaNavigation) - .WithMany(p => p.Macchine2SlaveIdxMacchinaNavigations) - .HasForeignKey(d => d.IdxMacchina) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Macc2Slave_Macchine"); - - entity.HasOne(d => d.IdxMacchinaSlaveNavigation) - .WithMany(p => p.Macchine2SlaveIdxMacchinaSlaveNavigations) - .HasForeignKey(d => d.IdxMacchinaSlave) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Macchine2Slave_Macchine"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.Posizione); - - entity.ToTable("Mappa"); - - entity.Property(e => e.Posizione) - .HasMaxLength(10) - .IsFixedLength(true); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.Imago) - .HasMaxLength(50) - .HasColumnName("imago"); - - entity.HasOne(d => d.IdxMacchinaNavigation) - .WithMany(p => p.Mappas) - .HasForeignKey(d => d.IdxMacchina) - .HasConstraintName("FK_Mappa_Macchine"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.RowNum); - - entity.ToTable("MappaStatoExpl"); - - entity.Property(e => e.CodArticolo) - .HasMaxLength(50) - .HasDefaultValueSql("('-')"); - - entity.Property(e => e.CodMacchina).HasMaxLength(50); - - entity.Property(e => e.DataInizioOdl) - .HasColumnType("datetime") - .HasColumnName("DataInizioODL"); - - entity.Property(e => e.DescrizioneStato) - .HasMaxLength(50) - .HasDefaultValueSql("('n.d.')"); - - entity.Property(e => e.Disegno) - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.Durata) - .HasColumnName("durata") - .HasDefaultValueSql("((0))"); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.IdxOdl).HasColumnName("idxODL"); - - entity.Property(e => e.IdxStato) - .HasColumnName("idxStato") - .HasDefaultValueSql("((0))"); - - entity.Property(e => e.LastUpdate) - .HasColumnType("datetime") - .HasColumnName("lastUpdate"); - - entity.Property(e => e.Nome).HasMaxLength(50); - - entity.Property(e => e.PezziConf).HasDefaultValueSql("((0))"); - - entity.Property(e => e.PezziProd).HasDefaultValueSql("((0))"); - - entity.Property(e => e.Semaforo) - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.Tcassegnato) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCAssegnato") - .HasDefaultValueSql("((1))"); - - entity.Property(e => e.Tceff) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCEff") - .HasDefaultValueSql("((0))"); - - entity.Property(e => e.TceffRt) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCEffRT") - .HasDefaultValueSql("((0))"); - - entity.Property(e => e.Tclav) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCLav") - .HasDefaultValueSql("((0))"); - - entity.Property(e => e.TclavRt) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCLavRT") - .HasDefaultValueSql("((0))"); - - entity.Property(e => e.Tcmedio) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCMedio") - .HasDefaultValueSql("((0))"); - - entity.Property(e => e.TcmedioRt) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCMedioRT") - .HasDefaultValueSql("((0))"); - - entity.Property(e => e.TempoAuto) - .HasColumnType("decimal(18, 8)") - .HasDefaultValueSql("((0))"); - - entity.Property(e => e.TempoOn) - .HasColumnType("decimal(18, 8)") - .HasDefaultValueSql("((0))"); - - entity.Property(e => e.TempoRun) - .HasColumnType("decimal(18, 8)") - .HasDefaultValueSql("((0))"); - - entity.Property(e => e.Url) - .HasMaxLength(250) - .HasColumnName("url"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxMacchina); - - entity.ToTable("MicroStatoMacchina"); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.InizioStato).HasColumnType("datetime"); - - entity.Property(e => e.Value).HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxOdl) - .HasName("PK_TabAvvioProduzione"); - - entity.ToTable("ODL"); - - entity.HasIndex(e => new { e.IdxMacchina, e.DataFine, e.DataInizio }, "Ix_ODL_IdxMacchina_DataFine_DataInizio"); - - entity.HasIndex(e => new { e.IdxMacchina, e.DataInizio, e.DataFine, e.IdxOdl }, "ix_ODL_IdxMacchina_Data_ODL") - .HasFillFactor((byte)95); - - entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); - - entity.Property(e => e.CodArticolo) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CodCli) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')") - .HasComment("Codice cliente (opzionale)"); - - entity.Property(e => e.CommessaAs400) - .IsRequired() - .HasMaxLength(50) - .HasComputedColumnSql("([KeyRichiesta])", false); - - 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.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.KeyRichiesta) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.NeedAppr).HasComment("Indica se il tempo sia DA APPROVARE, ovvero inserito da segreteria e modificato dal preparatore e richiede user/data approvazione"); - - entity.Property(e => e.Note) - .HasMaxLength(2500) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.Provvisorio) - .HasColumnName("provvisorio") - .HasComment("indica se sia un TC provvisorio (=creato \"al volo\" da tablet)"); - - entity.Property(e => e.PzPallet).HasDefaultValueSql("((1))"); - - entity.Property(e => e.Tcassegnato) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCAssegnato") - .HasDefaultValueSql("((1))") - .HasComment("TC in minuti CENTESIMALI"); - - entity.Property(e => e.TcrichAttr) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCRichAttr") - .HasDefaultValueSql("((1))") - .HasComment("Tempo ciclo EVENTUALMENTE richiesto da attrezzista (oppure confermato)"); - - entity.Property(e => e.ToAs400).HasComputedColumnSql("(case when [KeyRichiesta]<>'' then (1) else (0) end)", false); - - entity.Property(e => e.UserAppr).HasMaxLength(50); - - entity.HasOne(d => d.CodArticoloNavigation) - .WithMany(p => p.Odls) - .HasForeignKey(d => d.CodArticolo) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_ODL_AnagArticoli"); - - entity.HasOne(d => d.IdxMacchinaNavigation) - .WithMany(p => p.Odls) - .HasForeignKey(d => d.IdxMacchina) - .HasConstraintName("FK_ODL_Macchine"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.IdxChiave, e.Tabella, e.Report }) - .HasName("PK_repOrdinamenti"); - - entity.ToTable("Ordinamenti", "rep"); - - entity.Property(e => e.IdxChiave).HasMaxLength(50); - - entity.Property(e => e.Tabella) - .HasMaxLength(50) - .HasDefaultValueSql("(N'Tabella')"); - - entity.Property(e => e.Report).HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CodPermesso); - - entity.ToTable("Permessi"); - - entity.Property(e => e.CodPermesso) - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnName("COD_PERMESSO"); - - entity.Property(e => e.Descrizione) - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnName("DESCRIZIONE"); - - entity.Property(e => e.Gruppo).HasColumnName("GRUPPO"); - - entity.Property(e => e.Nome) - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnName("NOME"); - - entity.Property(e => e.Numero).HasColumnName("NUMERO"); - - entity.Property(e => e.Url) - .IsRequired() - .HasMaxLength(250) - .IsUnicode(false) - .HasColumnName("URL"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.CodPermesso, e.CodFunzione }); - - entity.ToTable("Permessi2Funzione"); - - entity.Property(e => e.CodPermesso) - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnName("COD_PERMESSO"); - - entity.Property(e => e.CodFunzione) - .HasMaxLength(31) - .HasColumnName("COD_FUNZIONE"); - - entity.Property(e => e.Readwrite) - .HasMaxLength(1) - .IsUnicode(false) - .HasColumnName("READWRITE") - .IsFixedLength(true); - - entity.HasOne(d => d.CodPermessoNavigation) - .WithMany(p => p.Permessi2Funziones) - .HasForeignKey(d => d.CodPermesso) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Permessi2Funzione_Permessi"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxPostazione) - .HasName("PK_PostazioniSel"); - - entity.ToTable("PostazioniMapo"); - - entity.Property(e => e.IdxPostazione).HasMaxLength(50); - - entity.Property(e => e.DescPostazione).HasMaxLength(50); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.InputUntil) - .HasColumnType("datetime") - .HasComment("data-ora entro cui chiudere l'input (e tornare su operatore base)"); - - entity.Property(e => e.LastBarcode) - .HasMaxLength(50) - .HasComment("ultimo barcode inviato"); - - entity.Property(e => e.MatrOperatore) - .HasDefaultValueSql("((0))") - .HasComment("Operatore correntemente sulla macchina"); - - entity.HasOne(d => d.IdxMacchinaNavigation) - .WithMany(p => p.PostazioniMapos) - .HasForeignKey(d => d.IdxMacchina) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_PostazioniMapo_Macchine"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxElab); - - entity.ToTable("ProcedureLog"); - - entity.Property(e => e.DataFine).HasColumnType("datetime"); - - entity.Property(e => e.DataInizio).HasColumnType("datetime"); - - entity.Property(e => e.Nome).HasMaxLength(50); - - entity.Property(e => e.Note).HasMaxLength(400); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxConferma) - .HasName("PK_ProduzioneAs400_buf"); - - entity.ToTable("ProduzioneAs400", "buffer"); - - entity.Property(e => e.IdxConferma).ValueGeneratedNever(); - - entity.Property(e => e.CodArticolo) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.CommessaAs400) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.DataExport).HasColumnType("smalldatetime"); - - entity.Property(e => e.DataImportAs400).HasColumnType("datetime"); - - entity.Property(e => e.DataRif).HasColumnType("datetime"); - - entity.Property(e => e.FlagOkAs400).HasDefaultValueSql("((0))"); - - entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxExport); - - entity.ToTable("ProduzioneAs400", "export"); - - entity.Property(e => e.CodArticolo) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.CommessaAs400) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.DataImportAs400).HasColumnType("datetime"); - - entity.Property(e => e.DataRif).HasColumnType("datetime"); - - entity.Property(e => e.FlagOkAs400).HasDefaultValueSql("((0))"); - - entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxPromessa); - - entity.ToTable("PromesseODL"); - - entity.Property(e => e.IdxPromessa).HasColumnName("idxPromessa"); - - entity.Property(e => e.Attivabile).HasComment("Verifica se possa essere avviato (tipicamente chaimata funzione esterna che verifica sia attivabile = ci sono grezzi/fasi precedenti concluse...)"); - - entity.Property(e => e.CodArticolo) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.CodCli) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')") - .HasComment("Codice cliente (opzionale)"); - - entity.Property(e => e.CodGruppo) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.DueDate) - .HasColumnType("datetime") - .HasDefaultValueSql("(getdate())") - .HasComment("Data indicativa avvio ODL (promessa)"); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.IdxOdl) - .HasColumnName("IdxODL") - .HasComment("Identificativo dell'ODL generato dalla promessa ( 0 se non assegnata ; -1 CTRACK )"); - - entity.Property(e => e.InsertDate) - .HasColumnType("datetime") - .HasDefaultValueSql("(getdate())"); - - entity.Property(e => e.KeyBcode) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("KeyBCode") - .HasDefaultValueSql("('')") - .HasComment("Chiave della richeista (esterna) da cui deriva la promessa"); - - entity.Property(e => e.KeyRichiesta) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')") - .HasComment("Chiave della richeista (esterna) da cui deriva la promessa"); - - entity.Property(e => e.Note) - .IsRequired() - .HasMaxLength(2500) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.Priorita).HasDefaultValueSql("((1))"); - - entity.Property(e => e.PzPallet).HasDefaultValueSql("((1))"); - - entity.Property(e => e.Tcassegnato) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCAssegnato") - .HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.CodGruppoNavigation) - .WithMany(p => p.PromesseOdls) - .HasForeignKey(d => d.CodGruppo) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_PromesseODL_AnagraficaGruppi"); - - entity.HasOne(d => d.IdxMacchinaNavigation) - .WithMany(p => p.PromesseOdls) - .HasForeignKey(d => d.IdxMacchina) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_PromesseODL_Macchine"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxControllo); - - entity.ToTable("RegistroControlli"); - - entity.Property(e => e.CodArticolo) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('-')"); - - 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.MatrOpr).HasComment("matricola dell'approvatore del record"); - - entity.Property(e => e.Note) - .IsRequired() - .HasMaxLength(250) - .HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.IdxMacchina, e.DataOra, e.Causale }) - .HasName("PK_RegScarti"); - - entity.ToTable("RegistroScarti"); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.DataOra).HasColumnType("datetime"); - - entity.Property(e => e.Causale) - .HasMaxLength(50) - .HasDefaultValueSql("('ND')"); - - entity.Property(e => e.CodArticolo) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.DataOraProdRec) - .HasColumnType("datetime") - .HasComment("Data-Ora della registrazione insieme alla produzione"); - - entity.Property(e => e.Note) - .IsRequired() - .HasMaxLength(250) - .HasDefaultValueSql("('')"); - - entity.HasOne(d => d.CausaleNavigation) - .WithMany(p => p.RegistroScartis) - .HasForeignKey(d => d.Causale) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_RegistroScarti_AnagraficaCausaliScarto"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxReboot); - - entity.ToTable("RemoteRebootLog"); - - entity.Property(e => e.IdxReboot).HasColumnName("idxReboot"); - - entity.Property(e => e.Agent).HasMaxLength(250); - - entity.Property(e => e.DataOraBoot).HasColumnType("datetime"); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Ipv4) - .HasMaxLength(50) - .HasColumnName("IPv4"); - - entity.Property(e => e.MacAddr) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("macAddr") - .HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.IdxMacchina, e.DateStart }); - - entity.ToTable("RicalcoloMacchineLog"); - - entity.HasIndex(e => new { e.DateStart, e.Type, e.IdxMacchina }, "Ix_RicalcoloMacchineLog_DateEnd_Filter_NULL") - .HasFilter("([DATEEND] IS NULL)"); - - entity.Property(e => e.IdxMacchina) - .HasMaxLength(50) - .HasColumnName("idxMacchina"); - - entity.Property(e => e.DateStart).HasColumnType("datetime"); - - entity.Property(e => e.DateEnd).HasColumnType("datetime"); - - entity.Property(e => e.IdxStatoStart).HasColumnName("idxStatoStart"); - - entity.Property(e => e.Inizio) - .HasColumnType("datetime") - .HasColumnName("inizio"); - - entity.Property(e => e.Type) - .IsRequired() - .HasMaxLength(1) - .IsUnicode(false) - .HasDefaultValueSql("('C')") - .IsFixedLength(true) - .HasComment("Tipo Ricalcolo P->Parziale C-Completo"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxMsg); - - entity.ToTable("SignalLog"); - - entity.Property(e => e.IdxMsg).HasColumnName("idxMsg"); - - entity.Property(e => e.Contatore).HasColumnName("contatore"); - - entity.Property(e => e.DtCurr) - .HasColumnType("datetime") - .HasColumnName("dtCurr") - .HasDefaultValueSql("(getdate())"); - - entity.Property(e => e.DtEve) - .HasColumnType("datetime") - .HasColumnName("dtEve"); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.Valore) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("valore") - .HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxSt); - - entity.ToTable("ST_Actual"); - - entity.HasIndex(e => e.CodArticolo, "ix_ST_Actual_CodArt_unique") - .IsUnique(); - - entity.Property(e => e.IdxSt).HasColumnName("IdxST"); - - entity.Property(e => e.CodArticolo) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CodTempl) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.DtMod) - .HasColumnType("datetime") - .HasDefaultValueSql("(getdate())"); - - entity.Property(e => e.MatrOpr).HasDefaultValueSql("('')"); - - entity.Property(e => e.UserLogin) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.HasOne(d => d.CodArticoloNavigation) - .WithOne(p => p.StActual) - .HasForeignKey(d => d.CodArticolo) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_ST_Actual_AnagArticoli"); - - entity.HasOne(d => d.CodTemplNavigation) - .WithMany(p => p.StActuals) - .HasForeignKey(d => d.CodTempl) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_ST_Actual_ST_Template"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.IdxSt, e.Label, e.Oggetto }) - .HasName("PK_ST_ActualRows_1"); - - entity.ToTable("ST_ActualRows"); - - entity.Property(e => e.IdxSt).HasColumnName("IdxST"); - - entity.Property(e => e.Label) - .HasMaxLength(50) - .HasDefaultValueSql("('')") - .HasComment("Etichetta Campo - (da tradurre)"); - - entity.Property(e => e.Oggetto) - .HasDefaultValueSql("((1))") - .HasComment("Oggetto - Nel caso vi siano più istanze dello stesso oggetto (es. materia prima, Imballo ecc. )"); - - entity.Property(e => e.CheckType) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('NA')") - .HasComment("Tipo di verifica: NA (nessuna), EQUAL (uguaglianza), BATCH (lotto articolo), ..."); - - entity.Property(e => e.CodGruppo) - .IsRequired() - .HasMaxLength(50) - .HasComment("Gruppo x visualizzazione a blocchi"); - - entity.Property(e => e.CodTipo) - .IsRequired() - .HasMaxLength(50) - .HasComment("Tipo di informazione"); - - entity.Property(e => e.ExtCode) - .IsRequired() - .HasDefaultValueSql("('')") - .HasComment("Codice riferimento esterno RECUPERATO con operazione check"); - - entity.Property(e => e.Note) - .IsRequired() - .HasMaxLength(500) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.Num).HasComment("Numero progressivo campo / ordinamento"); - - entity.Property(e => e.Required).HasComment("Se obbligatorio registrarlo in fase di setup oppure solo a titolo informativo (es imballo)"); - - entity.Property(e => e.Value) - .IsRequired() - .HasMaxLength(250) - .HasDefaultValueSql("('')") - .HasComment("Valore corrente / richiesto"); - - entity.Property(e => e.ValueRead) - .IsRequired() - .HasMaxLength(250) - .HasDefaultValueSql("('')") - .HasComment("Valore corrente / richiesto"); - - entity.HasOne(d => d.IdxStNavigation) - .WithMany(p => p.StActualRows) - .HasForeignKey(d => d.IdxSt) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_ST_ActualRows_ST_Actual"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CodGruppo); - - entity.ToTable("ST_AnagGruppi"); - - entity.Property(e => e.CodGruppo).HasMaxLength(50); - - entity.Property(e => e.CssClass) - .IsRequired() - .HasMaxLength(500) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.DescGruppo) - .IsRequired() - .HasMaxLength(250) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.OrdVisual).HasDefaultValueSql("((1))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CodTipo); - - entity.ToTable("ST_AnagTipi"); - - entity.Property(e => e.CodTipo).HasMaxLength(50); - - entity.Property(e => e.DescTipo) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.DtEvent, e.IdxOdl, e.IdxSt, e.Num, e.Oggetto }); - - entity.ToTable("ST_Check"); - - entity.Property(e => e.DtEvent).HasColumnType("datetime"); - - entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); - - entity.Property(e => e.IdxSt).HasColumnName("IdxST"); - - entity.Property(e => e.Oggetto) - .HasDefaultValueSql("((1))") - .HasComment("Oggetto - Nel caso vi siano più istanze dello stesso oggetto (es. materia prima, Imballo ecc. )"); - - entity.Property(e => e.CheckOk).HasComment("Indica controllo superato"); - - entity.Property(e => e.DtMod) - .HasColumnType("datetime") - .HasDefaultValueSql("('')") - .HasComment("Data Modifica"); - - entity.Property(e => e.ExtCode) - .IsRequired() - .HasDefaultValueSql("('')") - .HasComment("Codice riferimento esterno RECUPERATO con operazione check"); - - entity.Property(e => e.Forced).HasComment("Indica controllo superato"); - - entity.Property(e => e.UserMod) - .IsRequired() - .HasMaxLength(250) - .HasDefaultValueSql("('')") - .HasComment("Utente modifica"); - - entity.Property(e => e.ValueRead) - .IsRequired() - .HasMaxLength(250) - .HasDefaultValueSql("('')") - .HasComment("Valore letto, associato al controllo richiesto e salvato insieme al valore ext che può essere identico o diverso come x lotto (ValueRead) --> articolo (ExtCode)"); - - entity.HasOne(d => d.IdxOdlNavigation) - .WithMany(p => p.StChecks) - .HasForeignKey(d => d.IdxOdl) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_ST_Check_ODL"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CodTempl); - - entity.ToTable("ST_Template"); - - entity.Property(e => e.CodTempl).HasMaxLength(50); - - entity.Property(e => e.DescTempl) - .IsRequired() - .HasMaxLength(250) - .HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.CodTempl, e.Num }); - - entity.ToTable("ST_TemplateRows"); - - entity.Property(e => e.CodTempl).HasMaxLength(50); - - entity.Property(e => e.Num).HasComment("Numero progressivo campo / ordinamento"); - - entity.Property(e => e.CheckType) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('NA')") - .HasComment("Tipo di verifica: NA (nessuna), EQ (uguaglianza), BATCH (lotto articolo), ..."); - - entity.Property(e => e.CodGruppo) - .IsRequired() - .HasMaxLength(50) - .HasComment("Gruppo x visualizzazione a blocchi"); - - entity.Property(e => e.CodTipo) - .IsRequired() - .HasMaxLength(50) - .HasComment("Tipo di informazione"); - - entity.Property(e => e.Label) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')") - .HasComment("Etichetta Campo (da tradurre)"); - - entity.Property(e => e.Note) - .IsRequired() - .HasMaxLength(500) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.Required).HasComment("Se obbligatorio registrarlo in fase di setup oppure solo a titolo informativo (es imballo)"); - - entity.Property(e => e.Value) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')") - .HasComment("Valore DEFAULT"); - - entity.HasOne(d => d.CodGruppoNavigation) - .WithMany(p => p.StTemplateRows) - .HasForeignKey(d => d.CodGruppo) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_ST_TemplateRows_ST_AnagGruppi"); - - entity.HasOne(d => d.CodTemplNavigation) - .WithMany(p => p.StTemplateRows) - .HasForeignKey(d => d.CodTempl) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_ST_TemplateRows_ST_Template"); - - entity.HasOne(d => d.CodTipoNavigation) - .WithMany(p => p.StTemplateRows) - .HasForeignKey(d => d.CodTipo) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_ST_TemplateRows_ST_AnagTipi1"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ST_TemplateRows_bck"); - - entity.Property(e => e.CheckType) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CodGruppo) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CodTempl) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CodTipo) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Label) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Note) - .IsRequired() - .HasMaxLength(500); - - entity.Property(e => e.Value) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxMacchina) - .HasName("PK_StatoMacchine_1"); - - entity.ToTable("StatoMacchine"); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.CodArticolo) - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - - entity.Property(e => e.InizioStato).HasColumnType("datetime"); - - entity.Property(e => e.Pallet) - .HasMaxLength(20) - .HasColumnName("pallet"); - - entity.Property(e => e.Value).HasMaxLength(50); - - entity.HasOne(d => d.IdxMacchinaNavigation) - .WithOne(p => p.StatoMacchine) - .HasForeignKey(d => d.IdxMacchina) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_StatoMacchine_Macchine"); - - entity.HasOne(d => d.IdxStatoNavigation) - .WithMany(p => p.StatoMacchines) - .HasForeignKey(d => d.IdxStato) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_StatoMacchine_AnagraficaStati"); - - entity.HasOne(d => d.MatrOprNavigation) - .WithMany(p => p.StatoMacchines) - .HasForeignKey(d => d.MatrOpr) - .HasConstraintName("FK_StatoMacchine_AnagraficaOperatori"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxEv); - - entity.ToTable("StatoMacchineStorico"); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - entity.Property(e => e.DataEv).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 => e.IdxRoule); - - entity.ToTable("TabRegexpIngressi"); - - entity.Property(e => e.IdxRoule).ValueGeneratedNever(); - - entity.Property(e => e.Livello).HasComment("livello se maggiore sovrascrive i livelli + bassi"); - - entity.Property(e => e.NextIdxMicroStato).HasColumnName("next_IdxMicroStato"); - - entity.Property(e => e.RegexpInput) - .IsRequired() - .HasMaxLength(8) - .IsUnicode(false); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.N); - - entity.ToTable("TallyTable"); - - entity.Property(e => e.N) - .ValueGeneratedNever() - .HasColumnName("n"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.DataOraRif, e.IdxMacchina, e.CodArticolo }); - - entity.ToTable("TempiCicloRilevati"); - - entity.HasIndex(e => new { e.IdxMacchina, e.DataOraRif }, "ix_TempiCicloRilevati_IdxMacchinaDataOraRif") - .HasFillFactor((byte)95); - - entity.Property(e => e.DataOraRif).HasColumnType("datetime"); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - entity.Property(e => e.PzProd).HasDefaultValueSql("((1))"); - - entity.Property(e => e.Tcmedio) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCMedio") - .HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.IdxMacchinaNavigation) - .WithMany(p => p.TempiCicloRilevatis) - .HasForeignKey(d => d.IdxMacchina) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_TempiCicloRilevati_Macchine"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.IdxMacchina, e.CodArticolo, e.DataOraFrom }); - - entity.ToTable("TempiCicloTeorici"); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - entity.Property(e => e.DataOraFrom).HasColumnType("datetime"); - - entity.Property(e => e.DataOraTo).HasColumnType("datetime"); - - entity.Property(e => e.Tcassegnato) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCAssegnato") - .HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.IdxMacchinaNavigation) - .WithMany(p => p.TempiCicloTeoricis) - .HasForeignKey(d => d.IdxMacchina) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_TempiCicloTeorici_Macchine"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.IdxFamigliaIngresso, e.IdxMicroStato, e.ValoreIngresso }); - - entity.ToTable("TransizioneIngressi"); - - entity.Property(e => e.NextIdxMicroStato).HasColumnName("next_IdxMicroStato"); - - entity.HasOne(d => d.IdxFamigliaIngressoNavigation) - .WithMany(p => p.TransizioneIngressis) - .HasForeignKey(d => d.IdxFamigliaIngresso) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_TransizioneIngressi_FamigliaTipoIngressi"); - - entity.HasOne(d => d.IdxTipoEventoNavigation) - .WithMany(p => p.TransizioneIngressis) - .HasForeignKey(d => d.IdxTipoEvento) - .HasConstraintName("FK_TransizioneIngressi_AnagraficaEventi"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("TransizioneIngressiNew"); - - entity.Property(e => e.NextIdxMicroStato).HasColumnName("next_IdxMicroStato"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.IdxFamiglia, e.IdxStato, e.IdxTipo }); - - entity.ToTable("TransizioneStati"); - - entity.Property(e => e.NextIdxStato).HasColumnName("next_IdxStato"); - - entity.HasOne(d => d.IdxFamigliaNavigation) - .WithMany(p => p.TransizioneStatis) - .HasForeignKey(d => d.IdxFamiglia) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_TransizioneStati_FamiglieMacchine"); - - entity.HasOne(d => d.IdxStatoNavigation) - .WithMany(p => p.TransizioneStatis) - .HasForeignKey(d => d.IdxStato) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_TransizioneStati_AnagraficaStati"); - - entity.HasOne(d => d.IdxTipoNavigation) - .WithMany(p => p.TransizioneStatis) - .HasForeignKey(d => d.IdxTipo) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_TransizioneStati_AnagraficaEventi"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("TransizioneStatiOLD"); - - entity.Property(e => e.NextIdxStato).HasColumnName("next_IdxStato"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IdxMacchina); - - entity.ToTable("TurniMacchina"); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - }); - modelBuilder.Entity(entity => { entity.HasKey(e => e.AppName) @@ -2339,1128 +518,6 @@ namespace MP.AppAuth .HasDefaultValueSql("('')"); }); - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_Anomalie"); - - entity.Property(e => e.ClasseTempo).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.Semaforo).HasMaxLength(50); - - entity.Property(e => e.Value).HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_AS400_BufferProdAs400", "export"); - - entity.Property(e => e.CodArticolo) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CommessaAs400) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.DataRif) - .HasMaxLength(10) - .IsUnicode(false) - .IsFixedLength(true); - - entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_DatiConfermati", "export"); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - entity.Property(e => e.DataOraApp).HasColumnType("datetime"); - - entity.Property(e => e.DataOraFrom).HasColumnType("datetime"); - - entity.Property(e => e.DataOraTo).HasColumnType("datetime"); - - entity.Property(e => e.DataRif).HasColumnType("datetime"); - - entity.Property(e => e.IdxConferma).ValueGeneratedOnAdd(); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); - - entity.Property(e => e.Tcassegnato) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCAssegnato"); - - entity.Property(e => e.TempoApertura).HasColumnType("decimal(18, 8)"); - - entity.Property(e => e.TempoAuto).HasColumnType("decimal(18, 8)"); - - entity.Property(e => e.TempoCron).HasColumnType("decimal(18, 8)"); - - entity.Property(e => e.TempoFermoAuto).HasColumnType("decimal(18, 8)"); - - entity.Property(e => e.TempoFermoOn).HasColumnType("decimal(18, 8)"); - - entity.Property(e => e.TempoNd) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TempoND"); - - entity.Property(e => e.TempoOff) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TempoOFF"); - - entity.Property(e => e.TempoOn) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TempoON"); - - entity.Property(e => e.TempoProdotto).HasColumnType("decimal(18, 8)"); - - entity.Property(e => e.TempoRun).HasColumnType("decimal(18, 8)"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_DatiMacchina_exp"); - - entity.Property(e => e.CodArticoloA) - .HasMaxLength(50) - .HasColumnName("CodArticolo_A"); - - entity.Property(e => e.CodArticoloB) - .HasMaxLength(50) - .HasColumnName("CodArticolo_B"); - - entity.Property(e => e.DescFull).HasMaxLength(153); - - entity.Property(e => e.HasCounter).HasColumnName("hasCounter"); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("idxMacchina"); - - entity.Property(e => e.PalletChange).HasColumnName("palletChange"); - - entity.Property(e => e.RefreshPeriod).HasColumnName("refreshPeriod"); - - entity.Property(e => e.SerialPort) - .HasMaxLength(50) - .HasColumnName("serialPort"); - - entity.Property(e => e.Simulazione).HasColumnName("simulazione"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_ECP"); - - entity.Property(e => e.CognomeNomeOpr).HasMaxLength(101); - - 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_Eventi_To_StatiMacchina", "man"); - - entity.Property(e => e.Azione).HasMaxLength(50); - - entity.Property(e => e.CodArtFine).HasMaxLength(50); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - entity.Property(e => e.DescStatoFine).HasMaxLength(50); - - entity.Property(e => e.DescStatoIniziale).HasMaxLength(50); - - entity.Property(e => e.FineStato).HasColumnType("datetime"); - - entity.Property(e => e.FineStatoPrec).HasColumnType("datetime"); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.IdxStatoFine).HasColumnName("idxStatoFine"); - - entity.Property(e => e.InizioEvento).HasColumnType("datetime"); - - entity.Property(e => e.InizioStatoPrec).HasColumnType("datetime"); - - entity.Property(e => e.NomeEvento).HasMaxLength(50); - - entity.Property(e => e.Pallet) - .HasMaxLength(20) - .HasColumnName("pallet"); - - entity.Property(e => e.TabAzione).HasMaxLength(50); - - entity.Property(e => e.Value).HasMaxLength(250); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_Ingressi_To_Eventi", "man"); - - entity.Property(e => e.Azione).HasMaxLength(50); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - entity.Property(e => e.Contatore).HasColumnName("contatore"); - - entity.Property(e => e.DtCurr) - .HasColumnType("datetime") - .HasColumnName("dtCurr"); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.IdxMsg).HasColumnName("idxMsg"); - - entity.Property(e => e.InizioEvento).HasColumnType("datetime"); - - entity.Property(e => e.Nome).HasMaxLength(50); - - entity.Property(e => e.TabAzione).HasMaxLength(50); - - entity.Property(e => e.Valore) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("valore"); - - entity.Property(e => e.Value).HasMaxLength(250); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_Macchina_To_TransizioneStati", "man"); - - entity.Property(e => e.CodMacchina).HasMaxLength(50); - - entity.Property(e => e.DescNext).HasMaxLength(50); - - entity.Property(e => e.Descrizione).HasMaxLength(50); - - entity.Property(e => e.Evento).HasMaxLength(50); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.NextIdxStato).HasColumnName("next_IdxStato"); - - entity.Property(e => e.Nome).HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_MacchineFull", "man"); - - entity.Property(e => e.Bsr).HasColumnName("BSR"); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - entity.Property(e => e.CodArticoloA) - .HasMaxLength(50) - .HasColumnName("CodArticolo_A"); - - entity.Property(e => e.CodArticoloB) - .HasMaxLength(50) - .HasColumnName("CodArticolo_B"); - - entity.Property(e => e.CodMacchina).HasMaxLength(50); - - entity.Property(e => e.DataInizioOdl) - .HasColumnType("datetime") - .HasColumnName("DataInizioODL"); - - entity.Property(e => e.DataUltimaConf).HasColumnType("datetime"); - - entity.Property(e => e.Descrizione).HasMaxLength(50); - - entity.Property(e => e.HasCounter).HasColumnName("hasCounter"); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); - - entity.Property(e => e.InizioStato).HasColumnType("datetime"); - - entity.Property(e => e.InizioStatoMicro).HasColumnType("datetime"); - - entity.Property(e => e.InsEnabled).HasColumnName("insEnabled"); - - entity.Property(e => e.IsTrigerDbon).HasColumnName("isTrigerDBOn"); - - entity.Property(e => e.KeyRichiesta).HasMaxLength(50); - - entity.Property(e => e.Locazione) - .HasMaxLength(50) - .HasColumnName("locazione"); - - entity.Property(e => e.Nome).HasMaxLength(50); - - entity.Property(e => e.Note).HasMaxLength(50); - - entity.Property(e => e.Pallet) - .HasMaxLength(20) - .HasColumnName("pallet"); - - entity.Property(e => e.PalletChange).HasColumnName("palletChange"); - - entity.Property(e => e.RefreshPeriod).HasColumnName("refreshPeriod"); - - entity.Property(e => e.SLogEnabled).HasColumnName("sLogEnabled"); - - entity.Property(e => e.SerialPort) - .HasMaxLength(50) - .HasColumnName("serialPort"); - - entity.Property(e => e.SimplePallet).HasColumnName("simplePallet"); - - entity.Property(e => e.Simulazione).HasColumnName("simulazione"); - - entity.Property(e => e.TestMicroStato) - .IsRequired() - .HasMaxLength(5) - .IsUnicode(false); - - entity.Property(e => e.Url) - .HasMaxLength(250) - .HasColumnName("url"); - - entity.Property(e => e.ValueMicroStato).HasMaxLength(50); - - entity.Property(e => e.ValueStato).HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_MacchineGruppoFase"); - - entity.Property(e => e.CodGruppo).HasMaxLength(50); - - entity.Property(e => e.CodMacchina).HasMaxLength(50); - - entity.Property(e => e.DescrGruppo).HasMaxLength(250); - - entity.Property(e => e.Descrizione).HasMaxLength(50); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Locazione) - .HasMaxLength(50) - .HasColumnName("locazione"); - - entity.Property(e => e.Nome).HasMaxLength(50); - - entity.Property(e => e.Note).HasMaxLength(50); - - entity.Property(e => e.TipoGruppo).HasMaxLength(50); - - entity.Property(e => e.Url) - .HasMaxLength(250) - .HasColumnName("url"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_MSFD"); - - entity.Property(e => e.Bsr).HasColumnName("BSR"); - - entity.Property(e => e.CodArticolo) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CodArticoloA) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("CodArticolo_A"); - - entity.Property(e => e.CodArticoloB) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("CodArticolo_B"); - - entity.Property(e => e.CodMaccArticolo) - .IsRequired() - .HasMaxLength(103); - - entity.Property(e => e.Codmacchina) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("codmacchina"); - - entity.Property(e => e.Idxmacchina) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("idxmacchina"); - - entity.Property(e => e.InsEnabled).HasColumnName("insEnabled"); - - entity.Property(e => e.LastVal) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("lastVal"); - - entity.Property(e => e.Pallet) - .IsRequired() - .HasMaxLength(20) - .HasColumnName("pallet"); - - entity.Property(e => e.PalletChange).HasColumnName("palletChange"); - - entity.Property(e => e.SLogEnabled).HasColumnName("sLogEnabled"); - - entity.Property(e => e.SimplePallet).HasColumnName("simplePallet"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_ODL_exp"); - - entity.Property(e => e.CodArticolo) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CodMacchina) - .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.DescArticolo) - .IsRequired() - .HasMaxLength(250); - - 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.Nome).HasMaxLength(50); - - entity.Property(e => e.Note).HasMaxLength(2500); - - entity.Property(e => e.OperSetup).HasMaxLength(101); - - 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) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_ODL_exp_bck"); - - entity.Property(e => e.CodArticolo) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CodMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.DataFine).HasColumnType("datetime"); - - entity.Property(e => e.DataInizio).HasColumnType("datetime"); - - entity.Property(e => e.DescArticolo) - .IsRequired() - .HasMaxLength(250); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); - - entity.Property(e => e.Nome).HasMaxLength(50); - - entity.Property(e => e.Tcassegnato) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCAssegnato"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_OperatoriGruppiMacchine", "man"); - - entity.Property(e => e.CodGruppo).HasMaxLength(50); - - entity.Property(e => e.CodMacchina).HasMaxLength(50); - - entity.Property(e => e.CodOprExt) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Cognome).HasMaxLength(50); - - entity.Property(e => e.Descrizione).HasMaxLength(50); - - entity.Property(e => e.IdxMacchina).HasMaxLength(50); - - entity.Property(e => e.Nome).HasMaxLength(50); - - entity.Property(e => e.NomeMacc).HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_PODL_exp"); - - 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.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.Note) - .IsRequired() - .HasMaxLength(2500); - - entity.Property(e => e.Tcassegnato) - .HasColumnType("decimal(18, 8)") - .HasColumnName("TCAssegnato"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_RegistroControlli"); - - 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); - - entity.Property(e => e.Operatore) - .IsRequired() - .HasMaxLength(101); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_RegistroScarti"); - - entity.Property(e => e.Causale) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CodArticolo) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CssClass) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("cssClass"); - - 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.Icona) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("icona"); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Note) - .IsRequired() - .HasMaxLength(250); - - entity.Property(e => e.Operatore) - .IsRequired() - .HasMaxLength(101); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_riepilogoDati"); - - entity.Property(e => e.CodMacchina).HasMaxLength(50); - - entity.Property(e => e.Descrizione).HasMaxLength(50); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Nome).HasMaxLength(50); - - entity.Property(e => e.NumEventi).HasColumnName("numEventi"); - - entity.Property(e => e.NumStati).HasColumnName("numStati"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_riepilogoEventi"); - - entity.Property(e => e.CodMacchina).HasMaxLength(50); - - entity.Property(e => e.Descrizione).HasMaxLength(50); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Nome).HasMaxLength(50); - - entity.Property(e => e.NumEventi).HasColumnName("numEventi"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_riepilogoStati"); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.NumStati).HasColumnName("numStati"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_selArticoli"); - - entity.Property(e => e.Label) - .HasMaxLength(356) - .HasColumnName("label"); - - entity.Property(e => e.Value) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("value"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_selCauScarto"); - - entity.Property(e => e.CssClass) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("cssClass"); - - entity.Property(e => e.Icona) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("icona"); - - entity.Property(e => e.Label) - .IsRequired() - .HasMaxLength(250) - .HasColumnName("label"); - - entity.Property(e => e.Value) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("value"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_selEventiBCode"); - - entity.Property(e => e.Label) - .HasMaxLength(4000) - .HasColumnName("label"); - - entity.Property(e => e.Value).HasColumnName("value"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_selGruppi"); - - entity.Property(e => e.Conditio) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("conditio"); - - entity.Property(e => e.Label) - .IsRequired() - .HasMaxLength(250) - .HasColumnName("label"); - - entity.Property(e => e.Value) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("value"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_selKanban"); - - entity.Property(e => e.Label) - .IsRequired() - .HasMaxLength(52) - .HasColumnName("label"); - - entity.Property(e => e.Value) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("value"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_selListVal"); - - entity.Property(e => e.Label) - .HasMaxLength(50) - .HasColumnName("label"); - - entity.Property(e => e.Value) - .IsRequired() - .HasMaxLength(152) - .HasColumnName("value"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_selMacchine"); - - entity.Property(e => e.Label) - .HasMaxLength(50) - .HasColumnName("label"); - - entity.Property(e => e.Value) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("value"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_selODL"); - - entity.Property(e => e.Conditio) - .HasColumnType("datetime") - .HasColumnName("conditio"); - - entity.Property(e => e.Label) - .HasMaxLength(482) - .HasColumnName("label"); - - entity.Property(e => e.Value).HasColumnName("value"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_selOperatori"); - - entity.Property(e => e.Label) - .HasMaxLength(101) - .HasColumnName("label"); - - entity.Property(e => e.Value).HasColumnName("value"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_selTally"); - - entity.Property(e => e.Label).HasColumnName("label"); - - entity.Property(e => e.Value).HasColumnName("value"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_ST_Actual"); - - entity.Property(e => e.CodArticolo) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CodTempl) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.DescArticolo) - .IsRequired() - .HasMaxLength(250); - - entity.Property(e => e.DescTempl) - .IsRequired() - .HasMaxLength(250); - - entity.Property(e => e.DtMod).HasColumnType("datetime"); - - entity.Property(e => e.IdxSt).HasColumnName("IdxST"); - - entity.Property(e => e.UserLogin) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_ST_AR"); - - entity.Property(e => e.CheckType) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CodGruppo) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CodTipo) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.DescGruppo) - .IsRequired() - .HasMaxLength(250); - - entity.Property(e => e.DescTipo) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.ExtCode).IsRequired(); - - entity.Property(e => e.IdxSt).HasColumnName("IdxST"); - - entity.Property(e => e.Label) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Note) - .IsRequired() - .HasMaxLength(500); - - entity.Property(e => e.Value) - .IsRequired() - .HasMaxLength(250); - - entity.Property(e => e.ValueRead) - .IsRequired() - .HasMaxLength(1) - .IsUnicode(false); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_ST_AR_count"); - - entity.Property(e => e.IdxSt).HasColumnName("IdxST"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_StatiMacchina_From_Eventi", "man"); - - entity.Property(e => e.Azione).HasMaxLength(50); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - entity.Property(e => e.DescStatoFine).HasMaxLength(50); - - entity.Property(e => e.DescStatoIniziale).HasMaxLength(50); - - entity.Property(e => e.FineStato).HasColumnType("datetime"); - - entity.Property(e => e.IdxMacchina) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.IdxStatoFine).HasColumnName("idxStatoFine"); - - entity.Property(e => e.InizioEvento).HasColumnType("datetime"); - - entity.Property(e => e.InizioStato).HasColumnType("datetime"); - - entity.Property(e => e.NomeEvento).HasMaxLength(50); - - entity.Property(e => e.Pallet) - .HasMaxLength(20) - .HasColumnName("pallet"); - - entity.Property(e => e.TabAzione).HasMaxLength(50); - - entity.Property(e => e.Value).HasMaxLength(250); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_TempiProduzione", "export"); - - entity.Property(e => e.Articolo).HasMaxLength(50); - - entity.Property(e => e.Causale).HasMaxLength(50); - - entity.Property(e => e.CommessaAs400) - .IsRequired() - .HasMaxLength(50) - .HasColumnName("commessaAS400"); - - entity.Property(e => e.Data).HasColumnType("datetime"); - - entity.Property(e => e.Macchina).HasMaxLength(50); - - entity.Property(e => e.Stato) - .IsRequired() - .HasMaxLength(11) - .IsUnicode(false); - - entity.Property(e => e.Tempo).HasColumnType("decimal(38, 8)"); - - entity.Property(e => e.TempoCiclo).HasColumnType("decimal(18, 8)"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_TestErroriEventListLog", "man"); - - entity.Property(e => e.CodArticolo).HasMaxLength(50); - - 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.TipoErrore) - .IsRequired() - .HasMaxLength(21) - .IsUnicode(false); - - entity.Property(e => e.Value).HasMaxLength(250); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("v_TransizioneStati_Full", "man"); - - entity.Property(e => e.DescNext).HasMaxLength(50); - - entity.Property(e => e.DescrFamiglia).HasMaxLength(250); - - entity.Property(e => e.Descrizione).HasMaxLength(50); - - entity.Property(e => e.Evento).HasMaxLength(50); - - entity.Property(e => e.NextIdxStato).HasColumnName("next_IdxStato"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.Lingua, e.Lemma }); - - entity.ToTable("Vocabolario"); - - entity.Property(e => e.Lingua).HasMaxLength(3); - - entity.Property(e => e.Lemma).HasMaxLength(50); - - entity.Property(e => e.Traduzione) - .IsRequired() - .HasMaxLength(500); - - entity.HasOne(d => d.LinguaNavigation) - .WithMany(p => p.Vocabolarios) - .HasForeignKey(d => d.Lingua) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Vocabolario_Lingue"); - }); - OnModelCreatingPartial(modelBuilder); } diff --git a/MP.Land/Data/AppAuthService.cs b/MP.Land/Data/AppAuthService.cs new file mode 100644 index 00000000..a19cd2f4 --- /dev/null +++ b/MP.Land/Data/AppAuthService.cs @@ -0,0 +1,101 @@ +using Microsoft.Extensions.Configuration; +using System; +using Microsoft.Extensions.Logging; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using NLog; +using Microsoft.Extensions.Caching.Distributed; +using Microsoft.Extensions.Caching.Memory; + +namespace MP.Land.Data +{ + public class AppAuthService : IDisposable + { + #region Private Fields + + private static IConfiguration _configuration; + + private static ILogger _logger; + + private static List ElencoMacchine = new List(); + + private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); + + private readonly IDistributedCache distributedCache; + + private readonly IMemoryCache memoryCache; + + /// + /// Durata assoluta massima della cache + /// + private int chAbsExp = 15; + + /// + /// Durata della cache in modalità inattiva (non acceduta) prima di venire rimossa + /// NON estende oltre il tempo massimo di validità della cache (chAbsExp) + /// + private int chSliExp = 5; + + #endregion Private Fields + + #region Public Fields + + public static AppAuth.Controllers.AppAuthController dbController; + + #endregion Public Fields + + #region Public Constructors + + public AppAuthService(IConfiguration configuration, ILogger logger, IMemoryCache memoryCache, IDistributedCache distributedCache) + { + _logger = logger; + _configuration = configuration; + // conf cache + this.memoryCache = memoryCache; + this.distributedCache = distributedCache; + // conf DB + string connStr = _configuration.GetConnectionString("MP.Land"); + if (string.IsNullOrEmpty(connStr)) + { + _logger.LogError("ConnString empty!"); + } + else + { + dbController = new AppAuth.Controllers.AppAuthController(configuration); + _logger.LogInformation("DbController OK"); + } + } + + #endregion Public Constructors + + #region Private Properties + + private DistributedCacheEntryOptions cacheOpt + { + get + { + return new DistributedCacheEntryOptions().SetAbsoluteExpiration(DateTime.Now.AddMinutes(chAbsExp)).SetSlidingExpiration(TimeSpan.FromMinutes(chSliExp)); + } + } + + private DistributedCacheEntryOptions cacheOptLong + { + get + { + return new DistributedCacheEntryOptions().SetAbsoluteExpiration(DateTime.Now.AddMinutes(chAbsExp * 10)).SetSlidingExpiration(TimeSpan.FromMinutes(chSliExp)); + } + } + + #endregion Private Properties + + #region Public Methods + + public void Dispose() + { + throw new NotImplementedException(); + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/MP.Land/MP.Land.csproj b/MP.Land/MP.Land.csproj index edb2180d..90b21d96 100644 --- a/MP.Land/MP.Land.csproj +++ b/MP.Land/MP.Land.csproj @@ -1,33 +1,47 @@ - - net5.0 - MP.Land - 1.1.2109.1719 - + + net5.0 + MP.Land + 1.1.2109.1810 + - - - + + + + + + + + - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + + + + + + - - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + - - - + + + + + + + diff --git a/MP.Land/Resources/ChangeLog.html b/MP.Land/Resources/ChangeLog.html index a597a8c6..455d59bd 100644 --- a/MP.Land/Resources/ChangeLog.html +++ b/MP.Land/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo gestione Programmi MAPO -

Versione: 1.1.2109.1719

+

Versione: 1.1.2109.1810


Note di rilascio:
    diff --git a/MP.Land/Resources/VersNum.txt b/MP.Land/Resources/VersNum.txt index 7a4c0a72..a54e885c 100644 --- a/MP.Land/Resources/VersNum.txt +++ b/MP.Land/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2109.1719 +1.1.2109.1810 diff --git a/MP.Land/Resources/manifest.xml b/MP.Land/Resources/manifest.xml index 4df1715b..dbae557a 100644 --- a/MP.Land/Resources/manifest.xml +++ b/MP.Land/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2109.1719 + 1.1.2109.1810 https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/MP.Land.zip https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/ChangeLog.html false diff --git a/MP.Land/Startup.cs b/MP.Land/Startup.cs index a67caa72..5bddf687 100644 --- a/MP.Land/Startup.cs +++ b/MP.Land/Startup.cs @@ -208,7 +208,7 @@ namespace MP.Land { //options.Configuration = "localhost:6379"; options.ConfigurationOptions = new StackExchange.Redis.ConfigurationOptions() { KeepAlive = 180, DefaultDatabase = 5, EndPoints = { { "localhost", 6379 } } }; - options.InstanceName = "MP:Prog"; + options.InstanceName = "MP:Land"; }); services.AddLocalization(); @@ -223,8 +223,8 @@ namespace MP.Land services.AddSingleton(Configuration); //services.AddTransient(); - //services.AddSingleton(); - services.AddScoped(); + //services.AddSingleton(); + services.AddScoped(); services.AddScoped(); }