From c71a6c7c67328e756b67aa1f546eeb8f072b74a3 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 24 Nov 2022 10:14:40 +0100 Subject: [PATCH] Fix display selettore --- MP.SPEC/Components/ListPODL.razor | 63 +++++++++++++++++++--------- MP.SPEC/Components/ListPODL.razor.cs | 14 ++++--- MP.SPEC/Data/MpDataService.cs | 21 ++++++++++ MP.SPEC/Data/SelectGlobalToggle.cs | 2 +- MP.SPEC/Data/SelectPOdlParams.cs | 2 +- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/Articoli.razor.cs | 10 ++++- MP.SPEC/Pages/Index.razor.cs | 9 +++- MP.SPEC/Pages/PODL.razor | 10 ++--- MP.SPEC/Pages/PODL.razor.cs | 29 +++++-------- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 13 files changed, 110 insertions(+), 58 deletions(-) diff --git a/MP.SPEC/Components/ListPODL.razor b/MP.SPEC/Components/ListPODL.razor index c8188a62..b27a5106 100644 --- a/MP.SPEC/Components/ListPODL.razor +++ b/MP.SPEC/Components/ListPODL.razor @@ -36,31 +36,54 @@ else @foreach (var record in ListRecords) { - - @if (canStartOdl(record.IdxMacchina)) - { - - } - else - { - - } + - @if (canStartOdl(record.IdxMacchina)) + @if (record.IdxOdl == 0) { - - } - else - { - + @if (canStartOdl(record.IdxMacchina)) + { + + } + else + { + + } + @if (canStartOdl(record.IdxMacchina)) + { + + } + else + { + + } } -
PODL @($"{record.IdxPromessa:000000}")
+
+
+
+ PODL +
+
+ @($"{record.IdxPromessa.ToString(padCodXdl)}") +
+
+ @if (record.IdxOdl > 0) + { +
+
+ ODL +
+
+ @($"{record.IdxOdl.ToString(padCodXdl)}") +
+
+ } +
@record.CodArticolo diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index 9417a97e..0e946e2f 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -14,6 +14,9 @@ namespace MP.SPEC.Components [Parameter] public SelectPOdlParams actFilter { get; set; } = new SelectPOdlParams(); + [Parameter] + public string padCodXdl { get; set; } = "0000"; + [Parameter] public EventCallback PagerResetReq { get; set; } @@ -239,6 +242,12 @@ namespace MP.SPEC.Components set => actFilter.CurrPage = value; } + private bool hasOdl + { + get => actFilter.hasOdl; + set => actFilter.hasOdl = value; + } + private bool isLoading { get; set; } = false; private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 }; @@ -258,11 +267,6 @@ namespace MP.SPEC.Components get => actFilter.CodFase; set => actFilter.CodFase = value; } - private bool hasOdl - { - get => actFilter.hasOdl; - set => actFilter.hasOdl = value; - } private int totalCount { diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index f35aab87..e3810edd 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -312,6 +312,27 @@ namespace MP.SPEC.Data return result; } + /// + /// Restituisce valore della stringa (SE disponibile) + /// + /// + /// + public async Task tryGetConfig(string keyName) + { + string answ = ""; + // preselezione valori + var configData = await ConfigGetAll(); + var currRec = configData.FirstOrDefault(x => x.Chiave == keyName); + if (currRec != null) + { + answ = currRec.Valore; + } + + return answ; + } + + + /// /// Reset dati cache config /// diff --git a/MP.SPEC/Data/SelectGlobalToggle.cs b/MP.SPEC/Data/SelectGlobalToggle.cs index 527bc25a..53f19dfe 100644 --- a/MP.SPEC/Data/SelectGlobalToggle.cs +++ b/MP.SPEC/Data/SelectGlobalToggle.cs @@ -12,7 +12,7 @@ #region Public Properties /// - /// Bool: indica se il toggle è attivo + /// Bool: indica se il toggleClosed è attivo /// public bool isActive { get; set; } = true; diff --git a/MP.SPEC/Data/SelectPOdlParams.cs b/MP.SPEC/Data/SelectPOdlParams.cs index bd0b8706..7d8b35f4 100644 --- a/MP.SPEC/Data/SelectPOdlParams.cs +++ b/MP.SPEC/Data/SelectPOdlParams.cs @@ -26,7 +26,7 @@ namespace MP.SPEC.Data public string SearchVal { get; set; } = "*"; public int TotCount { get; set; } = 0; - public bool hasOdl { get; set; } = true; + public bool hasOdl { get; set; } = false; #endregion Public Properties diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index d553f415..45554cf4 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2211.2409 + 6.16.2211.2410 diff --git a/MP.SPEC/Pages/Articoli.razor.cs b/MP.SPEC/Pages/Articoli.razor.cs index a558357a..c69fc1ca 100644 --- a/MP.SPEC/Pages/Articoli.razor.cs +++ b/MP.SPEC/Pages/Articoli.razor.cs @@ -129,12 +129,15 @@ namespace MP.SPEC.Pages protected override async Task OnInitializedAsync() { numRecord = 10; +#if false configData = await MDService.ConfigGetAll(); var currRec = configData.FirstOrDefault(x => x.Chiave == "AZIENDA"); if (currRec != null) { selAzienda = currRec.Valore; - } + } +#endif + selAzienda = await MDService.tryGetConfig("AZIENDA"); ListAziende = await MDService.ElencoAziende(); ListTipoArt = await MDService.AnagTipoArtLV(); } @@ -210,7 +213,10 @@ namespace MP.SPEC.Pages private int _currPage { get; set; } = 1; private int _numRecord { get; set; } = 10; - private List? configData { get; set; } = null; + +#if false + private List? configData { get; set; } = null; +#endif private int currPage { diff --git a/MP.SPEC/Pages/Index.razor.cs b/MP.SPEC/Pages/Index.razor.cs index 0751fffd..1193385d 100644 --- a/MP.SPEC/Pages/Index.razor.cs +++ b/MP.SPEC/Pages/Index.razor.cs @@ -30,6 +30,7 @@ namespace MP.SPEC.Pages MessageService.ShowSearch = false; // recupero elenco JQM ElencoLink = await MDService.ElencoLink(); +#if false configData = await MDService.ConfigGetAll(); if (configData != null) { @@ -38,7 +39,9 @@ namespace MP.SPEC.Pages { currAzienda = currRec.Valore; } - } + } +#endif + currAzienda = await MDService.tryGetConfig("AZIENDA"); await Task.Delay(1); } @@ -52,7 +55,9 @@ namespace MP.SPEC.Pages #region Private Properties - private List? configData { get; set; } = null; +#if false + private List? configData { get; set; } = null; +#endif #endregion Private Properties } diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index 1c008e71..3bcdd3c7 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -12,11 +12,11 @@
- Con ODL + Da Produrre
- +
- Senza ODL + Lanciati
@@ -191,7 +191,7 @@ Attivabile
- +
@@ -264,7 +264,7 @@ } else { - + }