diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index c9e62483..f5cc5192 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -196,18 +196,18 @@ namespace MP.Data.Controllers /// Statistiche ODL calcolate (da stored stp_STAT_ODL) /// /// - public List StatOdl(int IdxOdl) + public async Task> StatOdl(int IdxOdl) { List dbResult = new List(); using (var dbCtx = new MoonProContext(_configuration)) { var IdxODL = new SqlParameter("@IdxODL", IdxOdl); - dbResult = dbCtx + dbResult = await dbCtx .DbSetStatOdl .FromSqlRaw("EXEC stp_STAT_ODL @IdxODL", IdxODL) .AsNoTracking() - .ToList(); + .ToListAsync(); } return dbResult; } diff --git a/MP.Data/DatabaseModels/StatODLModel.cs b/MP.Data/DatabaseModels/StatODLModel.cs index 0b945381..2594af04 100644 --- a/MP.Data/DatabaseModels/StatODLModel.cs +++ b/MP.Data/DatabaseModels/StatODLModel.cs @@ -16,10 +16,10 @@ namespace MP.Data.DatabaseModels [Key] public int IdxStato { get; set; } - public string DescrizioneCodArticolo { get; set; } = ""; + public string Descrizione { get; set; } = ""; public string Semaforo { get; set; } public string Css { get; set; } - public decimal TotDurata { get; set; } + public double TotDurata { get; set; } #endregion Public Properties } diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor index 588e26b6..324958d1 100644 --- a/MP.SPEC/Components/ListODL.razor +++ b/MP.SPEC/Components/ListODL.razor @@ -27,7 +27,7 @@ else @foreach (var record in ListRecords) { - + @record.CodArticolo @record.ArticoloNav.DescArticolo @@ -83,9 +83,8 @@ else @record.DurataMinuti - + selectRecord(record)" data-bs-toggle="modal" data-bs-target="#staticBackdrop" title="Mostra statistiche"> - @@ -95,8 +94,19 @@ else - - + @if (currRecord != null) + { + ODL @currRecord.IdxOdl + @if (ListOdlStats != null) + { + + @foreach (var statRecord in ListOdlStats) + { + @statRecord.Descrizione - @($"{statRecord.TotDurata:N1}min") + } + + } + } diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 96f1fb8b..f3a49651 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using MP.Data.DatabaseModels; using MP.SPEC.Data; +using Newtonsoft.Json.Linq; namespace MP.SPEC.Components { @@ -22,14 +23,14 @@ namespace MP.SPEC.Components #region Public Methods - public string checkSelect(string CodArticolo) + public string checkSelect(int IdxOdl) { string answ = ""; if (currRecord != null) { try { - answ = (currRecord.CodArticolo == CodArticolo) ? "table-info" : ""; + answ = (currRecord.IdxOdl == IdxOdl) ? "table-info" : ""; } catch { } @@ -39,8 +40,10 @@ namespace MP.SPEC.Components public void Dispose() { +#if false MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated; - MessageService.EA_SearchUpdated -= OnSeachUpdated; + MessageService.EA_SearchUpdated -= OnSeachUpdated; +#endif } #endregion Public Methods @@ -88,7 +91,10 @@ namespace MP.SPEC.Components protected async Task UpdateData() { - currRecord = null; +#if false + currRecord = null; +#endif + await selectRecord(null); await reloadData(); } @@ -97,9 +103,25 @@ namespace MP.SPEC.Components #region Private Fields private ODLModel? currRecord = null; + + protected async Task selectRecord(ODLModel? currRec) + { + await Task.Delay(1); + currRecord = currRec; + if (currRec != null) + { + ListOdlStats = await MDService.StatOdl(currRec.IdxOdl); + } + else + { + ListOdlStats = null; + } + } + private List? ListRecords; private List? ListStati; private List? SearchRecords; + private List? ListOdlStats; #endregion Private Fields diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 4626e1ad..76c82b81 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -408,6 +408,16 @@ namespace MP.SPEC.Data return Task.FromResult(dbController.AnagGruppiAziende()); } + + /// + /// Statistiche ODL calcolate (da stored stp_STAT_ODL) + /// + /// + public Task> StatOdl(int IdxOdl) + { + return dbController.StatOdl(IdxOdl); + } + /// /// Restitusice elenco fasi /// diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 1bb77575..fdbcc114 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.1008 + 6.16.2210.1009 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index de81bd81..6cee31e2 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC - Versione: 6.16.2210.1008 + Versione: 6.16.2210.1009 Note di rilascio: diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 37afe883..190af7fd 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1008 +6.16.2210.1009 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 4bc73882..61b8efbb 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1008 + 6.16.2210.1009 https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html false