From 1fc8d234f7f7baa88c2d1b444ab133bb5ff03064 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 15 May 2021 16:36:53 +0200 Subject: [PATCH 001/158] Inizio inserimento classi x EFCore --- MpDataLayer/Constants.cs | 12 ++++++++++++ MpDataLayer/{Class1.cs => Enums.cs} | 4 ++-- MpDataLayer/MpDataLayer.csproj | 11 +++++++++++ MpDataLayer/StatsDbContext.cs | 12 ++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 MpDataLayer/Constants.cs rename MpDataLayer/{Class1.cs => Enums.cs} (67%) create mode 100644 MpDataLayer/StatsDbContext.cs diff --git a/MpDataLayer/Constants.cs b/MpDataLayer/Constants.cs new file mode 100644 index 00000000..3c7f13d8 --- /dev/null +++ b/MpDataLayer/Constants.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MpDataLayer +{ + class Constants + { + } +} diff --git a/MpDataLayer/Class1.cs b/MpDataLayer/Enums.cs similarity index 67% rename from MpDataLayer/Class1.cs rename to MpDataLayer/Enums.cs index ef37b930..64437007 100644 --- a/MpDataLayer/Class1.cs +++ b/MpDataLayer/Enums.cs @@ -2,7 +2,7 @@ namespace MpDataLayer { - public class Class1 + public class Enums { } -} +} \ No newline at end of file diff --git a/MpDataLayer/MpDataLayer.csproj b/MpDataLayer/MpDataLayer.csproj index f208d303..3ec447d6 100644 --- a/MpDataLayer/MpDataLayer.csproj +++ b/MpDataLayer/MpDataLayer.csproj @@ -4,4 +4,15 @@ net5.0 + + + + + + + + + + + diff --git a/MpDataLayer/StatsDbContext.cs b/MpDataLayer/StatsDbContext.cs new file mode 100644 index 00000000..d897301c --- /dev/null +++ b/MpDataLayer/StatsDbContext.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MpDataLayer +{ + public class StatsDbContext + { + } +} \ No newline at end of file From 719aac18de85e2e34f8785b19ec174e68ecd95c0 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 15 May 2021 17:02:29 +0200 Subject: [PATCH 002/158] Modelli da scaffolding automatico (da rivedere) --- MpDataLayer/DatabaseModels/Aaul.cs | 13 + MpDataLayer/DatabaseModels/Cal.cs | 18 + MpDataLayer/DatabaseModels/Config.cs | 15 + MpDataLayer/DatabaseModels/Ddb.cs | 15 + MpDataLayer/DatabaseModels/Ddb1.cs | 24 + MpDataLayer/DatabaseModels/DdbTurni.cs | 30 + MpDataLayer/DatabaseModels/DdbTurniNew.cs | 30 + MpDataLayer/DatabaseModels/DdbTurniSummary.cs | 21 + .../DatabaseModels/DdbTurniSummaryNew.cs | 21 + MpDataLayer/DatabaseModels/Ecp.cs | 23 + MpDataLayer/DatabaseModels/Ecp1.cs | 21 + MpDataLayer/DatabaseModels/Kit.cs | 14 + .../DatabaseModels/MoonPro_STATSContext.cs | 1558 +++++++++++++++++ MpDataLayer/DatabaseModels/Odl.cs | 26 + MpDataLayer/DatabaseModels/Odl1.cs | 30 + MpDataLayer/DatabaseModels/R.cs | 23 + MpDataLayer/DatabaseModels/R1.cs | 22 + MpDataLayer/DatabaseModels/Rc.cs | 19 + MpDataLayer/DatabaseModels/Tally.cs | 12 + MpDataLayer/DatabaseModels/TcStat.cs | 16 + MpDataLayer/DatabaseModels/Tcr.cs | 19 + MpDataLayer/DatabaseModels/Tcr1.cs | 20 + MpDataLayer/DatabaseModels/TcrDay.cs | 19 + MpDataLayer/DatabaseModels/TcrDayTest.cs | 19 + MpDataLayer/DatabaseModels/TestJason.cs | 14 + MpDataLayer/DatabaseModels/Ul.cs | 21 + MpDataLayer/DatabaseModels/VDdb.cs | 24 + MpDataLayer/DatabaseModels/VDdbLight.cs | 18 + MpDataLayer/DatabaseModels/VDdbLightOld.cs | 18 + MpDataLayer/DatabaseModels/VDdbTurni.cs | 26 + MpDataLayer/DatabaseModels/VEcp.cs | 21 + MpDataLayer/DatabaseModels/VEcp1.cs | 25 + MpDataLayer/DatabaseModels/VEcpExtended.cs | 27 + MpDataLayer/DatabaseModels/VKit.cs | 14 + MpDataLayer/DatabaseModels/VOdl.cs | 30 + MpDataLayer/DatabaseModels/VOdl1.cs | 28 + MpDataLayer/DatabaseModels/VPodlNonChiusi.cs | 30 + MpDataLayer/DatabaseModels/VR.cs | 22 + MpDataLayer/DatabaseModels/VR1.cs | 23 + MpDataLayer/DatabaseModels/VRc.cs | 19 + MpDataLayer/DatabaseModels/VTcStat.cs | 18 + MpDataLayer/DatabaseModels/VTcr.cs | 20 + MpDataLayer/DatabaseModels/VTcr1.cs | 21 + MpDataLayer/DatabaseModels/VTcrDay.cs | 21 + MpDataLayer/DatabaseModels/VUl.cs | 21 + MpDataLayer/DatabaseModels/VetoTc.cs | 15 + MpDataLayer/MpDataLayer.csproj | 4 + 47 files changed, 2508 insertions(+) create mode 100644 MpDataLayer/DatabaseModels/Aaul.cs create mode 100644 MpDataLayer/DatabaseModels/Cal.cs create mode 100644 MpDataLayer/DatabaseModels/Config.cs create mode 100644 MpDataLayer/DatabaseModels/Ddb.cs create mode 100644 MpDataLayer/DatabaseModels/Ddb1.cs create mode 100644 MpDataLayer/DatabaseModels/DdbTurni.cs create mode 100644 MpDataLayer/DatabaseModels/DdbTurniNew.cs create mode 100644 MpDataLayer/DatabaseModels/DdbTurniSummary.cs create mode 100644 MpDataLayer/DatabaseModels/DdbTurniSummaryNew.cs create mode 100644 MpDataLayer/DatabaseModels/Ecp.cs create mode 100644 MpDataLayer/DatabaseModels/Ecp1.cs create mode 100644 MpDataLayer/DatabaseModels/Kit.cs create mode 100644 MpDataLayer/DatabaseModels/MoonPro_STATSContext.cs create mode 100644 MpDataLayer/DatabaseModels/Odl.cs create mode 100644 MpDataLayer/DatabaseModels/Odl1.cs create mode 100644 MpDataLayer/DatabaseModels/R.cs create mode 100644 MpDataLayer/DatabaseModels/R1.cs create mode 100644 MpDataLayer/DatabaseModels/Rc.cs create mode 100644 MpDataLayer/DatabaseModels/Tally.cs create mode 100644 MpDataLayer/DatabaseModels/TcStat.cs create mode 100644 MpDataLayer/DatabaseModels/Tcr.cs create mode 100644 MpDataLayer/DatabaseModels/Tcr1.cs create mode 100644 MpDataLayer/DatabaseModels/TcrDay.cs create mode 100644 MpDataLayer/DatabaseModels/TcrDayTest.cs create mode 100644 MpDataLayer/DatabaseModels/TestJason.cs create mode 100644 MpDataLayer/DatabaseModels/Ul.cs create mode 100644 MpDataLayer/DatabaseModels/VDdb.cs create mode 100644 MpDataLayer/DatabaseModels/VDdbLight.cs create mode 100644 MpDataLayer/DatabaseModels/VDdbLightOld.cs create mode 100644 MpDataLayer/DatabaseModels/VDdbTurni.cs create mode 100644 MpDataLayer/DatabaseModels/VEcp.cs create mode 100644 MpDataLayer/DatabaseModels/VEcp1.cs create mode 100644 MpDataLayer/DatabaseModels/VEcpExtended.cs create mode 100644 MpDataLayer/DatabaseModels/VKit.cs create mode 100644 MpDataLayer/DatabaseModels/VOdl.cs create mode 100644 MpDataLayer/DatabaseModels/VOdl1.cs create mode 100644 MpDataLayer/DatabaseModels/VPodlNonChiusi.cs create mode 100644 MpDataLayer/DatabaseModels/VR.cs create mode 100644 MpDataLayer/DatabaseModels/VR1.cs create mode 100644 MpDataLayer/DatabaseModels/VRc.cs create mode 100644 MpDataLayer/DatabaseModels/VTcStat.cs create mode 100644 MpDataLayer/DatabaseModels/VTcr.cs create mode 100644 MpDataLayer/DatabaseModels/VTcr1.cs create mode 100644 MpDataLayer/DatabaseModels/VTcrDay.cs create mode 100644 MpDataLayer/DatabaseModels/VUl.cs create mode 100644 MpDataLayer/DatabaseModels/VetoTc.cs diff --git a/MpDataLayer/DatabaseModels/Aaul.cs b/MpDataLayer/DatabaseModels/Aaul.cs new file mode 100644 index 00000000..9394d319 --- /dev/null +++ b/MpDataLayer/DatabaseModels/Aaul.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Aaul + { + public string Azione { get; set; } + public string Descrizione { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/Cal.cs b/MpDataLayer/DatabaseModels/Cal.cs new file mode 100644 index 00000000..9db20b85 --- /dev/null +++ b/MpDataLayer/DatabaseModels/Cal.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Cal + { + public DateTime Giorno { get; set; } + public bool? DoDdb { get; set; } + public bool? DoTcr { get; set; } + public bool? DoUl { get; set; } + public bool? DoEcp { get; set; } + public bool? DoRs { get; set; } + public bool? DoOdl { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/Config.cs b/MpDataLayer/DatabaseModels/Config.cs new file mode 100644 index 00000000..e0dad34d --- /dev/null +++ b/MpDataLayer/DatabaseModels/Config.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Config + { + public string Chiave { get; set; } + public string Valore { get; set; } + public string ValoreStd { get; set; } + public string Note { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/Ddb.cs b/MpDataLayer/DatabaseModels/Ddb.cs new file mode 100644 index 00000000..1f213127 --- /dev/null +++ b/MpDataLayer/DatabaseModels/Ddb.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Ddb + { + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public int IdxStato { get; set; } + public decimal DurataMinuti { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/Ddb1.cs b/MpDataLayer/DatabaseModels/Ddb1.cs new file mode 100644 index 00000000..33efad5a --- /dev/null +++ b/MpDataLayer/DatabaseModels/Ddb1.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Ddb1 + { + public string IdxMacchina { get; set; } + public DateTime InizioStato { get; set; } + public DateTime? FineStato { get; set; } + public int IdxStato { get; set; } + public double? DurataMinuti { get; set; } + public string Value { get; set; } + public string CodArticolo { get; set; } + public double? TempoCicloBase { get; set; } + public int? PzPalletProd { get; set; } + public int? MatrOpr { get; set; } + public string Pallet { get; set; } + public string Descrizione { get; set; } + public string ClasseTempo { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/DdbTurni.cs b/MpDataLayer/DatabaseModels/DdbTurni.cs new file mode 100644 index 00000000..c6ad5ea1 --- /dev/null +++ b/MpDataLayer/DatabaseModels/DdbTurni.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class DdbTurni + { + public DateTime DataRif { get; set; } + public string IdxMacchina { get; set; } + public string Turno { get; set; } + public int IdxStato { get; set; } + public string CodArticolo { get; set; } + public DateTime InizioStato { get; set; } + public DateTime FineStato { get; set; } + public string Pallet { get; set; } + public int? PzPalletProd { get; set; } + public decimal? TempoCicloBase { get; set; } + public string Descrizione { get; set; } + public string ClasseTempo { get; set; } + public DateTime? DataTurnoInizio { get; set; } + public DateTime? DataTurnoFine { get; set; } + public long? DurataStato { get; set; } + public DateTime InizioPeriodo { get; set; } + public DateTime? FinePeriodo { get; set; } + public long? DurataPeriodo { get; set; } + public int TotPzProd { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/DdbTurniNew.cs b/MpDataLayer/DatabaseModels/DdbTurniNew.cs new file mode 100644 index 00000000..c8699f0f --- /dev/null +++ b/MpDataLayer/DatabaseModels/DdbTurniNew.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class DdbTurniNew + { + public DateTime DataRif { get; set; } + public string IdxMacchina { get; set; } + public string Turno { get; set; } + public int IdxStato { get; set; } + public string CodArticolo { get; set; } + public DateTime InizioStato { get; set; } + public DateTime FineStato { get; set; } + public string Pallet { get; set; } + public int? PzPalletProd { get; set; } + public decimal? TempoCicloBase { get; set; } + public string Descrizione { get; set; } + public string ClasseTempo { get; set; } + public DateTime? DataTurnoInizio { get; set; } + public DateTime? DataTurnoFine { get; set; } + public long? DurataStato { get; set; } + public DateTime InizioPeriodo { get; set; } + public DateTime? FinePeriodo { get; set; } + public long? DurataPeriodo { get; set; } + public int TotPzProd { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/DdbTurniSummary.cs b/MpDataLayer/DatabaseModels/DdbTurniSummary.cs new file mode 100644 index 00000000..2760ca5a --- /dev/null +++ b/MpDataLayer/DatabaseModels/DdbTurniSummary.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class DdbTurniSummary + { + public string IdxMacchina { get; set; } + public DateTime DataRif { get; set; } + public string Turno { get; set; } + public string CodArticolo { get; set; } + public int IdxStato { get; set; } + public decimal TempoCicloBase { get; set; } + public DateTime? Inizio { get; set; } + public int PzPalletProd { get; set; } + public decimal? Durata { get; set; } + public int? PzProd { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/DdbTurniSummaryNew.cs b/MpDataLayer/DatabaseModels/DdbTurniSummaryNew.cs new file mode 100644 index 00000000..1f0bfe4f --- /dev/null +++ b/MpDataLayer/DatabaseModels/DdbTurniSummaryNew.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class DdbTurniSummaryNew + { + public string IdxMacchina { get; set; } + public DateTime DataRif { get; set; } + public string Turno { get; set; } + public string CodArticolo { get; set; } + public int IdxStato { get; set; } + public decimal TempoCicloBase { get; set; } + public DateTime? Inizio { get; set; } + public int PzPalletProd { get; set; } + public decimal? Durata { get; set; } + public int? PzProd { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/Ecp.cs b/MpDataLayer/DatabaseModels/Ecp.cs new file mode 100644 index 00000000..2e003e85 --- /dev/null +++ b/MpDataLayer/DatabaseModels/Ecp.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Ecp + { + public int IdxEcp { get; set; } + public DateTime DataOraConf { get; set; } + public string IdxMacchina { get; set; } + public string KeyRichiesta { get; set; } + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public int PezziConf { get; set; } + public int PezziScar { get; set; } + public int PezziDaRilav { get; set; } + public int MatrOpr { get; set; } + public string Cognome { get; set; } + public string Nome { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/Ecp1.cs b/MpDataLayer/DatabaseModels/Ecp1.cs new file mode 100644 index 00000000..a6e1b626 --- /dev/null +++ b/MpDataLayer/DatabaseModels/Ecp1.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Ecp1 + { + public DateTime DataOraConf { get; set; } + public string IdxMacchina { get; set; } + public int MatrApp { get; set; } + public DateTime DataFrom { get; set; } + public DateTime DataTo { get; set; } + public int PezziConf { get; set; } + public int PezziScar { get; set; } + public int PezziDaRilav { get; set; } + public string CommessaEsterna { get; set; } + public int TipoConf { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/Kit.cs b/MpDataLayer/DatabaseModels/Kit.cs new file mode 100644 index 00000000..ba70fc4a --- /dev/null +++ b/MpDataLayer/DatabaseModels/Kit.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Kit + { + public string KeyKit { get; set; } + public string KeyExtOrd { get; set; } + public string CodArtParent { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/MoonPro_STATSContext.cs b/MpDataLayer/DatabaseModels/MoonPro_STATSContext.cs new file mode 100644 index 00000000..5023d87a --- /dev/null +++ b/MpDataLayer/DatabaseModels/MoonPro_STATSContext.cs @@ -0,0 +1,1558 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class MoonPro_STATSContext : DbContext + { + public MoonPro_STATSContext() + { + } + + public MoonPro_STATSContext(DbContextOptions options) + : base(options) + { + } + + public virtual DbSet Aauls { get; set; } + public virtual DbSet Cals { get; set; } + public virtual DbSet Configs { get; set; } + public virtual DbSet Ddbs { get; set; } + public virtual DbSet Ddbs1 { get; set; } + public virtual DbSet DdbTurnis { get; set; } + public virtual DbSet DdbTurniNews { get; set; } + public virtual DbSet DdbTurniSummaries { get; set; } + public virtual DbSet DdbTurniSummaryNews { get; set; } + public virtual DbSet Ecps { get; set; } + public virtual DbSet Ecps1 { get; set; } + public virtual DbSet Kits { get; set; } + public virtual DbSet Odls { get; set; } + public virtual DbSet Odls1 { get; set; } + public virtual DbSet Rs { get; set; } + public virtual DbSet Rs1 { get; set; } + public virtual DbSet Rcs { get; set; } + public virtual DbSet Tallies { get; set; } + public virtual DbSet TcStats { get; set; } + public virtual DbSet Tcrs { get; set; } + public virtual DbSet Tcrs1 { get; set; } + public virtual DbSet TcrDays { get; set; } + public virtual DbSet TcrDayTests { get; set; } + public virtual DbSet TestJasons { get; set; } + public virtual DbSet
    Uls { get; set; } + public virtual DbSet VDdbs { get; set; } + public virtual DbSet VDdbLights { get; set; } + public virtual DbSet VDdbLightOlds { get; set; } + public virtual DbSet VDdbTurnis { get; set; } + public virtual DbSet VEcps { get; set; } + public virtual DbSet VEcps1 { get; set; } + public virtual DbSet VEcpExtendeds { get; set; } + public virtual DbSet VKits { get; set; } + public virtual DbSet VOdls { get; set; } + public virtual DbSet VOdls1 { get; set; } + public virtual DbSet VPodlNonChiusis { get; set; } + public virtual DbSet VRs { get; set; } + public virtual DbSet VRs1 { get; set; } + public virtual DbSet VRcs { get; set; } + public virtual DbSet VTcStats { get; set; } + public virtual DbSet VTcrs { get; set; } + public virtual DbSet VTcrs1 { get; set; } + public virtual DbSet VTcrDays { get; set; } + public virtual DbSet VUls { get; set; } + public virtual DbSet VetoTcs { get; set; } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + 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("Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;"); + } + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS"); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Azione); + + entity.ToTable("AAUL"); + + entity.Property(e => e.Azione) + .HasMaxLength(50) + .HasDefaultValueSql("('ND')") + .HasComment("Azione dell'operatore"); + + entity.Property(e => e.Descrizione) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Giorno) + .HasName("PK_Calendario"); + + entity.ToTable("CAL"); + + entity.Property(e => e.Giorno) + .HasColumnType("datetime") + .HasColumnName("giorno"); + + entity.Property(e => e.DoDdb) + .IsRequired() + .HasColumnName("doDDB") + .HasDefaultValueSql("((1))") + .HasComment("Indica che è necessario ricalcolare statistiche derivate da DDB (DiarioDiBordo)"); + + entity.Property(e => e.DoEcp) + .IsRequired() + .HasColumnName("doECP") + .HasDefaultValueSql("((1))") + .HasComment("Indica che è necessario ricalcolare statistiche derivate da DPO (DatiProduzione Operatore) - conferme manuali operatore"); + + entity.Property(e => e.DoOdl) + .IsRequired() + .HasColumnName("doODL") + .HasDefaultValueSql("((1))") + .HasComment("Indica che è necessario ricalcolare statistiche ODL"); + + entity.Property(e => e.DoRs) + .IsRequired() + .HasColumnName("doRS") + .HasDefaultValueSql("((1))") + .HasComment("Indica che è necessario ricalcolare statistiche derivate da RS (Registro Scarti)"); + + entity.Property(e => e.DoTcr) + .IsRequired() + .HasColumnName("doTCR") + .HasDefaultValueSql("((1))") + .HasComment("Indica che è necessario ricalcolare statistiche derivate da rilevazione TCR (TempiCicloRilevati)"); + + entity.Property(e => e.DoUl) + .IsRequired() + .HasColumnName("doUL") + .HasDefaultValueSql("((1))") + .HasComment("Indica che è necessario ricalcolare statistiche derivate da DSO (Dichiarazioni Scarti Operatore)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Chiave); + + entity.ToTable("Config"); + + entity.Property(e => e.Chiave) + .HasMaxLength(50) + .HasColumnName("chiave"); + + entity.Property(e => e.Note).HasColumnName("note"); + + entity.Property(e => e.Valore).HasColumnName("valore"); + + entity.Property(e => e.ValoreStd) + .HasColumnName("valoreStd") + .HasComment("Valore di default/riferimento per la variabile"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DataOraRif, e.IdxMacchina, e.IdxStato }) + .HasName("PK_DDB_1"); + + entity.ToTable("DDB"); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.DurataMinuti).HasColumnType("decimal(18, 8)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("DDB", "raw"); + + entity.HasIndex(e => e.InizioStato, "ci_DDB_Data") + .IsClustered(); + + entity.HasIndex(e => e.CodArticolo, "i_DDB_CodArt"); + + entity.HasIndex(e => e.IdxMacchina, "i_DDB_IdxMacc"); + + entity.HasIndex(e => e.IdxStato, "i_DDB_IdxStato"); + + entity.HasIndex(e => e.MatrOpr, "i_DDB_MatrOpr"); + + entity.Property(e => e.ClasseTempo).HasMaxLength(50); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.Descrizione).HasMaxLength(50); + + entity.Property(e => e.FineStato).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.InizioStato).HasColumnType("datetime"); + + entity.Property(e => e.Pallet) + .HasMaxLength(20) + .HasColumnName("pallet"); + + entity.Property(e => e.Value).HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DataRif, e.IdxMacchina, e.Turno, e.IdxStato, e.CodArticolo, e.InizioPeriodo }); + + entity.ToTable("DDB_Turni"); + + entity.Property(e => e.DataRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.Turno).HasMaxLength(5); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.InizioPeriodo).HasColumnType("datetime"); + + entity.Property(e => e.ClasseTempo).HasMaxLength(50); + + entity.Property(e => e.DataTurnoFine).HasColumnType("datetime"); + + entity.Property(e => e.DataTurnoInizio).HasColumnType("datetime"); + + entity.Property(e => e.Descrizione).HasMaxLength(50); + + entity.Property(e => e.FinePeriodo).HasColumnType("datetime"); + + entity.Property(e => e.FineStato).HasColumnType("datetime"); + + entity.Property(e => e.InizioStato).HasColumnType("datetime"); + + entity.Property(e => e.Pallet) + .HasMaxLength(20) + .HasColumnName("pallet"); + + entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DataRif, e.IdxMacchina, e.Turno, e.IdxStato, e.CodArticolo, e.InizioPeriodo }); + + entity.ToTable("DDB_TurniNew"); + + entity.Property(e => e.DataRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.Turno).HasMaxLength(5); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.InizioPeriodo).HasColumnType("datetime"); + + entity.Property(e => e.ClasseTempo).HasMaxLength(50); + + entity.Property(e => e.DataTurnoFine).HasColumnType("datetime"); + + entity.Property(e => e.DataTurnoInizio).HasColumnType("datetime"); + + entity.Property(e => e.Descrizione).HasMaxLength(50); + + entity.Property(e => e.FinePeriodo).HasColumnType("datetime"); + + entity.Property(e => e.FineStato).HasColumnType("datetime"); + + entity.Property(e => e.InizioStato).HasColumnType("datetime"); + + entity.Property(e => e.Pallet) + .HasMaxLength(20) + .HasColumnName("pallet"); + + entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.IdxMacchina, e.DataRif, e.Turno, e.CodArticolo, e.IdxStato, e.TempoCicloBase, e.PzPalletProd }); + + entity.ToTable("DDB_TurniSummary"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.DataRif).HasColumnType("datetime"); + + entity.Property(e => e.Turno).HasMaxLength(5); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)"); + + entity.Property(e => e.Durata).HasColumnType("numeric(27, 7)"); + + entity.Property(e => e.Inizio).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.IdxMacchina, e.DataRif, e.Turno, e.CodArticolo, e.IdxStato, e.TempoCicloBase, e.PzPalletProd }); + + entity.ToTable("DDB_TurniSummaryNew"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.DataRif).HasColumnType("datetime"); + + entity.Property(e => e.Turno).HasMaxLength(5); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)"); + + entity.Property(e => e.Durata).HasColumnType("numeric(27, 7)"); + + entity.Property(e => e.Inizio).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IdxEcp); + + entity.ToTable("ECP"); + + entity.Property(e => e.IdxEcp).HasColumnName("idxECP"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Cognome) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + + entity.Property(e => e.DataOraConf).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("idxMacchina"); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + + entity.Property(e => e.PezziConf).HasColumnName("pezziConf"); + + entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav"); + + entity.Property(e => e.PezziScar).HasColumnName("pezziScar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ECP", "raw"); + + entity.HasIndex(e => e.DataOraConf, "ci_ECP_Data") + .IsClustered(); + + entity.HasIndex(e => e.IdxMacchina, "i_ECP_IdxMacc"); + + entity.HasIndex(e => e.MatrApp, "i_ECP_MatrApp"); + + entity.HasIndex(e => e.IdxMacchina, "i_ODL_IdxMacc"); + + entity.Property(e => e.CommessaEsterna) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataFrom) + .HasColumnType("datetime") + .HasColumnName("dataFrom"); + + entity.Property(e => e.DataOraConf).HasColumnType("datetime"); + + entity.Property(e => e.DataTo) + .HasColumnType("datetime") + .HasColumnName("dataTo"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("idxMacchina"); + + entity.Property(e => e.PezziConf).HasColumnName("pezziConf"); + + entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav"); + + entity.Property(e => e.PezziScar).HasColumnName("pezziScar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.KeyKit); + + entity.ToTable("KIT", "raw"); + + entity.Property(e => e.KeyKit).HasMaxLength(50); + + entity.Property(e => e.CodArtParent).IsRequired(); + + entity.Property(e => e.KeyExtOrd).IsRequired(); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IdxOdl) + .HasName("PK_ODL_1"); + + entity.ToTable("ODL"); + + entity.Property(e => e.IdxOdl) + .ValueGeneratedNever() + .HasColumnName("IdxODL"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodArticoloParent) + .IsRequired() + .HasDefaultValueSql("('')"); + + entity.Property(e => e.DataFine).HasColumnType("datetime"); + + entity.Property(e => e.DataInizio).HasColumnType("datetime"); + + entity.Property(e => e.DueDate).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50) + .HasComment("Chiave: ordine esterno o KIT"); + + entity.Property(e => e.KeyRichiestaParent) + .IsRequired() + .HasDefaultValueSql("('')") + .HasComment("Chiave: ordine esterno o KIT"); + + entity.Property(e => e.PzPallet).HasDefaultValueSql("((1))"); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IdxOdl) + .IsClustered(false); + + entity.ToTable("ODL", "raw"); + + entity.HasIndex(e => e.IdxOdl, "ci_ODL_Data") + .IsClustered(); + + entity.HasIndex(e => e.IdxMacchina, "i_ODL_IdxMacc"); + + entity.HasIndex(e => e.KeyRichiesta, "i_ODL_KeyRic"); + + entity.Property(e => e.IdxOdl) + .ValueGeneratedNever() + .HasColumnName("IdxODL"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CommessaAs400) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataAppr).HasColumnType("datetime"); + + entity.Property(e => e.DataFine).HasColumnType("datetime"); + + entity.Property(e => e.DataInizio).HasColumnType("datetime"); + + entity.Property(e => e.DueDate).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Note).HasMaxLength(2500); + + entity.Property(e => e.Provvisorio).HasColumnName("provvisorio"); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + + entity.Property(e => e.TcrichAttr) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCRichAttr"); + + entity.Property(e => e.UserAppr).HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DataOraRif, e.IdxMacchina, e.Causale, e.IdxOdl }); + + entity.ToTable("RS"); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.Causale).HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Cognome) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + + entity.Property(e => e.Descrizione) + .IsRequired() + .HasMaxLength(250); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + + entity.Property(e => e.Note) + .IsRequired() + .HasMaxLength(250); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("RS", "raw"); + + entity.HasIndex(e => e.DataOra, "ci_RS_Data") + .IsClustered(); + + entity.HasIndex(e => e.Causale, "i_RS_Causale"); + + entity.HasIndex(e => e.CodArticolo, "i_RS_CodArt"); + + entity.HasIndex(e => e.IdxMacchina, "i_RS_IdxMacc"); + + entity.HasIndex(e => e.MatrOpr, "i_RS_MatrOpr"); + + entity.Property(e => e.Causale) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOra).HasColumnType("datetime"); + + entity.Property(e => e.DataOraProdRec).HasColumnType("datetime"); + + entity.Property(e => e.Descrizione) + .IsRequired() + .HasMaxLength(250); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Note) + .IsRequired() + .HasMaxLength(250); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IdxControllo) + .IsClustered(false); + + entity.ToTable("RC", "raw"); + + entity.HasIndex(e => e.DataOra, "ci_RC_Data") + .IsClustered(); + + entity.HasIndex(e => e.CodArticolo, "i_RC_CodArt"); + + entity.HasIndex(e => e.EsitoOk, "i_RC_EsitoOk"); + + entity.HasIndex(e => e.IdxMacchina, "i_RC_IdxMacc"); + + entity.HasIndex(e => e.MatrOpr, "i_RC_MatrOpr"); + + entity.Property(e => e.IdxControllo).ValueGeneratedNever(); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOra).HasColumnType("datetime"); + + entity.Property(e => e.EsitoOk).HasColumnName("EsitoOK"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.Note) + .IsRequired() + .HasMaxLength(250); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.N) + .HasName("PK_Tally_N"); + + entity.ToTable("Tally"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.CodArticolo, e.CodGruppo, e.IdxMacchina }); + + entity.ToTable("TC_Stat"); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.CodGruppo).HasMaxLength(50); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.TcStat1) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TC_Stat"); + + entity.Property(e => e.TcType).HasColumnName("TC_Type"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.IdxMacchina, e.CodArticolo, e.DataOraRif }) + .IsClustered(false); + + entity.ToTable("TCR"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.Tc50p) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TC50p") + .HasComment("Valore percentile 50"); + + entity.Property(e => e.Tcmax) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMax") + .HasComment("Valore MASSIMO"); + + entity.Property(e => e.Tcmedio) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMedio") + .HasComment("Valore di MEDIA arimetica"); + + entity.Property(e => e.Tcmin) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMin") + .HasComment("Valore minimo"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("TCR", "raw"); + + entity.HasIndex(e => e.DataOraRif, "ci_TCR_Data") + .IsClustered(); + + entity.HasIndex(e => e.CodArticolo, "i_TCR_CodArt"); + + entity.HasIndex(e => e.IdxMacchina, "i_TCR_IdxMacc"); + + entity.HasIndex(e => e.KeyRichiesta, "i_TCR_KeyRich"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + + entity.Property(e => e.Tcmedio) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMedio"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.IdxMacchina, e.CodArticolo, e.DataOraRif }) + .HasName("PK_TCRDay") + .IsClustered(false); + + entity.ToTable("TCR_Day"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("date"); + + entity.Property(e => e.Tc50p) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TC50p") + .HasComment("Valore percentile 50"); + + entity.Property(e => e.Tcmax) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMax") + .HasComment("Valore MASSIMO"); + + entity.Property(e => e.Tcmedio) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMedio") + .HasComment("Valore di MEDIA arimetica"); + + entity.Property(e => e.Tcmin) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMin") + .HasComment("Valore minimo"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("TCR_DayTest"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("date"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Tc50p) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TC50p"); + + entity.Property(e => e.Tcmax) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMax"); + + entity.Property(e => e.Tcmedio) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMedio"); + + entity.Property(e => e.Tcmin) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMin"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("TestJason"); + + entity.Property(e => e.Data).HasColumnType("date"); + }); + + modelBuilder.Entity
      (entity => + { + entity.HasKey(e => e.IdxLog) + .HasName("PK_UserLog"); + + entity.ToTable("UL"); + + entity.HasIndex(e => e.DataOraRif, "i_UL_DataOra"); + + entity.Property(e => e.Azione) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('ND')") + .HasComment("Azione dell'operatore"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Cognome) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + + entity.Property(e => e.Qta).HasColumnType("decimal(18, 8)"); + + entity.Property(e => e.Valore) + .IsRequired() + .HasMaxLength(250) + .HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vDDB"); + + entity.Property(e => e.ClasseTempo).HasMaxLength(50); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.Descrizione).HasMaxLength(50); + + entity.Property(e => e.FineStato).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.InizioStato).HasColumnType("datetime"); + + entity.Property(e => e.Pallet) + .HasMaxLength(20) + .HasColumnName("pallet"); + + entity.Property(e => e.Value).HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_DDB_Light", "export"); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.InizioStato).HasColumnType("datetime"); + + entity.Property(e => e.Operatore) + .IsRequired() + .HasMaxLength(101); + + entity.Property(e => e.Stato).HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vDDB_Light_OLD"); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.InizioStato).HasColumnType("datetime"); + + entity.Property(e => e.Operatore) + .IsRequired() + .HasMaxLength(101); + + entity.Property(e => e.Stato).HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_DDB_Turni", "export"); + + entity.Property(e => e.ClasseTempo).HasMaxLength(50); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.DataRif).HasColumnType("datetime"); + + entity.Property(e => e.DescClasseTempo).HasMaxLength(50); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.Durata).HasColumnType("numeric(38, 7)"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.SemColore) + .IsRequired() + .HasMaxLength(6) + .IsUnicode(false); + + entity.Property(e => e.Semaforo).HasMaxLength(50); + + entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)"); + + entity.Property(e => e.Turno) + .IsRequired() + .HasMaxLength(5); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vECP"); + + entity.Property(e => e.CommessaEsterna) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataFrom) + .HasColumnType("datetime") + .HasColumnName("dataFrom"); + + entity.Property(e => e.DataOraConf).HasColumnType("datetime"); + + entity.Property(e => e.DataTo) + .HasColumnType("datetime") + .HasColumnName("dataTo"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("idxMacchina"); + + entity.Property(e => e.PezziConf).HasColumnName("pezziConf"); + + entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav"); + + entity.Property(e => e.PezziScar).HasColumnName("pezziScar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_ECP", "export"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.Cognome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOraConf).HasColumnType("datetime"); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.IdxEcp).HasColumnName("idxECP"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("idxMacchina"); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.PezziConf).HasColumnName("pezziConf"); + + entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav"); + + entity.Property(e => e.PezziScar).HasColumnName("pezziScar"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_ECP_Extended", "export"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.Cognome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOraConf).HasColumnType("datetime"); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.DueDate).HasColumnType("datetime"); + + entity.Property(e => e.IdxEcp).HasColumnName("idxECP"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("idxMacchina"); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.PezziConf).HasColumnName("pezziConf"); + + entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav"); + + entity.Property(e => e.PezziScar).HasColumnName("pezziScar"); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vKIT"); + + entity.Property(e => e.KeyKit) + .IsRequired() + .HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vODL"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CommessaAs400) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataAppr).HasColumnType("datetime"); + + entity.Property(e => e.DataFine).HasColumnType("datetime"); + + entity.Property(e => e.DataInizio).HasColumnType("datetime"); + + entity.Property(e => e.DueDate).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Note).HasMaxLength(2500); + + entity.Property(e => e.Provvisorio).HasColumnName("provvisorio"); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + + entity.Property(e => e.TcrichAttr) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCRichAttr"); + + entity.Property(e => e.UserAppr).HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_ODL", "export"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodArticoloParent).IsRequired(); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.DataFine).HasColumnType("datetime"); + + entity.Property(e => e.DataInizio).HasColumnType("datetime"); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.DueDate).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.KeyRichiestaParent).IsRequired(); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_PODL_NonChiusi", "export"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodGruppo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataInizio).HasColumnType("datetime"); + + entity.Property(e => e.DescArticolo).HasMaxLength(301); + + entity.Property(e => e.DueDate).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.IdxPromessa).HasColumnName("idxPromessa"); + + entity.Property(e => e.KeyBcode) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("KeyBCode"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome).HasMaxLength(50); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + + entity.Property(e => e.TotMinProg).HasColumnType("decimal(29, 8)"); + + entity.Property(e => e.TotOreProg).HasColumnType("decimal(32, 11)"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vRS"); + + entity.Property(e => e.Causale) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOra).HasColumnType("datetime"); + + entity.Property(e => e.DataOraProdRec).HasColumnType("datetime"); + + entity.Property(e => e.Descrizione) + .IsRequired() + .HasMaxLength(250); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Note) + .IsRequired() + .HasMaxLength(250); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_RS", "export"); + + entity.Property(e => e.Causale) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Cognome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.Descrizione) + .IsRequired() + .HasMaxLength(250); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Note) + .IsRequired() + .HasMaxLength(250); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vRC"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOra).HasColumnType("datetime"); + + entity.Property(e => e.EsitoOk).HasColumnName("EsitoOK"); + + entity.Property(e => e.IdxControllo).ValueGeneratedOnAdd(); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.Note) + .IsRequired() + .HasMaxLength(250); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_TC_Stat", "export"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodGruppo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.TcStat) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TC_Stat"); + + entity.Property(e => e.TcType).HasColumnName("TC_Type"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("vTCR"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.IdxOdl).HasColumnName("IdxODL"); + + entity.Property(e => e.KeyRichiesta) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Tcassegnato) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCAssegnato"); + + entity.Property(e => e.Tcmedio) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMedio"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_TCR", "export"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Tc50p) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TC50p"); + + entity.Property(e => e.Tcmax) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMax"); + + entity.Property(e => e.Tcmedio) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMedio"); + + entity.Property(e => e.Tcmin) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMin"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_TCR_Day", "export"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.DescMacchina).HasMaxLength(50); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Tc50p) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TC50p"); + + entity.Property(e => e.Tcmax) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMax"); + + entity.Property(e => e.Tcmedio) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMedio"); + + entity.Property(e => e.Tcmin) + .HasColumnType("decimal(18, 8)") + .HasColumnName("TCMin"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_UL", "export"); + + entity.Property(e => e.Azione) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Cognome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DataOraRif).HasColumnType("datetime"); + + entity.Property(e => e.IdxLog).ValueGeneratedOnAdd(); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Qta).HasColumnType("decimal(18, 8)"); + + entity.Property(e => e.Valore) + .IsRequired() + .HasMaxLength(250); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.IdxMacchina, e.CodArticolo }); + + entity.ToTable("VetoTC"); + + entity.Property(e => e.IdxMacchina).HasMaxLength(50); + + entity.Property(e => e.CodArticolo).HasMaxLength(50); + + entity.Property(e => e.SogliaTc) + .HasColumnType("decimal(18, 8)") + .HasColumnName("SogliaTC"); + + entity.Property(e => e.VetoTc1) + .IsRequired() + .HasColumnName("VetoTC") + .HasDefaultValueSql("((1))"); + }); + + OnModelCreatingPartial(modelBuilder); + } + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); + } +} diff --git a/MpDataLayer/DatabaseModels/Odl.cs b/MpDataLayer/DatabaseModels/Odl.cs new file mode 100644 index 00000000..aa588745 --- /dev/null +++ b/MpDataLayer/DatabaseModels/Odl.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Odl + { + public int IdxOdl { get; set; } + public string KeyRichiesta { get; set; } + public string CodArticolo { get; set; } + public decimal Tcassegnato { get; set; } + public string IdxMacchina { get; set; } + public int NumPezzi { get; set; } + public int NumPezziEv { get; set; } + public int NumPezziSca { get; set; } + public int NumPezziRil { get; set; } + public DateTime? DataInizio { get; set; } + public DateTime? DataFine { get; set; } + public string KeyRichiestaParent { get; set; } + public string CodArticoloParent { get; set; } + public DateTime? DueDate { get; set; } + public int? PzPallet { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/Odl1.cs b/MpDataLayer/DatabaseModels/Odl1.cs new file mode 100644 index 00000000..96edddb6 --- /dev/null +++ b/MpDataLayer/DatabaseModels/Odl1.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Odl1 + { + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public string IdxMacchina { get; set; } + public int NumPezzi { get; set; } + public decimal Tcassegnato { get; set; } + public DateTime? DataInizio { get; set; } + public DateTime? DataFine { get; set; } + public string Note { get; set; } + public bool NeedAppr { get; set; } + public string UserAppr { get; set; } + public DateTime? DataAppr { get; set; } + public decimal? TcrichAttr { get; set; } + public string KeyRichiesta { get; set; } + public int PzPallet { get; set; } + public bool Provvisorio { get; set; } + public int MatrOpr { get; set; } + public string CommessaAs400 { get; set; } + public int ToAs400 { get; set; } + public DateTime? DueDate { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/R.cs b/MpDataLayer/DatabaseModels/R.cs new file mode 100644 index 00000000..58830883 --- /dev/null +++ b/MpDataLayer/DatabaseModels/R.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class R + { + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public string Causale { get; set; } + public string Descrizione { get; set; } + public string Note { get; set; } + public int Qta { get; set; } + public string KeyRichiesta { get; set; } + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public int MatrOpr { get; set; } + public string Cognome { get; set; } + public string Nome { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/R1.cs b/MpDataLayer/DatabaseModels/R1.cs new file mode 100644 index 00000000..ef429455 --- /dev/null +++ b/MpDataLayer/DatabaseModels/R1.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class R1 + { + public string IdxMacchina { get; set; } + public DateTime DataOra { get; set; } + public string Causale { get; set; } + public int Qta { get; set; } + public string Note { get; set; } + public string CodArticolo { get; set; } + public int MatrOpr { get; set; } + public DateTime? DataOraProdRec { get; set; } + public string Descrizione { get; set; } + public string KeyRichiesta { get; set; } + public int IdxOdl { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/Rc.cs b/MpDataLayer/DatabaseModels/Rc.cs new file mode 100644 index 00000000..db9e5a56 --- /dev/null +++ b/MpDataLayer/DatabaseModels/Rc.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Rc + { + public int IdxControllo { get; set; } + public DateTime DataOra { get; set; } + public string IdxMacchina { get; set; } + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public int MatrOpr { get; set; } + public bool EsitoOk { get; set; } + public string Note { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/Tally.cs b/MpDataLayer/DatabaseModels/Tally.cs new file mode 100644 index 00000000..665c4c8f --- /dev/null +++ b/MpDataLayer/DatabaseModels/Tally.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Tally + { + public int N { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/TcStat.cs b/MpDataLayer/DatabaseModels/TcStat.cs new file mode 100644 index 00000000..47854d10 --- /dev/null +++ b/MpDataLayer/DatabaseModels/TcStat.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class TcStat + { + public string CodArticolo { get; set; } + public string CodGruppo { get; set; } + public string IdxMacchina { get; set; } + public decimal TcStat1 { get; set; } + public int TcType { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/Tcr.cs b/MpDataLayer/DatabaseModels/Tcr.cs new file mode 100644 index 00000000..e6164342 --- /dev/null +++ b/MpDataLayer/DatabaseModels/Tcr.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Tcr + { + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public string CodArticolo { get; set; } + public int PzProd { get; set; } + public decimal? Tcmedio { get; set; } + public decimal? Tcmin { get; set; } + public decimal? Tcmax { get; set; } + public decimal? Tc50p { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/Tcr1.cs b/MpDataLayer/DatabaseModels/Tcr1.cs new file mode 100644 index 00000000..9cd223b2 --- /dev/null +++ b/MpDataLayer/DatabaseModels/Tcr1.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Tcr1 + { + public string IdxMacchina { get; set; } + public string CodArticolo { get; set; } + public DateTime DataOraRif { get; set; } + public decimal Tcmedio { get; set; } + public int PzProd { get; set; } + public int IdxOdl { get; set; } + public decimal Tcassegnato { get; set; } + public string KeyRichiesta { get; set; } + public int PzPallet { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/TcrDay.cs b/MpDataLayer/DatabaseModels/TcrDay.cs new file mode 100644 index 00000000..5e3f2f19 --- /dev/null +++ b/MpDataLayer/DatabaseModels/TcrDay.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class TcrDay + { + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public string CodArticolo { get; set; } + public int PzProd { get; set; } + public decimal? Tcmedio { get; set; } + public decimal? Tcmin { get; set; } + public decimal? Tcmax { get; set; } + public decimal? Tc50p { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/TcrDayTest.cs b/MpDataLayer/DatabaseModels/TcrDayTest.cs new file mode 100644 index 00000000..7cdd98a2 --- /dev/null +++ b/MpDataLayer/DatabaseModels/TcrDayTest.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class TcrDayTest + { + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public string CodArticolo { get; set; } + public int PzProd { get; set; } + public decimal? Tcmedio { get; set; } + public decimal? Tcmin { get; set; } + public decimal? Tcmax { get; set; } + public decimal? Tc50p { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/TestJason.cs b/MpDataLayer/DatabaseModels/TestJason.cs new file mode 100644 index 00000000..f162836d --- /dev/null +++ b/MpDataLayer/DatabaseModels/TestJason.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class TestJason + { + public DateTime Data { get; set; } + public byte[] Json { get; set; } + public int? Rows { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/Ul.cs b/MpDataLayer/DatabaseModels/Ul.cs new file mode 100644 index 00000000..585b79dc --- /dev/null +++ b/MpDataLayer/DatabaseModels/Ul.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class Ul + { + public int IdxLog { get; set; } + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public int MatrOpr { get; set; } + public string Cognome { get; set; } + public string Nome { get; set; } + public string CodArticolo { get; set; } + public string Azione { get; set; } + public string Valore { get; set; } + public decimal Qta { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VDdb.cs b/MpDataLayer/DatabaseModels/VDdb.cs new file mode 100644 index 00000000..b6101765 --- /dev/null +++ b/MpDataLayer/DatabaseModels/VDdb.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VDdb + { + public string IdxMacchina { get; set; } + public DateTime InizioStato { get; set; } + public DateTime? FineStato { get; set; } + public int IdxStato { get; set; } + public double? DurataMinuti { get; set; } + public string Value { get; set; } + public string CodArticolo { get; set; } + public double? TempoCicloBase { get; set; } + public int? PzPalletProd { get; set; } + public int? MatrOpr { get; set; } + public string Pallet { get; set; } + public string Descrizione { get; set; } + public string ClasseTempo { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VDdbLight.cs b/MpDataLayer/DatabaseModels/VDdbLight.cs new file mode 100644 index 00000000..2340bc30 --- /dev/null +++ b/MpDataLayer/DatabaseModels/VDdbLight.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VDdbLight + { + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public DateTime InizioStato { get; set; } + public string Stato { get; set; } + public double? DurataMinuti { get; set; } + public string CodArticolo { get; set; } + public string Operatore { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VDdbLightOld.cs b/MpDataLayer/DatabaseModels/VDdbLightOld.cs new file mode 100644 index 00000000..1f56626f --- /dev/null +++ b/MpDataLayer/DatabaseModels/VDdbLightOld.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VDdbLightOld + { + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public DateTime InizioStato { get; set; } + public string Stato { get; set; } + public double? DurataMinuti { get; set; } + public string CodArticolo { get; set; } + public string Operatore { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VDdbTurni.cs b/MpDataLayer/DatabaseModels/VDdbTurni.cs new file mode 100644 index 00000000..39f605b1 --- /dev/null +++ b/MpDataLayer/DatabaseModels/VDdbTurni.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VDdbTurni + { + public string IdxMacchina { get; set; } + public DateTime DataRif { get; set; } + public string Turno { get; set; } + public string CodArticolo { get; set; } + public int IdxStato { get; set; } + public decimal TempoCicloBase { get; set; } + public int PzPalletProd { get; set; } + public decimal? Durata { get; set; } + public int? PzProd { get; set; } + public string ClasseTempo { get; set; } + public string DescClasseTempo { get; set; } + public string Semaforo { get; set; } + public string SemColore { get; set; } + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VEcp.cs b/MpDataLayer/DatabaseModels/VEcp.cs new file mode 100644 index 00000000..274a6c3b --- /dev/null +++ b/MpDataLayer/DatabaseModels/VEcp.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VEcp + { + public DateTime DataOraConf { get; set; } + public string IdxMacchina { get; set; } + public int MatrApp { get; set; } + public DateTime DataFrom { get; set; } + public DateTime DataTo { get; set; } + public int PezziConf { get; set; } + public int PezziScar { get; set; } + public int PezziDaRilav { get; set; } + public string CommessaEsterna { get; set; } + public int TipoConf { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VEcp1.cs b/MpDataLayer/DatabaseModels/VEcp1.cs new file mode 100644 index 00000000..e12d1a9e --- /dev/null +++ b/MpDataLayer/DatabaseModels/VEcp1.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VEcp1 + { + public int IdxEcp { get; set; } + public DateTime DataOraConf { get; set; } + public string IdxMacchina { get; set; } + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public string KeyRichiesta { get; set; } + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public int PezziConf { get; set; } + public int PezziScar { get; set; } + public int PezziDaRilav { get; set; } + public int MatrOpr { get; set; } + public string Cognome { get; set; } + public string Nome { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VEcpExtended.cs b/MpDataLayer/DatabaseModels/VEcpExtended.cs new file mode 100644 index 00000000..b6c03144 --- /dev/null +++ b/MpDataLayer/DatabaseModels/VEcpExtended.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VEcpExtended + { + public int IdxEcp { get; set; } + public DateTime DataOraConf { get; set; } + public string IdxMacchina { get; set; } + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public string KeyRichiesta { get; set; } + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public int PezziConf { get; set; } + public int PezziScar { get; set; } + public int PezziDaRilav { get; set; } + public int MatrOpr { get; set; } + public string Cognome { get; set; } + public string Nome { get; set; } + public decimal Tcassegnato { get; set; } + public DateTime DueDate { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VKit.cs b/MpDataLayer/DatabaseModels/VKit.cs new file mode 100644 index 00000000..59d8084f --- /dev/null +++ b/MpDataLayer/DatabaseModels/VKit.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VKit + { + public string KeyKit { get; set; } + public string KeyExtOrd { get; set; } + public string CodArtParent { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VOdl.cs b/MpDataLayer/DatabaseModels/VOdl.cs new file mode 100644 index 00000000..5cf15d5a --- /dev/null +++ b/MpDataLayer/DatabaseModels/VOdl.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VOdl + { + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public string IdxMacchina { get; set; } + public int NumPezzi { get; set; } + public decimal Tcassegnato { get; set; } + public DateTime? DataInizio { get; set; } + public DateTime? DataFine { get; set; } + public string Note { get; set; } + public bool NeedAppr { get; set; } + public string UserAppr { get; set; } + public DateTime? DataAppr { get; set; } + public decimal? TcrichAttr { get; set; } + public string KeyRichiesta { get; set; } + public int PzPallet { get; set; } + public bool Provvisorio { get; set; } + public int MatrOpr { get; set; } + public string CommessaAs400 { get; set; } + public int ToAs400 { get; set; } + public DateTime? DueDate { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VOdl1.cs b/MpDataLayer/DatabaseModels/VOdl1.cs new file mode 100644 index 00000000..75a3a7f5 --- /dev/null +++ b/MpDataLayer/DatabaseModels/VOdl1.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VOdl1 + { + public int IdxOdl { get; set; } + public string KeyRichiesta { get; set; } + public string CodArticolo { get; set; } + public decimal Tcassegnato { get; set; } + public string IdxMacchina { get; set; } + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public int NumPezzi { get; set; } + public int NumPezziEv { get; set; } + public int NumPezziSca { get; set; } + public int NumPezziRil { get; set; } + public DateTime? DataInizio { get; set; } + public DateTime? DataFine { get; set; } + public string KeyRichiestaParent { get; set; } + public string CodArticoloParent { get; set; } + public DateTime? DueDate { get; set; } + public int? PzPallet { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VPodlNonChiusi.cs b/MpDataLayer/DatabaseModels/VPodlNonChiusi.cs new file mode 100644 index 00000000..9c7ef255 --- /dev/null +++ b/MpDataLayer/DatabaseModels/VPodlNonChiusi.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VPodlNonChiusi + { + public int IdxPromessa { get; set; } + public string KeyRichiesta { get; set; } + public string KeyBcode { get; set; } + public bool Attivabile { get; set; } + public int IdxOdl { get; set; } + public DateTime? DataInizio { get; set; } + public string CodArticolo { get; set; } + public string DescArticolo { get; set; } + public string CodGruppo { get; set; } + public string IdxMacchina { get; set; } + public string CodMacchina { get; set; } + public string Nome { get; set; } + public int NumPezzi { get; set; } + public decimal Tcassegnato { get; set; } + public DateTime DueDate { get; set; } + public int Priorita { get; set; } + public int PzPallet { get; set; } + public decimal? TotMinProg { get; set; } + public decimal? TotOreProg { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VR.cs b/MpDataLayer/DatabaseModels/VR.cs new file mode 100644 index 00000000..f147a688 --- /dev/null +++ b/MpDataLayer/DatabaseModels/VR.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VR + { + public string IdxMacchina { get; set; } + public DateTime DataOra { get; set; } + public string Causale { get; set; } + public int Qta { get; set; } + public string Note { get; set; } + public string CodArticolo { get; set; } + public int MatrOpr { get; set; } + public DateTime? DataOraProdRec { get; set; } + public string Descrizione { get; set; } + public string KeyRichiesta { get; set; } + public int IdxOdl { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VR1.cs b/MpDataLayer/DatabaseModels/VR1.cs new file mode 100644 index 00000000..47737486 --- /dev/null +++ b/MpDataLayer/DatabaseModels/VR1.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VR1 + { + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public string Causale { get; set; } + public string Descrizione { get; set; } + public string Note { get; set; } + public int Qta { get; set; } + public string KeyRichiesta { get; set; } + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public int MatrOpr { get; set; } + public string Cognome { get; set; } + public string Nome { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VRc.cs b/MpDataLayer/DatabaseModels/VRc.cs new file mode 100644 index 00000000..ac41945e --- /dev/null +++ b/MpDataLayer/DatabaseModels/VRc.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VRc + { + public int IdxControllo { get; set; } + public DateTime DataOra { get; set; } + public string IdxMacchina { get; set; } + public int IdxOdl { get; set; } + public string CodArticolo { get; set; } + public int MatrOpr { get; set; } + public bool EsitoOk { get; set; } + public string Note { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VTcStat.cs b/MpDataLayer/DatabaseModels/VTcStat.cs new file mode 100644 index 00000000..8846c061 --- /dev/null +++ b/MpDataLayer/DatabaseModels/VTcStat.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VTcStat + { + public string CodArticolo { get; set; } + public string CodGruppo { get; set; } + public string IdxMacchina { get; set; } + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public decimal TcStat { get; set; } + public int TcType { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VTcr.cs b/MpDataLayer/DatabaseModels/VTcr.cs new file mode 100644 index 00000000..612bc35a --- /dev/null +++ b/MpDataLayer/DatabaseModels/VTcr.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VTcr + { + public string IdxMacchina { get; set; } + public string CodArticolo { get; set; } + public DateTime DataOraRif { get; set; } + public decimal Tcmedio { get; set; } + public int PzProd { get; set; } + public int IdxOdl { get; set; } + public decimal Tcassegnato { get; set; } + public string KeyRichiesta { get; set; } + public int PzPallet { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VTcr1.cs b/MpDataLayer/DatabaseModels/VTcr1.cs new file mode 100644 index 00000000..15231e9d --- /dev/null +++ b/MpDataLayer/DatabaseModels/VTcr1.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VTcr1 + { + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public string CodArticolo { get; set; } + public int PzProd { get; set; } + public decimal? Tcmedio { get; set; } + public decimal? Tcmin { get; set; } + public decimal? Tcmax { get; set; } + public decimal? Tc50p { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VTcrDay.cs b/MpDataLayer/DatabaseModels/VTcrDay.cs new file mode 100644 index 00000000..5d4c6101 --- /dev/null +++ b/MpDataLayer/DatabaseModels/VTcrDay.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VTcrDay + { + public DateTime? DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public string CodMacchina { get; set; } + public string DescMacchina { get; set; } + public string CodArticolo { get; set; } + public int PzProd { get; set; } + public decimal? Tcmedio { get; set; } + public decimal? Tcmin { get; set; } + public decimal? Tcmax { get; set; } + public decimal? Tc50p { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VUl.cs b/MpDataLayer/DatabaseModels/VUl.cs new file mode 100644 index 00000000..3005f8cd --- /dev/null +++ b/MpDataLayer/DatabaseModels/VUl.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VUl + { + public int IdxLog { get; set; } + public DateTime DataOraRif { get; set; } + public string IdxMacchina { get; set; } + public int MatrOpr { get; set; } + public string Cognome { get; set; } + public string Nome { get; set; } + public string CodArticolo { get; set; } + public string Azione { get; set; } + public string Valore { get; set; } + public decimal Qta { get; set; } + } +} diff --git a/MpDataLayer/DatabaseModels/VetoTc.cs b/MpDataLayer/DatabaseModels/VetoTc.cs new file mode 100644 index 00000000..d4271715 --- /dev/null +++ b/MpDataLayer/DatabaseModels/VetoTc.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MpDataLayer.DatabaseModels +{ + public partial class VetoTc + { + public string IdxMacchina { get; set; } + public string CodArticolo { get; set; } + public bool? VetoTc1 { get; set; } + public decimal SogliaTc { get; set; } + } +} diff --git a/MpDataLayer/MpDataLayer.csproj b/MpDataLayer/MpDataLayer.csproj index 3ec447d6..7ed61e7f 100644 --- a/MpDataLayer/MpDataLayer.csproj +++ b/MpDataLayer/MpDataLayer.csproj @@ -13,6 +13,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + From 44824ee57e7ed5bc66f9a30b317883e59156c2ab Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 15 May 2021 18:14:46 +0200 Subject: [PATCH 003/158] Appunti --- MpDataLayer/Resources/Readme.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 MpDataLayer/Resources/Readme.md diff --git a/MpDataLayer/Resources/Readme.md b/MpDataLayer/Resources/Readme.md new file mode 100644 index 00000000..29cc121b --- /dev/null +++ b/MpDataLayer/Resources/Readme.md @@ -0,0 +1,23 @@ +# Appunti gestione MP-STAT DB + + +Per la gestione dell'accesso al DB statistiche si opera con EFCore --> apop blazor server + +## Scaffolding DB iniziale + + Scaffold-DbContext "Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir DatabaseModels + +## Scaffolding SOLO di tabelle/viste selezionate (con force update) + + Scaffold-DbContext "Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir DatabaseModels -Tables v_RS, v_TC_Stat, v_TCR, v_TCR_Day, v_UL + + + +## Approfondimenti + +Qualche link di approfondimento: + + - https://docs.microsoft.com/en-us/ef/core/ + - https://docs.microsoft.com/en-us/ef/core/extensions/ + - https://www.entityframeworktutorial.net/efcore/create-model-for-existing-database-in-ef-core.aspx + - https://entityframework.net/ef-code-first \ No newline at end of file From e38972db54ba6fbf686584f5629bcacb8b147ceb Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 15 May 2021 18:17:23 +0200 Subject: [PATCH 004/158] Esclusione classi non impiegate --- .../MoonPro_STATSContext.cs | 76 ++++++++++++------- MpDataLayer/MpDataLayer.csproj | 28 +++++++ 2 files changed, 77 insertions(+), 27 deletions(-) rename MpDataLayer/{DatabaseModels => }/MoonPro_STATSContext.cs (98%) diff --git a/MpDataLayer/DatabaseModels/MoonPro_STATSContext.cs b/MpDataLayer/MoonPro_STATSContext.cs similarity index 98% rename from MpDataLayer/DatabaseModels/MoonPro_STATSContext.cs rename to MpDataLayer/MoonPro_STATSContext.cs index 5023d87a..9f753c68 100644 --- a/MpDataLayer/DatabaseModels/MoonPro_STATSContext.cs +++ b/MpDataLayer/MoonPro_STATSContext.cs @@ -1,13 +1,16 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; +using MpDataLayer.DatabaseModels; #nullable disable -namespace MpDataLayer.DatabaseModels +namespace MpDataLayer { public partial class MoonPro_STATSContext : DbContext { + #region Public Constructors + public MoonPro_STATSContext() { } @@ -17,13 +20,16 @@ namespace MpDataLayer.DatabaseModels { } + #endregion Public Constructors + +#if false public virtual DbSet Aauls { get; set; } public virtual DbSet Cals { get; set; } public virtual DbSet Configs { get; set; } public virtual DbSet Ddbs { get; set; } public virtual DbSet Ddbs1 { get; set; } - public virtual DbSet DdbTurnis { get; set; } public virtual DbSet DdbTurniNews { get; set; } + public virtual DbSet DdbTurnis { get; set; } public virtual DbSet DdbTurniSummaries { get; set; } public virtual DbSet DdbTurniSummaryNews { get; set; } public virtual DbSet Ecps { get; set; } @@ -31,37 +37,51 @@ namespace MpDataLayer.DatabaseModels public virtual DbSet Kits { get; set; } public virtual DbSet Odls { get; set; } public virtual DbSet Odls1 { get; set; } + public virtual DbSet Rcs { get; set; } public virtual DbSet Rs { get; set; } public virtual DbSet Rs1 { get; set; } - public virtual DbSet Rcs { get; set; } public virtual DbSet Tallies { get; set; } - public virtual DbSet TcStats { get; set; } - public virtual DbSet Tcrs { get; set; } - public virtual DbSet Tcrs1 { get; set; } public virtual DbSet TcrDays { get; set; } public virtual DbSet TcrDayTests { get; set; } + public virtual DbSet Tcrs { get; set; } + public virtual DbSet Tcrs1 { get; set; } + public virtual DbSet TcStats { get; set; } public virtual DbSet TestJasons { get; set; } public virtual DbSet
        Uls { get; set; } - public virtual DbSet VDdbs { get; set; } - public virtual DbSet VDdbLights { get; set; } +#endif + + #region Public Properties + public virtual DbSet VDdbLightOlds { get; set; } + public virtual DbSet VDdbLights { get; set; } + public virtual DbSet VDdbs { get; set; } public virtual DbSet VDdbTurnis { get; set; } + public virtual DbSet VEcpExtendeds { get; set; } public virtual DbSet VEcps { get; set; } public virtual DbSet VEcps1 { get; set; } - public virtual DbSet VEcpExtendeds { get; set; } + public virtual DbSet VetoTcs { get; set; } public virtual DbSet VKits { get; set; } public virtual DbSet VOdls { get; set; } public virtual DbSet VOdls1 { get; set; } public virtual DbSet VPodlNonChiusis { get; set; } + public virtual DbSet VRcs { get; set; } public virtual DbSet VRs { get; set; } public virtual DbSet VRs1 { get; set; } - public virtual DbSet VRcs { get; set; } - public virtual DbSet VTcStats { get; set; } + public virtual DbSet VTcrDays { get; set; } public virtual DbSet VTcrs { get; set; } public virtual DbSet VTcrs1 { get; set; } - public virtual DbSet VTcrDays { get; set; } + public virtual DbSet VTcStats { get; set; } public virtual DbSet VUls { get; set; } - public virtual DbSet VetoTcs { get; set; } + + #endregion Public Properties + + #region Private Methods + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); + + #endregion Private Methods + + #region Protected Methods protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { @@ -76,22 +96,23 @@ namespace MpDataLayer.DatabaseModels { modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS"); +#if false modelBuilder.Entity(entity => - { - entity.HasKey(e => e.Azione); + { + entity.HasKey(e => e.Azione); - entity.ToTable("AAUL"); + entity.ToTable("AAUL"); - entity.Property(e => e.Azione) - .HasMaxLength(50) - .HasDefaultValueSql("('ND')") - .HasComment("Azione dell'operatore"); + entity.Property(e => e.Azione) + .HasMaxLength(50) + .HasDefaultValueSql("('ND')") + .HasComment("Azione dell'operatore"); - entity.Property(e => e.Descrizione) - .IsRequired() - .HasMaxLength(50) - .HasDefaultValueSql("('')"); - }); + entity.Property(e => e.Descrizione) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + }); modelBuilder.Entity(entity => { @@ -871,6 +892,7 @@ namespace MpDataLayer.DatabaseModels .HasMaxLength(250) .HasDefaultValueSql("('')"); }); +#endif modelBuilder.Entity(entity => { @@ -1553,6 +1575,6 @@ namespace MpDataLayer.DatabaseModels OnModelCreatingPartial(modelBuilder); } - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); + #endregion Protected Methods } -} +} \ No newline at end of file diff --git a/MpDataLayer/MpDataLayer.csproj b/MpDataLayer/MpDataLayer.csproj index 7ed61e7f..dc2e3773 100644 --- a/MpDataLayer/MpDataLayer.csproj +++ b/MpDataLayer/MpDataLayer.csproj @@ -4,6 +4,34 @@ net5.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + From ea08fb4b7818fd0ceb7a9acf7e4eb4457e0dffc9 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 17 May 2021 13:18:15 +0200 Subject: [PATCH 005/158] Aggiunta lettura RAW dati scarti --- MP-STATS/Data/MpStatsService.cs | 72 +++++++++ MP-STATS/Pages/Controlli.razor | 14 +- MP-STATS/Pages/Index.razor | 10 +- MP-STATS/Pages/Scarti.razor | 60 ++++++- MP-STATS/Pages/Scarti.razor.cs | 146 ++++++++++++++++++ MP-STATS/Shared/NavMenu.razor | 14 +- MP-STATS/Startup.cs | 49 ++++-- MP-STATS/appsettings.json | 6 +- MpDataLayer/Controllers/MpStatsController.cs | 85 ++++++++++ .../{VRc.cs => ResControlli.cs} | 14 +- .../DatabaseModels/{VR.cs => ResScarti.cs} | 20 ++- .../{VUl.cs => UserActionLog.cs} | 18 ++- MpDataLayer/MoonPro_STATSContext.cs | 90 +++++++---- MpDataLayer/MpDataLayer.csproj | 23 ++- 14 files changed, 526 insertions(+), 95 deletions(-) create mode 100644 MP-STATS/Data/MpStatsService.cs create mode 100644 MP-STATS/Pages/Scarti.razor.cs create mode 100644 MpDataLayer/Controllers/MpStatsController.cs rename MpDataLayer/DatabaseModels/{VRc.cs => ResControlli.cs} (80%) rename MpDataLayer/DatabaseModels/{VR.cs => ResScarti.cs} (85%) rename MpDataLayer/DatabaseModels/{VUl.cs => UserActionLog.cs} (83%) diff --git a/MP-STATS/Data/MpStatsService.cs b/MP-STATS/Data/MpStatsService.cs new file mode 100644 index 00000000..df8ce951 --- /dev/null +++ b/MP-STATS/Data/MpStatsService.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Configuration; +using System.Text; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; +using MpDataLayer; + +namespace MP_STATS.Data +{ + public class MpStatsService + { + #region Private Fields + + private static IConfiguration _configuration; + private static ILogger _logger; + + #endregion Private Fields + + #region Protected Fields + + protected static string connStringBBM = ""; + protected static string connStringFatt = ""; + + #endregion Protected Fields + + #region Public Fields + + public static MpDataLayer.Controllers.MpStatsController dbController; + + #endregion Public Fields + + #region Public Constructors + + public MpStatsService(IConfiguration configuration, ILogger logger) + { + _logger = logger; + _configuration = configuration; + string connStr = _configuration.GetConnectionString("Mp.Stats"); + if (string.IsNullOrEmpty(connStr)) + { + _logger.LogError("ConnString empty!"); + } + else + { + dbController = new MpDataLayer.Controllers.MpStatsController(configuration); + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"DbController OK"); + //sb.AppendLine($"CST: {dbController.CustomersCount()} | CNT: {dbController.CountersCount()} | BSK: {dbController.BasketsCount()} | NGT: {dbController.NegotiationsCount()} | DOC: {dbController.DocsCount()} | ITM: {dbController.ItemsCount()} | RES: {dbController.ResourcesCount()}"); + _logger.LogInformation(sb.ToString()); + } + } + + #endregion Public Constructors + + #region Public Methods + + public void rollBackEdit(object item) + { + dbController.rollBackEntity(item); + } + + public Task ScartiGetAll(int numRecord, string searchVal = "") + { + return Task.FromResult(dbController.ScartiGetAll(numRecord, searchVal).ToArray()); + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/MP-STATS/Pages/Controlli.razor b/MP-STATS/Pages/Controlli.razor index 80019b0d..854bc248 100644 --- a/MP-STATS/Pages/Controlli.razor +++ b/MP-STATS/Pages/Controlli.razor @@ -1,5 +1,15 @@ -

        Controlli

        +@page "/controlli" + +@using MP_STATS.Components +@using MP_STATS.Data + +
        +
        Controlli
        +
        + elenco controlli +
        +
        @code { -} +} \ No newline at end of file diff --git a/MP-STATS/Pages/Index.razor b/MP-STATS/Pages/Index.razor index 2762d330..7e53c4fd 100644 --- a/MP-STATS/Pages/Index.razor +++ b/MP-STATS/Pages/Index.razor @@ -13,7 +13,7 @@
        - | | | | | | + | | |
        @@ -24,13 +24,7 @@
        @Anno
        -
        -
        - -
        -
        -
        - + @**@ diff --git a/MP-STATS/Pages/Scarti.razor b/MP-STATS/Pages/Scarti.razor index 31e1f24d..8ce0c777 100644 --- a/MP-STATS/Pages/Scarti.razor +++ b/MP-STATS/Pages/Scarti.razor @@ -1,5 +1,59 @@ -

        Scarti

        +@page "/scarti" -@code { +@using MP_STATS.Components +@using MP_STATS.Data -} +
        +
        Scarti
        +
        + @if (currRecord != null) + { + @**@ + } + @if (ListRecords == null) + { +

        Loading...

        + } + else + { + + + + @**@ + + + + + + + + + + + @foreach (var record in ListRecords) + { + + @**@ + + + + + + + + + } + +
        MacchinaDataODL/CommessaArticoloDescrizioneQtaOperatore
         @record.IdxMacchina@record.DataOra@record.IdxOdl | @record.KeyRichiesta@record.CodArticolo@record.Descrizione@record.CodArticolo@record.MatrOpr
        + } +
        + +
        \ No newline at end of file diff --git a/MP-STATS/Pages/Scarti.razor.cs b/MP-STATS/Pages/Scarti.razor.cs new file mode 100644 index 00000000..8a10dc37 --- /dev/null +++ b/MP-STATS/Pages/Scarti.razor.cs @@ -0,0 +1,146 @@ +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using MP_STATS.Data; +using System; +using System.Threading.Tasks; + +namespace MP_STATS.Pages +{ + public partial class Scarti : ComponentBase, IDisposable + { + #region Private Fields + + private MpDataLayer.DatabaseModels.ResScarti currRecord = null; + + private MpDataLayer.DatabaseModels.ResScarti[] ListRecords; + + #endregion Private Fields + + #region Private Properties + + private int numRecord { get; set; } = 10; + + #endregion Private Properties + + #region Protected Properties + + [Inject] + protected IJSRuntime JSRuntime { get; set; } + + [Inject] + protected MessageService MessageService { get; set; } + + [Inject] + protected NavigationManager NavManager { get; set; } + + [Inject] + protected MpStatsService StatService { get; set; } + + #endregion Protected Properties + + #region Protected Methods + + protected async Task ForceReload(int newNum) + { + numRecord = newNum; + ListRecords = await StatService.ScartiGetAll(numRecord, MessageService.SearchVal); + } + + protected override async Task OnInitializedAsync() + { + MessageService.ShowSearch = true; + MessageService.EA_SearchUpdated += OnSeachUpdated; + ListRecords = await StatService.ScartiGetAll(numRecord, MessageService.SearchVal); + } + + protected void ResetData() + { + StatService.rollBackEdit(currRecord); + currRecord = null; + } + + protected async Task UpdateData() + { + currRecord = null; + ListRecords = await StatService.ScartiGetAll(numRecord, MessageService.SearchVal); + } + + #endregion Protected Methods + + #region Public Methods + + public string checkSelect(DateTime DataOra, string IdxMacchina, string Causale) + { + string answ = ""; + if (currRecord != null) + { + try + { + answ = (currRecord.DataOra == DataOra && currRecord.IdxMacchina == IdxMacchina && currRecord.Causale == Causale) ? "table-info" : ""; + } + catch + { } + } + return answ; + } + + public void Dispose() + { + MessageService.EA_SearchUpdated -= OnSeachUpdated; + } + + public void OnSeachUpdated() + { + InvokeAsync(() => + { + UpdateData(); + StateHasChanged(); + }); + } + + #endregion Public Methods + +#if false + [Inject] + protected BBM_SelectData SelectData { get; set; } + + protected void CreateNew() + { + // recupero counter + string newCode = BBMService.CounterGetNext("EGW.B", 6); + DatabaseModels.BasketsModel newRecord = new DatabaseModels.BasketsModel() + { + CodBasket = newCode, + DataIns = DateTime.Now, + CustomerId = 1, + Descript = "New Basket" + }; + currBasket = newRecord; + } + + protected async Task Delete(SHERPA.BBM.DatabaseModels.BasketsModel currRecord) + { + if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler eliminare il Basket '{currRecord.CodBasket}'?")) + return; + + BBMService.BasketsDelete(currRecord); + await UpdateData(); + } + + protected void Edit(SHERPA.BBM.DatabaseModels.BasketsModel currRecord) + { + currBasket = currRecord; + } + + protected void ShowDocs(SHERPA.BBM.DatabaseModels.BasketsModel currRecord) + { + // salvo + SelectData.BasketId = currRecord.BasketId; + SelectData.NegotiationId = 0; + // rimando... + NavManager.NavigateTo("docs"); + } + +#endif + } +} \ No newline at end of file diff --git a/MP-STATS/Shared/NavMenu.razor b/MP-STATS/Shared/NavMenu.razor index c7710983..68368d26 100644 --- a/MP-STATS/Shared/NavMenu.razor +++ b/MP-STATS/Shared/NavMenu.razor @@ -12,19 +12,14 @@ Home - @**@ + @*