diff --git a/MP.Data/Controllers/MpStatsController.cs b/MP.Data/Controllers/MpStatsController.cs index cb2498ed..68a357fa 100644 --- a/MP.Data/Controllers/MpStatsController.cs +++ b/MP.Data/Controllers/MpStatsController.cs @@ -32,6 +32,21 @@ namespace MP.Data.Controllers #region Public Methods + /// + /// Elenco Azioni (decodifica) + /// + /// + public List ActionsGetAll() + { + List dbResult = new List(); + + dbResult = dbCtx + .DbSetActions + .ToList(); + + return dbResult; + } + public void Dispose() { // Clear database context diff --git a/MP.Data/DatabaseModels/Actions.cs b/MP.Data/DatabaseModels/Actions.cs new file mode 100644 index 00000000..171eff98 --- /dev/null +++ b/MP.Data/DatabaseModels/Actions.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Actions + { + #region Public Properties + + public string Azione { get; set; } + public string Class { get; set; } + public string Descrizione { get; set; } + + #endregion Public Properties + } +} \ No newline at end of file diff --git a/MP.Data/MoonPro_STATSContext.cs b/MP.Data/MoonPro_STATSContext.cs index a24410a0..079efed5 100644 --- a/MP.Data/MoonPro_STATSContext.cs +++ b/MP.Data/MoonPro_STATSContext.cs @@ -35,6 +35,7 @@ namespace MP.Data #region Public Properties + public virtual DbSet DbSetActions { get; set; } public virtual DbSet DbSetControlli { get; set; } public virtual DbSet DbSetScarti { get; set; } public virtual DbSet DbSetUserLog { get; set; } @@ -66,6 +67,28 @@ namespace MP.Data { 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.Class) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + + entity.Property(e => e.Descrizione) + .IsRequired() + .HasMaxLength(50) + .HasDefaultValueSql("('')"); + }); + modelBuilder.Entity(entity => { entity.HasNoKey(); diff --git a/MP.Stats/Data/MpStatsService.cs b/MP.Stats/Data/MpStatsService.cs index 34b74b1a..ee17cadd 100644 --- a/MP.Stats/Data/MpStatsService.cs +++ b/MP.Stats/Data/MpStatsService.cs @@ -17,6 +17,8 @@ namespace MP.Stats.Data private static IConfiguration _configuration; private static ILogger _logger; + private static List ActionsList = new List(); + #endregion Private Fields #region Protected Fields @@ -57,6 +59,11 @@ namespace MP.Stats.Data #region Public Methods + public Task ActionsGetAll() + { + return Task.FromResult(dbController.ActionsGetAll().ToArray()); + } + public void rollBackEdit(object item) { dbController.RollBackEntity(item); diff --git a/MP.Stats/Pages/Scarti.razor b/MP.Stats/Pages/Scarti.razor index e96035ac..eca78837 100644 --- a/MP.Stats/Pages/Scarti.razor +++ b/MP.Stats/Pages/Scarti.razor @@ -8,50 +8,53 @@
@if (currRecord != null) { - @**@ + @**@ } @if (ListRecords == null) { -
+
} else { - - - - - - - - - - - - - - @foreach (var record in ListRecords) +
MacchinaDataODL/CommessaArticoloDescrizioneQtaOperatore
+ + + + + + + + + + + + + @foreach (var record in ListRecords) { - - - - - - - - - + + + + + + + + + } - -
MacchinaDataODL/CommessaArticoloDescrizioneQtaOperatore
-
@record.CodMacchina
-
@record.IdxMacchina
-
-
@record.DataOraRif.ToString("yyyy.MM.dd")
-
@record.DataOraRif.ToString("ddd HH:mm.ss")
-
@record.IdxOdl | @record.KeyRichiesta@record.CodArticolo -
[@record.Causale] @record.Descrizione
-
@record.Note
-
@record.Qta@record.Cognome @record.Nome (@record.MatrOpr)
+
@record.CodMacchina
+
@record.IdxMacchina
+
+
@record.DataOraRif.ToString("yyyy.MM.dd")
+
@record.DataOraRif.ToString("ddd HH:mm.ss")
+
@record.IdxOdl | @record.KeyRichiesta@record.CodArticolo +
+
[@record.Causale]
+
@record.Descrizione
+
+
@record.Note
+
@record.Qta@record.Cognome @record.Nome (@record.MatrOpr)
+ + }