From 52e753ba1c92e0258c40a7cc2d4291b5aa0ff9c4 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 24 Apr 2024 13:00:40 +0200 Subject: [PATCH] Fix divieti PODL/ODL --- MP.SPEC/Components/ListODL.razor | 18 +++++++++-- MP.SPEC/Components/ListODL.razor.cs | 25 +++++++++++++++ MP.SPEC/Components/ListPODL.razor | 19 ++++++++--- MP.SPEC/Components/ListPODL.razor.cs | 47 ++++++++++++++++++++++------ MP.SPEC/Data/MpDataService.cs | 2 +- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/PODL.razor | 11 ++++++- MP.SPEC/Pages/PODL.razor.cs | 19 +++++++++++ MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 11 files changed, 126 insertions(+), 23 deletions(-) diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor index d2b97d30..83b35f54 100644 --- a/MP.SPEC/Components/ListODL.razor +++ b/MP.SPEC/Components/ListODL.razor @@ -15,10 +15,24 @@ else @if (currRecord != null && !showStats && isCurrOdl) {
- + @if(enableForceSync) + { + + } + else + { + + }
- + @if(enableStopODL) + { + + } + else + { + + }
}
diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 6fbc41f1..9f633f5a 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -61,6 +61,16 @@ namespace MP.SPEC.Components #endregion Public Methods + #region Protected Fields + + protected bool enableForceSync = true; + + protected bool enableStartPODL = true; + + protected bool enableStopODL = true; + + #endregion Protected Fields + #region Protected Properties [Inject] @@ -139,6 +149,21 @@ namespace MP.SPEC.Components protected override async Task OnInitializedAsync() { ListStati = await MDService.AnagStatiComm(); + string SPEC_PODL_gest = await MDService.ConfigTryGet("SPEC_PODL_gest"); + if (!string.IsNullOrEmpty(SPEC_PODL_gest)) + { + bool.TryParse(SPEC_PODL_gest, out enableStartPODL); + } + string SPEC_ODL_gest = await MDService.ConfigTryGet("SPEC_ODL_gest"); + if (!string.IsNullOrEmpty(SPEC_ODL_gest)) + { + bool.TryParse(SPEC_ODL_gest, out enableStopODL); + } + string SPEC_XODL_sync = await MDService.ConfigTryGet("SPEC_XODL_sync"); + if (!string.IsNullOrEmpty(SPEC_XODL_sync)) + { + bool.TryParse(SPEC_XODL_sync, out enableForceSync); + } } protected override async Task OnParametersSetAsync() diff --git a/MP.SPEC/Components/ListPODL.razor b/MP.SPEC/Components/ListPODL.razor index 0c8b8f00..67e21616 100644 --- a/MP.SPEC/Components/ListPODL.razor +++ b/MP.SPEC/Components/ListPODL.razor @@ -46,15 +46,24 @@ else @if (record.IdxOdl == 0) { - @if (canStartOdl(record.IdxMacchina)) + @if (enableStartPODL) { - + @if (canStartOdl(record.IdxMacchina)) + { + + } + else + { + + } } else { - } diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index b46cc52e..8aa61b6e 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -60,6 +60,16 @@ namespace MP.SPEC.Components #endregion Public Methods + #region Protected Fields + + protected bool enableForceSync = true; + + protected bool enableStartPODL = true; + + protected bool enableStopODL = true; + + #endregion Protected Fields + #region Protected Properties protected string header @@ -127,11 +137,36 @@ namespace MP.SPEC.Components showRecipeConf = true; } + protected async Task editRecord(PODLExpModel? selRec) + { + currRecord = selRec; + header = "Modifica PODL"; + await RecordEdit.InvokeAsync(selRec); + } + protected override async Task OnInitializedAsync() { ListStati = await MDService.AnagStatiComm(); - var strMachRecipe = await MDService.ConfigTryGet("MachineWithRecipe"); - bool.TryParse(strMachRecipe, out MachineWithRecipe); + string strMachRecipe = await MDService.ConfigTryGet("MachineWithRecipe"); + if (!string.IsNullOrEmpty(strMachRecipe)) + { + bool.TryParse(strMachRecipe, out MachineWithRecipe); + } + string SPEC_PODL_gest = await MDService.ConfigTryGet("SPEC_PODL_gest"); + if (!string.IsNullOrEmpty(SPEC_PODL_gest)) + { + bool.TryParse(SPEC_PODL_gest, out enableStartPODL); + } + string SPEC_ODL_gest = await MDService.ConfigTryGet("SPEC_ODL_gest"); + if (!string.IsNullOrEmpty(SPEC_ODL_gest)) + { + bool.TryParse(SPEC_ODL_gest, out enableStopODL); + } + string SPEC_XODL_sync = await MDService.ConfigTryGet("SPEC_XODL_sync"); + if (!string.IsNullOrEmpty(SPEC_XODL_sync)) + { + bool.TryParse(SPEC_XODL_sync, out enableForceSync); + } } protected override async Task OnParametersSetAsync() @@ -184,14 +219,6 @@ namespace MP.SPEC.Components await RecordEdit.InvokeAsync(null); } - - protected async Task editRecord(PODLExpModel? selRec) - { - currRecord = selRec; - header = "Modifica PODL"; - await RecordEdit.InvokeAsync(selRec); - } - protected async Task selRecord(PODLExpModel? selRec) { currRecord = selRec; diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 49fae3d7..4745597d 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -443,7 +443,7 @@ namespace MP.SPEC.Data return answ; } - + /// /// Update chiave config /// diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 0638caf0..d0c341f2 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2404.2411 + 6.16.2404.2412 1800a78a-6ff1-40f9-b490-87fb8bfc1394 diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index ad2528b9..25ab86d7 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -261,7 +261,16 @@
- + @if (enableForceSync) + { + + } + else + { + + }
} diff --git a/MP.SPEC/Pages/PODL.razor.cs b/MP.SPEC/Pages/PODL.razor.cs index 47c0a2ef..69382b78 100644 --- a/MP.SPEC/Pages/PODL.razor.cs +++ b/MP.SPEC/Pages/PODL.razor.cs @@ -115,8 +115,27 @@ namespace MP.SPEC.Pages currAzienda = await MDService.ConfigTryGet("AZIENDA"); padCodXdl = await MDService.ConfigTryGet("padCodXdl"); useFasi4KeyRich = await MDService.ConfigTryGet("SPEC_KeyRichiesta"); + // carico opzioni gestione PODL/ODL/sync + string SPEC_PODL_gest = await MDService.ConfigTryGet("SPEC_PODL_gest"); + if (!string.IsNullOrEmpty(SPEC_PODL_gest)) + { + bool.TryParse(SPEC_PODL_gest, out enableStartPODL); + } + string SPEC_ODL_gest = await MDService.ConfigTryGet("SPEC_ODL_gest"); + if (!string.IsNullOrEmpty(SPEC_ODL_gest)) + { + bool.TryParse(SPEC_ODL_gest, out enableStopODL); + } + string SPEC_XODL_sync = await MDService.ConfigTryGet("SPEC_XODL_sync"); + if (!string.IsNullOrEmpty(SPEC_XODL_sync)) + { + bool.TryParse(SPEC_XODL_sync, out enableForceSync); + } } + protected bool enableStartPODL = true; + protected bool enableStopODL = true; + protected bool enableForceSync = true; protected string useFasi4KeyRich { get; set; } = ""; protected override async Task OnParametersSetAsync() diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index febfdeff..828b6965 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2404.2411

+

Versione: 6.16.2404.2412


Note di rilascio: