Bozza gestione DDB
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class DdbTurni
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string ClasseTempo { get; set; }
|
||||
public string CodArticolo { get; set; }
|
||||
public string CodMacchina { get; set; }
|
||||
public DateTime DataRif { get; set; }
|
||||
public DateTime? DataTurnoFine { get; set; }
|
||||
public DateTime? DataTurnoInizio { get; set; }
|
||||
public string Descrizione { get; set; }
|
||||
public long? DurataPeriodo { get; set; }
|
||||
public long? DurataStato { get; set; }
|
||||
public DateTime? FinePeriodo { get; set; }
|
||||
public DateTime FineStato { get; set; }
|
||||
public string IdxMacchina { get; set; }
|
||||
public int? IdxOdl { get; set; }
|
||||
public int IdxStato { get; set; }
|
||||
public DateTime InizioPeriodo { get; set; }
|
||||
public DateTime InizioStato { get; set; }
|
||||
public string KeyRichiesta { get; set; }
|
||||
public string Pallet { get; set; }
|
||||
public int? PzPalletProd { get; set; }
|
||||
public decimal? TempoCicloBase { get; set; }
|
||||
public int TotPzProd { get; set; }
|
||||
public string Turno { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -35,8 +35,9 @@ namespace MP.Data
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public virtual DbSet<Actions> DbSetActions { get; set; }
|
||||
public virtual DbSet<AzioniUL> DbSetAzioniUL { get; set; }
|
||||
public virtual DbSet<ResControlli> DbSetControlli { get; set; }
|
||||
public virtual DbSet<DdbTurni> DbSetDdbTurni { get; set; }
|
||||
public virtual DbSet<ResScarti> DbSetScarti { get; set; }
|
||||
public virtual DbSet<UserActionLog> DbSetUserLog { get; set; }
|
||||
|
||||
@@ -57,8 +58,6 @@ namespace MP.Data
|
||||
string connString = _configuration.GetConnectionString("Mp.Stats");
|
||||
|
||||
optionsBuilder.UseSqlServer(_configuration.GetConnectionString("Mp.Stats"));
|
||||
|
||||
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
|
||||
//optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;");
|
||||
}
|
||||
}
|
||||
@@ -67,7 +66,56 @@ namespace MP.Data
|
||||
{
|
||||
modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS");
|
||||
|
||||
modelBuilder.Entity<Actions>(entity =>
|
||||
modelBuilder.Entity<DdbTurni>(entity =>
|
||||
{
|
||||
entity.HasNoKey();
|
||||
|
||||
entity.ToView("v_UI_DDB_Turni");
|
||||
|
||||
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.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.IdxMacchina)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
|
||||
|
||||
entity.Property(e => e.InizioPeriodo).HasColumnType("datetime");
|
||||
|
||||
entity.Property(e => e.InizioStato).HasColumnType("datetime");
|
||||
|
||||
entity.Property(e => e.KeyRichiesta).HasMaxLength(50);
|
||||
|
||||
entity.Property(e => e.Pallet)
|
||||
.HasMaxLength(20)
|
||||
.HasColumnName("pallet");
|
||||
|
||||
entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)");
|
||||
|
||||
entity.Property(e => e.Turno)
|
||||
.IsRequired()
|
||||
.HasMaxLength(5);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<AzioniUL>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Azione);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace MP.Stats.Data
|
||||
private static IConfiguration _configuration;
|
||||
private static ILogger<MpStatsService> _logger;
|
||||
|
||||
private static List<MP.Data.DatabaseModels.Actions> ActionsList = new List<MP.Data.DatabaseModels.Actions>();
|
||||
private static List<MP.Data.DatabaseModels.AzioniUL> ActionsList = new List<MP.Data.DatabaseModels.AzioniUL>();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace MP.Stats.Data
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public Task<MP.Data.DatabaseModels.Actions[]> ActionsGetAll()
|
||||
public Task<MP.Data.DatabaseModels.AzioniUL[]> ActionsGetAll()
|
||||
{
|
||||
return Task.FromResult(dbController.ActionsGetAll().ToArray());
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
@using MP.Stats.Data
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header table-primary h1">Controlli</div>
|
||||
<div class="card-header table-primary h1">Diario Produzione</div>
|
||||
<div class="card-body">
|
||||
@if (currRecord != null)
|
||||
{
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace MP.Stats.Pages
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private MP.Data.DatabaseModels.ResControlli currRecord = null;
|
||||
private MP.Data.DatabaseModels.DdbTurni currRecord = null;
|
||||
|
||||
private MP.Data.DatabaseModels.ResControlli[] ListRecords;
|
||||
private MP.Data.DatabaseModels.DdbTurni[] ListRecords;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace MP.Stats.Pages
|
||||
protected async Task ForceReload(int newNum)
|
||||
{
|
||||
numRecord = newNum;
|
||||
ListRecords = await StatService.StatControlliGetAll(numRecord, MessageService.SearchVal);
|
||||
ListRecords = await StatService.StatDdbGetAll(numRecord, MessageService.SearchVal);
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
@@ -51,7 +51,7 @@ namespace MP.Stats.Pages
|
||||
numRecord = 10;
|
||||
MessageService.ShowSearch = true;
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
ListRecords = await StatService.StatControlliGetAll(numRecord, MessageService.SearchVal);
|
||||
ListRecords = await StatService.StatDdbGetAll(numRecord, MessageService.SearchVal);
|
||||
}
|
||||
|
||||
protected void ResetData()
|
||||
@@ -63,21 +63,21 @@ namespace MP.Stats.Pages
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
ListRecords = await StatService.StatControlliGetAll(numRecord, MessageService.SearchVal);
|
||||
ListRecords = await StatService.StatDdbGetAll(numRecord, MessageService.SearchVal);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public string checkSelect(int IdxControllo)
|
||||
public string checkSelect(string IdxMacchina, string CodArticolo, DateTime InizioStato)
|
||||
{
|
||||
string answ = "";
|
||||
if (currRecord != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = (currRecord.IdxControllo == IdxControllo) ? "table-info" : "";
|
||||
answ = (currRecord.IdxMacchina == IdxMacchina && currRecord.CodArticolo == CodArticolo && currRecord.InizioStato == InizioStato) ? "table-info" : "";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace MP.Stats.Pages
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private MP.Data.DatabaseModels.Actions[] ActionsList;
|
||||
private MP.Data.DatabaseModels.AzioniUL[] ActionsList;
|
||||
private MP.Data.DatabaseModels.UserActionLog currRecord = null;
|
||||
|
||||
private MP.Data.DatabaseModels.UserActionLog[] ListRecords;
|
||||
@@ -97,13 +97,13 @@ namespace MP.Stats.Pages
|
||||
return answ;
|
||||
}
|
||||
|
||||
public MP.Data.DatabaseModels.Actions decodeAction(string azione)
|
||||
public MP.Data.DatabaseModels.AzioniUL decodeAction(string azione)
|
||||
{
|
||||
// cerco
|
||||
MP.Data.DatabaseModels.Actions data = ActionsList
|
||||
MP.Data.DatabaseModels.AzioniUL data = ActionsList
|
||||
.Where(x => x.Azione == azione)
|
||||
.FirstOrDefault();
|
||||
data = data != null ? data : new MP.Data.DatabaseModels.Actions() { Azione = "ND", Class = "", Descrizione = "ND" };
|
||||
data = data != null ? data : new MP.Data.DatabaseModels.AzioniUL() { Azione = "ND", Class = "", Descrizione = "ND" };
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user