diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index 64ed599f..dfc264e2 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -199,7 +199,10 @@ namespace MP.SPEC.Components ListRecords = null; isLoading = true; SearchRecords = await MDService.POdlListGetFilt(hasOdl, StatoSel, macchina, reparto, selDtStart, selDtEnd); - totalCount = SearchRecords.Count; + if (totalCount != SearchRecords.Count) + { + totalCount = SearchRecords.Count; + } ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); await Task.Delay(1); await InvokeAsync(() => StateHasChanged()); @@ -331,7 +334,7 @@ namespace MP.SPEC.Components #region Private Properties - private int _totalCount { get; set; } = 0; + private int _totalCount { get; set; } = -1; private int currPage { diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 7ca4bee6..16873a74 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2411.408 + 6.16.2411.610 1800a78a-6ff1-40f9-b490-87fb8bfc1394 en diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index 4de7b9d6..aedbc78a 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -57,7 +57,7 @@ - + @if (currRecord != null) @@ -294,6 +294,6 @@ } \ No newline at end of file diff --git a/MP.SPEC/Pages/PODL.razor.cs b/MP.SPEC/Pages/PODL.razor.cs index 689c44f7..938987e3 100644 --- a/MP.SPEC/Pages/PODL.razor.cs +++ b/MP.SPEC/Pages/PODL.razor.cs @@ -16,6 +16,9 @@ namespace MP.SPEC.Pages { #region Protected Fields + protected bool enableForceSync = true; + protected bool enableStartPODL = true; + protected bool enableStopODL = true; protected DataPager? pagerODL = null!; protected bool reqNew = false; @@ -24,6 +27,34 @@ namespace MP.SPEC.Pages #region Protected Properties + protected string addMessage + { + get => addEnabled ? "" : "Manca Selezione Impianto / Fase"; + } + + protected bool canSaveEdit + { + get + { + bool answ = false; + if (currRecord != null) + { + // controllo le condizioni di selezione fase + bool okSelReparto = (useFasi4KeyRich == "FASE" && selReparto != "*") || useFasi4KeyRich != "FASE"; + // controllo condizione record valido + bool okCurrRecord = currRecord.CodArticolo != "" && currRecord.CodFase != "" && currRecord.IdxMacchina != ""; + answ = okCurrRecord && okSelReparto; + } + return answ; + } + } + + protected string header + { + get => currFilter.Header; + set => currFilter.Header = value; + } + [Inject] protected IJSRuntime JSRuntime { get; set; } = null!; @@ -39,6 +70,8 @@ namespace MP.SPEC.Pages [Inject] protected NavigationManager NavManager { get; set; } = null!; + protected string useFasi4KeyRich { get; set; } = ""; + #endregion Protected Properties #region Protected Methods @@ -59,32 +92,28 @@ namespace MP.SPEC.Pages protected async Task cancel() { currRecord = null; - await reloadData(); + await ReloadData(); await Task.Delay(1); } - protected void resetFase() + protected async Task editRecord(PODLExpModel selRec) { - StatoSel = "*"; + canEdit = true; + // preseleziono ricerca articolo + artSearch = selRec.CodArticolo; + currRecord = selRec; + await Task.Delay(1); } - protected void resetMacchina() + protected async Task forceSyncDb() { - macchina = "*"; - } - protected void resetReparto() - { - selReparto = "*"; - } + if (!await JSRuntime.InvokeAsync("confirm", "Sei sicuro di voler (re)inviare i dati (Articoli, PODL) all'impianto?")) + return; - protected void ForceReload(int newNum) - { - numRecord = newNum; - } - - protected void ForceReloadPage(int newNum) - { - currPage = newNum; + var clonedRec = MP.Data.Utils.POdlExt.convertToPOdl(currRecord); + await callSyncDb(clonedRec); + currRecord = null; + NavManager.NavigateTo(NavManager.Uri, true); } protected async Task getReparto() @@ -133,15 +162,10 @@ namespace MP.SPEC.Pages } } - protected bool enableStartPODL = true; - protected bool enableStopODL = true; - protected bool enableForceSync = true; - protected string useFasi4KeyRich { get; set; } = ""; - protected override async Task OnParametersSetAsync() { // carico dati - await reloadData(); + await ReloadData(); } protected async Task pgResetReq(bool doReset) @@ -156,11 +180,6 @@ namespace MP.SPEC.Pages } } - protected string addMessage - { - get => addEnabled ? "" : "Manca Selezione Impianto / Fase"; - } - /// /// Crea nuovo record e va in editing... /// @@ -202,14 +221,21 @@ namespace MP.SPEC.Pages await Task.Delay(1); } - protected async Task editRecord(PODLExpModel selRec) + protected void resetFase() { - canEdit = true; - // preseleziono ricerca articolo - artSearch = selRec.CodArticolo; - currRecord = selRec; - await Task.Delay(1); + StatoSel = "*"; } + + protected void resetMacchina() + { + macchina = "*"; + } + + protected void resetReparto() + { + selReparto = "*"; + } + protected async Task selRecord(PODLExpModel selRec) { canEdit = false; @@ -217,6 +243,16 @@ namespace MP.SPEC.Pages await Task.Delay(1); } + protected void SetNumRec(int newNum) + { + numRecord = newNum; + } + + protected void SetPage(int newNum) + { + currPage = newNum; + } + protected async Task toggleClosed() { hasOdl = !hasOdl; @@ -229,6 +265,12 @@ namespace MP.SPEC.Pages return; await Task.Delay(1); var clonedRec = MP.Data.Utils.POdlExt.convertToPOdl(selRec); + // se x qualche motivo mancasse codGruppo --> sistemo! + if(string.IsNullOrEmpty(clonedRec.CodGruppo)) + { + clonedRec.CodGruppo = currGruppoSel.CodGruppo; + Log.Error($"CodGruppo mancante: messo valore selezionato: {currGruppoSel.CodGruppo}"); + } // se selezionato sovrascrivo... if (useFasi4KeyRich == "FASE") { @@ -244,17 +286,6 @@ namespace MP.SPEC.Pages NavManager.NavigateTo(NavManager.Uri, true); } - protected async Task forceSyncDb() - { - if (!await JSRuntime.InvokeAsync("confirm", "Sei sicuro di voler (re)inviare i dati (Articoli, PODL) all'impianto?")) - return; - - var clonedRec = MP.Data.Utils.POdlExt.convertToPOdl(currRecord); - await callSyncDb(clonedRec); - currRecord = null; - NavManager.NavigateTo(NavManager.Uri, true); - } - protected void UpdateTotCount(int newTotCount) { totalCount = newTotCount; @@ -268,10 +299,8 @@ namespace MP.SPEC.Pages private PODLExpModel? _currRecord = null; - private PODLExpModel currRecordControlli = new PODLExpModel(); - private AnagGruppi currGruppoSel = new AnagGruppi(); - + private PODLExpModel currRecordControlli = new PODLExpModel(); private List? ListArticoli; private List? ListAziende; @@ -295,7 +324,7 @@ namespace MP.SPEC.Pages get { //bool answ = currFase != "*"; - bool answ = (useFasi4KeyRich == "FASE" && currFase != "*") || (useFasi4KeyRich != "FASE" && selReparto!="*"); + bool answ = (useFasi4KeyRich == "FASE" && currFase != "*") || (useFasi4KeyRich != "FASE" && selReparto != "*"); return answ; } } @@ -310,7 +339,7 @@ namespace MP.SPEC.Pages _artSearch = value; var pUpd = Task.Run(async () => { - await reloadData(); + await ReloadData(); }); pUpd.Wait(); } @@ -322,6 +351,7 @@ namespace MP.SPEC.Pages get => currArticolo == "" ? "Sel Articolo" : "Nuovo PODL"; } + private bool canEdit { get; set; } = false; private string currArticolo { get; set; } = ""; private string currAzienda @@ -334,7 +364,7 @@ namespace MP.SPEC.Pages _currAzienda = value; var pUpd = Task.Run(async () => { - await reloadData(); + await ReloadData(); }); pUpd.Wait(); } @@ -353,30 +383,6 @@ namespace MP.SPEC.Pages } } } - private DateTime selDtStart - { - get => currFilter.DtStart; - set - { - if (!currFilter.DtStart.Equals(value)) - { - currFilter.DtStart = value; - currPage = 1; - } - } - } - private DateTime selDtEnd - { - get => currFilter.DtEnd; - set - { - if (!currFilter.DtEnd.Equals(value)) - { - currFilter.DtEnd = value; - currPage = 1; - } - } - } private SelectXdlParams currFilter { get; set; } = new SelectXdlParams(); @@ -386,8 +392,6 @@ namespace MP.SPEC.Pages set => currFilter.CurrPage = value; } - private bool canEdit { get; set; } = false; - private PODLExpModel? currRecord { get => _currRecord; @@ -395,11 +399,16 @@ namespace MP.SPEC.Pages { _currRecord = value; #if false - artSearch = value == null ? "" : value.CodArticolo.Substring(0, 2); + artSearch = value == null ? "" : value.CodArticolo.Substring(0, 2); #endif } } + private bool filtActive + { + get => macchina != "*" || StatoSel != "*" || selReparto != "*"; + } + private bool hasOdl { get => currFilter.HasOdl; @@ -428,6 +437,32 @@ namespace MP.SPEC.Pages private string padCodXdl { get; set; } = "00000"; + private DateTime selDtEnd + { + get => currFilter.DtEnd; + set + { + if (!currFilter.DtEnd.Equals(value)) + { + currFilter.DtEnd = value; + currPage = 1; + } + } + } + + private DateTime selDtStart + { + get => currFilter.DtStart; + set + { + if (!currFilter.DtStart.Equals(value)) + { + currFilter.DtStart = value; + currPage = 1; + } + } + } + private string selReparto { get => currFilter.CodReparto; @@ -446,16 +481,10 @@ namespace MP.SPEC.Pages set => currFilter.TotCount = value; } - private bool filtActive - { - get => macchina != "*" || StatoSel != "*" || selReparto != "*"; - } - #endregion Private Properties #region Private Methods - /// /// Chiama metodo x chiedere sync DB /// @@ -476,7 +505,7 @@ namespace MP.SPEC.Pages } } - private async Task reloadData() + private async Task ReloadData() { isLoading = true; await Task.Delay(1); @@ -492,36 +521,15 @@ namespace MP.SPEC.Pages } isLoading = false; } - protected bool canSaveEdit - { - get - { - bool answ = false; - if (currRecord != null) - { - // controllo le condizioni di selezione fase - bool okSelReparto = (useFasi4KeyRich == "FASE" && selReparto != "*") || useFasi4KeyRich != "FASE"; - // controllo condizione record valido - bool okCurrRecord = currRecord.CodArticolo != "" && currRecord.CodFase != "" && currRecord.IdxMacchina != ""; - answ = okCurrRecord && okSelReparto; - } - return answ; - } - } - protected string header - { - get => currFilter.Header; - set => currFilter.Header = value; - } - private async Task updateFilter(SelectXdlParams newParams) + private async Task UpdateFilter(SelectXdlParams newParams) { isLoading = true; await Task.Delay(1); currPage = 1; // salvo comunque filtro reparto x utente await localStorage.SetItemAsync("reparto", selReparto); - await reloadData(); + await ReloadData(); await Task.Delay(1); await InvokeAsync(() => StateHasChanged()); currFilter = newParams; diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 9645830e..d6980581 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2411.408

+

Versione: 6.16.2411.610


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index a2057af4..569670cf 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2411.408 +6.16.2411.610 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 080012af..c0486d9d 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2411.408 + 6.16.2411.610 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