From 79c73db726dd74318d4b10dfd172d6ecd1001da6 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 3 Nov 2022 12:28:06 +0100 Subject: [PATCH 01/16] Fix reload apgina --- MP.SPEC/Components/CmpTop.razor | 6 +++--- MP.SPEC/Components/ListDossiers.razor.cs | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/MP.SPEC/Components/CmpTop.razor b/MP.SPEC/Components/CmpTop.razor index 4ac9d6d0..4e8840bd 100644 --- a/MP.SPEC/Components/CmpTop.razor +++ b/MP.SPEC/Components/CmpTop.razor @@ -70,9 +70,9 @@ { await Task.Delay(1); await MDService.FlushRedisCache(); - await JSRuntime.InvokeAsync("location.reload"); - // rimando a home - //NavManager.NavigateTo("", true); + await Task.Delay(1); + // rimando a pagina corrente + NavManager.NavigateTo(NavManager.Uri, true); } [Inject] diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index 2e88dc72..2ce67f94 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -168,12 +168,15 @@ namespace MP.SPEC.Components { currFluxLogDto = null; await Task.Delay(1); - await JSRuntime.InvokeAsync("location.reload"); - + // rimando a pagina corrente + NavManager.NavigateTo(NavManager.Uri, true); } } + [Inject] + private NavigationManager NavManager { get; set; } = null!; + protected override async Task OnInitializedAsync() { ListStati = await MDService.AnagStatiComm(); From c71d7291a2d069f1b59b1822da862ba3bf825089 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Thu, 3 Nov 2022 17:21:44 +0100 Subject: [PATCH 02/16] Prima bozza aggiunta nuovo dossier --- MP.SPEC/Components/ListDossiers.razor | 96 +++++++++++++++++++++++- MP.SPEC/Components/ListDossiers.razor.cs | 57 ++++++++++++++ MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 6 files changed, 156 insertions(+), 5 deletions(-) diff --git a/MP.SPEC/Components/ListDossiers.razor b/MP.SPEC/Components/ListDossiers.razor index 5e031017..7956ff01 100644 --- a/MP.SPEC/Components/ListDossiers.razor +++ b/MP.SPEC/Components/ListDossiers.razor @@ -14,6 +14,7 @@ else if (totalCount == 0) } else { + @if (currFluxLogDto != null) {
@@ -78,6 +79,97 @@ else
} + + + + @if (currRecordClone != null) + { +
+
+
+
+
+ Modifica Parametro +
+
+ @if (isEditing) + { + PENDING CHANGES... + } +
+
+
+ +
+
+
+ ARTICOLO + +
+
+
+
+ FASE + +
+
+ +
+
+ MACCHINA + +
+
+
+
+ DATA + +
+
+
+ + + +
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+ } + + + + + + + + + +
@@ -101,8 +193,10 @@ else @@ -199,7 +223,7 @@ else - + @**@ } else { @@ -215,7 +239,7 @@ else diff --git a/MP.SPEC/Components/ListPARAMS.razor b/MP.SPEC/Components/ListPARAMS.razor index d49a30f6..70fc3a12 100644 --- a/MP.SPEC/Components/ListPARAMS.razor +++ b/MP.SPEC/Components/ListPARAMS.razor @@ -17,7 +17,10 @@ else diff --git a/MP.SPEC/Components/ListPODL.razor b/MP.SPEC/Components/ListPODL.razor index 4bcc0552..6b87bbb8 100644 --- a/MP.SPEC/Components/ListPODL.razor +++ b/MP.SPEC/Components/ListPODL.razor @@ -17,7 +17,10 @@ else @@ -45,7 +48,8 @@ else { } + + } @@ -136,7 +139,7 @@
@if (isEditing == false) { - + + + } else { diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index 127d76b4..bd70cbc7 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -171,8 +171,47 @@ namespace MP.SPEC.Components } + protected async Task newDossier(Dossiers selRec) + { + var alert = await JSRuntime.InvokeAsync("confirm", "Confermi di voler salvare TUTTE le modifiche? queste saranno parte del dossier inviato all'impianto"); + + if (alert) + { + + await Task.Delay(1); + if (currRecordClone != null) + { + // serializzo valore x flux log... + DossierFluxLogDTO updatedResult = new DossierFluxLogDTO() { ODL = listaFlux }; + string newVal = JsonConvert.SerializeObject(updatedResult); + currRecordClone.DataType = selRec.DataType; + currRecordClone.DtRif = DateTime.Now; + currRecordClone.IdxMacchina = selRec.DataType; + currRecordClone.CodArticolo = selRec.CodArticolo; + currRecordClone.IdxODL = selRec.IdxODL; + currRecordClone.Valore = newVal; + // METODO PER UPDATE FLUX + await MDService.DossiersInsert(currRecordClone); + currRecordClone = null; + isEditing = false; + await Task.Delay(1); + StateHasChanged(); + } + return; + } + else + { + currFluxLogDto = null; + await Task.Delay(1); + await JSRuntime.InvokeAsync("location.reload"); + + } + + } + protected override async Task OnInitializedAsync() { + ListGruppiFase = await MDService.ElencoGruppiFase(); ListStati = await MDService.AnagStatiComm(); await reloadData(true); } @@ -193,6 +232,23 @@ namespace MP.SPEC.Components listaFlux = MDService.getFluxLog(selRec.Valore); await toggleTableFlux(); } + protected async Task cloneRecord(Dossiers selRec) + { + // creo record duplicato... + Dossiers newRec = new Dossiers() + { + IdxDossier = selRec.IdxDossier, + DataType = selRec.DataType, + DtRif = selRec.DtRif, + IdxMacchina = selRec.IdxMacchina, + CodArticolo = selRec.CodArticolo, + IdxODL = selRec.IdxODL, + Valore = selRec.Valore, + }; + currRecordClone = selRec; + await Task.Delay(1); + } + private List? ListGruppiFase; protected async Task UpdateData() { @@ -220,6 +276,7 @@ namespace MP.SPEC.Components private int _totalCount = 0; private Dossiers? currRecord = null; + private Dossiers? currRecordClone = null; private FluxLogDTO? currRecordFlux; private List? ListRecords; diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 4eed2b81..4ef75a36 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2211.311 + 6.16.2211.317 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 0fb5f0b8..28accc8f 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2211.311

+

Versione: 6.16.2211.317


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 22639881..bb9c4c74 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.311 +6.16.2211.317 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 33dd5804..6b590bc7 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.311 + 6.16.2211.317 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 From d6f7a55a052e1ec592579b08dc767a684e5b1853 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 4 Nov 2022 09:06:43 +0100 Subject: [PATCH 03/16] update metodo insert dossier --- MP.SPEC/Data/MpDataService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index b0c3db2e..81bc0a03 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -400,7 +400,7 @@ namespace MP.SPEC.Data public async Task DossiersInsert(Dossiers currDoss) { // aggiorno record sul DB - bool answ = await dbController.DossiersUpdateValore(currDoss); + bool answ = await dbController.DossiersInsert(currDoss); return answ; } From 55187eda96ac2d44811e3b3ac32faf795f19e024 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 4 Nov 2022 09:11:55 +0100 Subject: [PATCH 04/16] dismiss nuovo dossier --- MP.SPEC/Components/ListDossiers.razor | 4 ++-- MP.SPEC/Components/ListDossiers.razor.cs | 13 ++++++++++++- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/MP.SPEC/Components/ListDossiers.razor b/MP.SPEC/Components/ListDossiers.razor index 7956ff01..51726205 100644 --- a/MP.SPEC/Components/ListDossiers.razor +++ b/MP.SPEC/Components/ListDossiers.razor @@ -139,14 +139,14 @@ else -
    +
    - +
    diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index bd70cbc7..25f0a47b 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -137,6 +137,17 @@ namespace MP.SPEC.Components StateHasChanged(); } } + protected async Task cancelNewDoss() + { + var alert = await JSRuntime.InvokeAsync("confirm", "Confermi di voler annullare l'aggiunta di un nuovo dossier? i dati saranno ricaricati."); + if (alert) + { + currRecordClone = null; + isEditing = false; + await Task.Delay(1); + StateHasChanged(); + } + } protected async Task update(FluxLogDTO selRec) { @@ -189,7 +200,7 @@ namespace MP.SPEC.Components currRecordClone.IdxMacchina = selRec.DataType; currRecordClone.CodArticolo = selRec.CodArticolo; currRecordClone.IdxODL = selRec.IdxODL; - currRecordClone.Valore = newVal; + currRecordClone.Valore = selRec.Valore; // METODO PER UPDATE FLUX await MDService.DossiersInsert(currRecordClone); currRecordClone = null; diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 4ef75a36..674aaf3b 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2211.317 + 6.16.2211.408 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 28accc8f..f9e33275 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

    Versione: 6.16.2211.317

    +

    Versione: 6.16.2211.408


    Note di rilascio:
    • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index bb9c4c74..768380ef 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.317 +6.16.2211.408 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 6b590bc7..80a41b02 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.317 + 6.16.2211.408 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 From 4f7ac21f419103221a7526e76f9b109bd646b473 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 4 Nov 2022 09:20:53 +0100 Subject: [PATCH 05/16] new dossier --- MP.SPEC/Components/ListDossiers.razor | 3 +++ MP.SPEC/Components/ListDossiers.razor.cs | 4 ++-- MP.SPEC/Data/MpDataService.cs | 2 +- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/MP.SPEC/Components/ListDossiers.razor b/MP.SPEC/Components/ListDossiers.razor index 51726205..46df94e2 100644 --- a/MP.SPEC/Components/ListDossiers.razor +++ b/MP.SPEC/Components/ListDossiers.razor @@ -81,6 +81,9 @@ else } + + + @if (currRecordClone != null) { diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index 25f0a47b..213cb4dd 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -197,7 +197,7 @@ namespace MP.SPEC.Components string newVal = JsonConvert.SerializeObject(updatedResult); currRecordClone.DataType = selRec.DataType; currRecordClone.DtRif = DateTime.Now; - currRecordClone.IdxMacchina = selRec.DataType; + currRecordClone.IdxMacchina = selRec.IdxMacchina; currRecordClone.CodArticolo = selRec.CodArticolo; currRecordClone.IdxODL = selRec.IdxODL; currRecordClone.Valore = selRec.Valore; @@ -212,7 +212,7 @@ namespace MP.SPEC.Components } else { - currFluxLogDto = null; + currRecordClone = null; await Task.Delay(1); await JSRuntime.InvokeAsync("location.reload"); diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 146ff727..9fd4bf2f 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -400,7 +400,7 @@ namespace MP.SPEC.Data public async Task DossiersInsert(Dossiers currDoss) { // aggiorno record sul DB - bool answ = await dbController.DossiersUpdateValore(currDoss); + bool answ = await dbController.DossiersInsert(currDoss); return answ; } diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 674aaf3b..7b05c1a1 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2211.408 + 6.16.2211.409 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index f9e33275..383b221f 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

      Versione: 6.16.2211.408

      +

      Versione: 6.16.2211.409


      Note di rilascio:
      • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 768380ef..289a3afe 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.408 +6.16.2211.409 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 80a41b02..9becd7e2 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.408 + 6.16.2211.409 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 From 5380c996acacd60223f220679d1dd124ef3daf31 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 4 Nov 2022 09:27:44 +0100 Subject: [PATCH 06/16] Refresh DbModel x macchina --- MP.Data/DatabaseModels/Dossiers.cs | 2 -- MP.Data/DatabaseModels/Macchine.cs | 16 +++++++++++++--- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/MP.Data/DatabaseModels/Dossiers.cs b/MP.Data/DatabaseModels/Dossiers.cs index 66cc2fe8..f50688eb 100644 --- a/MP.Data/DatabaseModels/Dossiers.cs +++ b/MP.Data/DatabaseModels/Dossiers.cs @@ -31,8 +31,6 @@ namespace MP.Data.DatabaseModels public string Valore { get; set; } = ""; - - /// /// Navigazione oggetto Machine /// diff --git a/MP.Data/DatabaseModels/Macchine.cs b/MP.Data/DatabaseModels/Macchine.cs index 80660970..4337b5ef 100644 --- a/MP.Data/DatabaseModels/Macchine.cs +++ b/MP.Data/DatabaseModels/Macchine.cs @@ -1,5 +1,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; #nullable disable @@ -8,14 +10,22 @@ using System.Collections.Generic; // namespace MP.Data.DatabaseModels { + [Table("Macchine")] public partial class Macchine { #region Public Properties - public string CodMacchina { get; set; } - public string Descrizione { get; set; } + [Key] public string IdxMacchina { get; set; } - public string Nome { get; set; } + public string CodMacchina { get; set; } = ""; + public string Descrizione { get; set; } = ""; + public string Nome { get; set; } = ""; + public string Note { get; set; } = ""; + public string url { get; set; } = ""; + public string locazione { get; set; } = ""; + public string css { get; set; } = ""; + public int RowNum { get; set; } = 0; + public int ColNum { get; set; } = 0; #endregion Public Properties } diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index b31710e7..7b05c1a1 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2211.312 + 6.16.2211.409 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index df775592..383b221f 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

        Versione: 6.16.2211.312

        +

        Versione: 6.16.2211.409


        Note di rilascio:
        • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index f4d62064..289a3afe 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.312 +6.16.2211.409 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index f915a747..9becd7e2 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.312 + 6.16.2211.409 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 From bbec081caef4b038d4b3e8fee8508d5469d7301c Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 4 Nov 2022 09:29:43 +0100 Subject: [PATCH 07/16] Separato codice cs x CmpTop --- MP.SPEC/Components/CmpTop.razor | 59 --------------------- MP.SPEC/Components/CmpTop.razor.cs | 84 ++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 59 deletions(-) create mode 100644 MP.SPEC/Components/CmpTop.razor.cs diff --git a/MP.SPEC/Components/CmpTop.razor b/MP.SPEC/Components/CmpTop.razor index 4e8840bd..b48edbec 100644 --- a/MP.SPEC/Components/CmpTop.razor +++ b/MP.SPEC/Components/CmpTop.razor @@ -24,63 +24,4 @@
    *@
    -@code { - protected bool ShowSearch - { - get => MService.ShowSearch; - set => MService.ShowSearch = value; - } - private string userName = ""; - - private string TipoSearch - { - get => MService.TipoSearch; - set => MService.TipoSearch = value; - } - - protected override async Task OnInitializedAsync() - { - MService.EA_ShowSearch += MService_EA_ShowSearch; - await forceReload(); - } - private async void MService_EA_ShowSearch() - { - await Task.Delay(1); - await InvokeAsync(() => StateHasChanged()); - } - - private async Task forceReload() - { - - var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); - var user = authState.User; - - if (user.Identity != null&& user.Identity.IsAuthenticated) - { - userName = $"{user.Identity.Name}"; - } - else - { - userName = "N.A."; - } - } - - public async Task flushCache() - { - await Task.Delay(1); - await MDService.FlushRedisCache(); - await Task.Delay(1); - // rimando a pagina corrente - NavManager.NavigateTo(NavManager.Uri, true); - } - - [Inject] - private NavigationManager NavManager { get; set; } = null!; - - [Inject] - protected MpDataService MDService { get; set; } = null!; - - [Inject] - protected IJSRuntime JSRuntime { get; set; } = null!; -} diff --git a/MP.SPEC/Components/CmpTop.razor.cs b/MP.SPEC/Components/CmpTop.razor.cs new file mode 100644 index 00000000..7668ad34 --- /dev/null +++ b/MP.SPEC/Components/CmpTop.razor.cs @@ -0,0 +1,84 @@ +using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Authorization; +using Microsoft.JSInterop; +using MP.SPEC.Data; + +namespace MP.SPEC.Components +{ + public partial class CmpTop + { + #region Public Methods + + public async Task flushCache() + { + await Task.Delay(1); + await MDService.FlushRedisCache(); + await Task.Delay(1); + // rimando a pagina corrente + NavManager.NavigateTo(NavManager.Uri, true); + } + + #endregion Public Methods + + #region Protected Properties + + [Inject] + protected IJSRuntime JSRuntime { get; set; } = null!; + + [Inject] + protected MpDataService MDService { get; set; } = null!; + + protected bool ShowSearch { get => MService.ShowSearch; set => MService.ShowSearch = value; } + + #endregion Protected Properties + + #region Protected Methods + + protected override async Task OnInitializedAsync() + { + MService.EA_ShowSearch += MService_EA_ShowSearch; + await forceReload(); + } + + #endregion Protected Methods + + #region Private Fields + + private string userName = ""; + + #endregion Private Fields + + #region Private Properties + + [Inject] + private NavigationManager NavManager { get; set; } = null!; + + private string TipoSearch { get => MService.TipoSearch; set => MService.TipoSearch = value; } + + #endregion Private Properties + + #region Private Methods + + private async Task forceReload() + { + var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); + var user = authState.User; + if (user.Identity != null && user.Identity.IsAuthenticated) + { + userName = $"{user.Identity.Name}"; + } + else + { + userName = "N.A."; + } + } + + private async void MService_EA_ShowSearch() + { + await Task.Delay(1); + await InvokeAsync(() => StateHasChanged()); + } + + #endregion Private Methods + } +} \ No newline at end of file From 3f1a3aa2ced0010d48ffe2cff64b952c8dd605d1 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 4 Nov 2022 09:30:01 +0100 Subject: [PATCH 08/16] Aggiunta navmanager --- MP.SPEC/Components/ListDossiers.razor.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index e2ef11d3..b1c69a7f 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -23,6 +23,8 @@ namespace MP.SPEC.Components [Parameter] public EventCallback TotRecordChanged { get; set; } + [Inject] + private NavigationManager NavManager { get; set; } = null!; #endregion Public Properties From 76c49d1eea32b392f19ba9e0eaf02ae6d897cd53 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 4 Nov 2022 10:10:56 +0100 Subject: [PATCH 09/16] Fix scrittura clone dossier --- MP.Data/Controllers/MpSpecController.cs | 18 +- .../{Dossiers.cs => DossierModel.cs} | 11 +- MP.Data/MoonProContext.cs | 2 +- MP.SPEC/Components/ListDossiers.razor | 10 +- MP.SPEC/Components/ListDossiers.razor.cs | 323 +++++++++--------- MP.SPEC/Data/MpDataService.cs | 16 +- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/DOSS.razor.cs | 4 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 11 files changed, 202 insertions(+), 190 deletions(-) rename MP.Data/DatabaseModels/{Dossiers.cs => DossierModel.cs} (79%) diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index 7e67c870..10e5bf5c 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -110,7 +110,7 @@ namespace MP.Data.Controllers dbResult = dbCtx .DbSetDossiers .AsNoTracking() - .Select(i => i.OdlNav.CodArticolo) + .Select(i => i.CodArticolo) .Distinct() .ToList(); } @@ -302,7 +302,7 @@ namespace MP.Data.Controllers /// /// record dossier da eliminare /// - public async Task DossiersDeleteRecord(Dossiers currRec) + public async Task DossiersDeleteRecord(DossierModel currRec) { bool answ = false; using (var dbCtx = new MoonProContext(_configuration)) @@ -336,18 +336,18 @@ namespace MP.Data.Controllers /// Data minima per estrazione records /// Data Massima per estrazione records /// - public List DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtStart, DateTime DtEnd) + public List DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtStart, DateTime DtEnd) { - List dbResult = new List(); + List dbResult = new List(); using (var dbCtx = new MoonProContext(_configuration)) { dbResult = dbCtx .DbSetDossiers .AsNoTracking() - .Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodArticolo == "*" || x.OdlNav.CodArticolo == CodArticolo) && (x.DtRif >= DtStart && x.DtRif <= DtEnd)) + .Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodArticolo == "*" || x.CodArticolo == CodArticolo) && (x.DtRif >= DtStart && x.DtRif <= DtEnd)) .Include(m => m.MachineNav) - .Include(o => o.OdlNav) - .Include(a => a.OdlNav.ArticoloNav) + //.Include(o => o.OdlNav) + .Include(a => a.ArticoloNav) .OrderByDescending(x => x.DtRif) .ToList(); } @@ -359,7 +359,7 @@ namespace MP.Data.Controllers /// /// record dossier da modificare /// - public async Task DossiersInsert(Dossiers newRec) + public async Task DossiersInsert(DossierModel newRec) { bool fatto = false; using (var dbCtx = new MoonProContext(_configuration)) @@ -431,7 +431,7 @@ namespace MP.Data.Controllers /// /// record dossier da modificare /// - public async Task DossiersUpdateValore(Dossiers editRec) + public async Task DossiersUpdateValore(DossierModel editRec) { bool fatto = false; using (var dbCtx = new MoonProContext(_configuration)) diff --git a/MP.Data/DatabaseModels/Dossiers.cs b/MP.Data/DatabaseModels/DossierModel.cs similarity index 79% rename from MP.Data/DatabaseModels/Dossiers.cs rename to MP.Data/DatabaseModels/DossierModel.cs index f50688eb..5292fe98 100644 --- a/MP.Data/DatabaseModels/Dossiers.cs +++ b/MP.Data/DatabaseModels/DossierModel.cs @@ -10,7 +10,7 @@ using System.ComponentModel.DataAnnotations.Schema; namespace MP.Data.DatabaseModels { [Table("Dossiers")] - public partial class Dossiers + public partial class DossierModel { #region Public Properties @@ -31,6 +31,9 @@ namespace MP.Data.DatabaseModels public string Valore { get; set; } = ""; + [MaxLength(50)] + public string KeyRichiesta { get; set; } = ""; + /// /// Navigazione oggetto Machine /// @@ -43,6 +46,12 @@ namespace MP.Data.DatabaseModels [ForeignKey("IdxODL")] public virtual ODLModel OdlNav { get; set; } = null!; + /// + /// Navigazione oggetto Articolo + /// + [ForeignKey("CodArticolo")] + public virtual AnagArticoli ArticoloNav { get; set; } = null!; + #endregion Public Properties } } \ No newline at end of file diff --git a/MP.Data/MoonProContext.cs b/MP.Data/MoonProContext.cs index 2ed53d5e..5cf650a3 100644 --- a/MP.Data/MoonProContext.cs +++ b/MP.Data/MoonProContext.cs @@ -47,7 +47,7 @@ namespace MP.Data public virtual DbSet DbSetODL { get; set; } public virtual DbSet DbSetPODL { get; set; } public virtual DbSet DbSetFluxLog { get; set; } - public virtual DbSet DbSetDossiers { get; set; } + public virtual DbSet DbSetDossiers { get; set; } public virtual DbSet DbSetStatOdl { get; set; } public virtual DbSet DbSetStatoProd { get; set; } public virtual DbSet DbSetEvList { get; set; } diff --git a/MP.SPEC/Components/ListDossiers.razor b/MP.SPEC/Components/ListDossiers.razor index 46df94e2..83356622 100644 --- a/MP.SPEC/Components/ListDossiers.razor +++ b/MP.SPEC/Components/ListDossiers.razor @@ -207,11 +207,11 @@ else }
- @record.OdlNav.CodArticolo -
@record.OdlNav.ArticoloNav.DescArticolo
+ @record.CodArticolo +
@record.ArticoloNav.DescArticolo
- @tradFase(record.OdlNav.KeyRichiesta) + @tradFase(record.KeyRichiesta) @record.IdxMacchina @@ -277,8 +277,8 @@ else @record.dtEvento - @record.CodFlux -
@traduci(record.CodFlux)
+ @traduci(record.CodFlux) +
@record.CodFlux
@if (record.ValoreEdit != record.Valore) diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index b1c69a7f..f04d9b29 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.DataProtection; using Microsoft.JSInterop; using MP.Data.DatabaseModels; using MP.Data.DTO; @@ -13,7 +12,7 @@ namespace MP.SPEC.Components #region Public Properties [Parameter] - public EventCallback RecordSel { get; set; } + public EventCallback RecordSel { get; set; } [Parameter] public EventCallback RecordSelFlux { get; set; } @@ -23,15 +22,25 @@ namespace MP.SPEC.Components [Parameter] public EventCallback TotRecordChanged { get; set; } - [Inject] - private NavigationManager NavManager { get; set; } = null!; #endregion Public Properties #region Public Methods - private FluxLogDTO? currFluxLogDto = null; - + public string checkSelect(DossierModel recordSel) + { + string answ = ""; + if (currRecord != null) + { + try + { + answ = (currRecord.IdxMacchina == recordSel.IdxMacchina && currRecord.DtRif == recordSel.DtRif) ? "table-info" : ""; + } + catch + { } + } + return answ; + } public string checkSelPar(FluxLogDTO recordSel) { @@ -48,21 +57,6 @@ namespace MP.SPEC.Components return answ; } - public string checkSelect(Dossiers recordSel) - { - string answ = ""; - if (currRecord != null) - { - try - { - answ = (currRecord.IdxMacchina == recordSel.IdxMacchina && currRecord.DtRif == recordSel.DtRif) ? "table-info" : ""; - - } - catch - { } - } - return answ; - } public void Dispose() { currRecord = null; @@ -70,40 +64,72 @@ namespace MP.SPEC.Components ListRecords = null; GC.Collect(); } - private SelectDossierParams lastFilter { get; set; } = new SelectDossierParams() { CurrPage = -1 }; - protected override async Task OnParametersSetAsync() - { - if (!lastFilter.Equals(SelFilter)) - { - lastFilter = SelFilter.clone(); - await reloadData(true); - } - } + #endregion Public Methods #region Protected Properties - private string traduci(string lemma) - { - var answ = MDService.Traduci(lemma, "IT"); - return answ; - } - [Inject] protected IJSRuntime JSRuntime { get; set; } = null!; [Inject] protected MpDataService MDService { get; set; } = null!; + #endregion Protected Properties #region Protected Methods + protected async Task cancel() + { + var alert = await JSRuntime.InvokeAsync("confirm", "Confermi di voler annullare TUTTE le modifiche? i dati saranno ricaricati."); + if (alert) + { + currFluxLogDto = null; + isEditing = false; + await Task.Delay(1); + if (currRecord != null) + { + listaFlux = MDService.getFluxLog(currRecord.Valore); + } + StateHasChanged(); + } + } + + protected async Task cancelNewDoss() + { + var alert = await JSRuntime.InvokeAsync("confirm", "Confermi di voler annullare l'aggiunta di un nuovo dossier? i dati saranno ricaricati."); + if (alert) + { + currRecordClone = null; + isEditing = false; + await Task.Delay(1); + StateHasChanged(); + } + } + + protected async Task cloneRecord(DossierModel selRec) + { + // creo record duplicato... + DossierModel newRec = new DossierModel() + { + IdxDossier = 0, + DataType = selRec.DataType, + DtRif = DateTime.Now, + IdxMacchina = selRec.IdxMacchina, + CodArticolo = selRec.CodArticolo, + IdxODL = 0, + Valore = selRec.Valore, + }; + currRecordClone = newRec; + await Task.Delay(1); + } + /// /// Eliminazione record selezionato (previa conferma) /// /// /// - protected async Task deleteRecord(Dossiers selRec) + protected async Task deleteRecord(DossierModel selRec) { if (!await JSRuntime.InvokeAsync("confirm", "Eliminazione Dossier: sei sicuro di voler procedere?")) return; @@ -122,45 +148,78 @@ namespace MP.SPEC.Components await RecordSelFlux.InvokeAsync(selRec); } - private void enableEditing() + protected async Task newDossier(DossierModel selRec) { - isEditing = true; - } + var alert = await JSRuntime.InvokeAsync("confirm", "Confermi di voler creare un nuovo Dossier per l'impianto/articolo selezioanto?"); - protected async Task cancel() - { - var alert = await JSRuntime.InvokeAsync("confirm", "Confermi di voler annullare TUTTE le modifiche? i dati saranno ricaricati."); if (alert) { - currFluxLogDto = null; - isEditing = false; await Task.Delay(1); - if (currRecord != null) + if (currRecordClone != null) { - listaFlux = MDService.getFluxLog(currRecord.Valore); + // serializzo valore x flux log... + DossierFluxLogDTO updatedResult = new DossierFluxLogDTO() { ODL = listaFlux }; + string newVal = JsonConvert.SerializeObject(updatedResult); + // preparo x insert + currRecordClone.DtRif = DateTime.Now; + currRecordClone.Valore = newVal; + // METODO PER UPDATE FLUX + await MDService.DossiersInsert(currRecordClone); + currRecordClone = null; + isEditing = false; + await Task.Delay(1); + StateHasChanged(); } - StateHasChanged(); + return; } - } - protected async Task cancelNewDoss() - { - var alert = await JSRuntime.InvokeAsync("confirm", "Confermi di voler annullare l'aggiunta di un nuovo dossier? i dati saranno ricaricati."); - if (alert) + else { currRecordClone = null; - isEditing = false; await Task.Delay(1); - StateHasChanged(); + // TOGLIERE!!!!! + await JSRuntime.InvokeAsync("location.reload"); } } + protected override async Task OnInitializedAsync() + { + ListGruppiFase = await MDService.ElencoGruppiFase(); + ListStati = await MDService.AnagStatiComm(); + await reloadData(true); + } + + protected override async Task OnParametersSetAsync() + { + if (!lastFilter.Equals(SelFilter)) + { + lastFilter = SelFilter.clone(); + await reloadData(true); + } + } + + protected async void OnSeachUpdated() + { + await InvokeAsync(() => + { + currPage = 1; + StateHasChanged(); + }); + } + + protected async Task selRecord(DossierModel selRec) + { + currRecord = selRec; + await RecordSel.InvokeAsync(selRec); + listaFlux = MDService.getFluxLog(selRec.Valore); + await toggleTableFlux(); + } + protected async Task update(FluxLogDTO selRec) { var alert = await JSRuntime.InvokeAsync("confirm", "Confermi di voler salvare TUTTE le modifiche? queste saranno parte del dossier inviato all'impianto"); if (alert) { - await Task.Delay(1); if (currRecord != null) { @@ -184,106 +243,13 @@ namespace MP.SPEC.Components // rimando a pagina corrente NavManager.NavigateTo(NavManager.Uri, true); } - } - protected async Task newDossier(Dossiers selRec) - { - var alert = await JSRuntime.InvokeAsync("confirm", "Confermi di voler salvare TUTTE le modifiche? queste saranno parte del dossier inviato all'impianto"); - - if (alert) - { - - await Task.Delay(1); - if (currRecordClone != null) - { - // serializzo valore x flux log... - DossierFluxLogDTO updatedResult = new DossierFluxLogDTO() { ODL = listaFlux }; - string newVal = JsonConvert.SerializeObject(updatedResult); - currRecordClone.DataType = selRec.DataType; - currRecordClone.DtRif = DateTime.Now; - currRecordClone.IdxMacchina = selRec.IdxMacchina; - currRecordClone.CodArticolo = selRec.CodArticolo; - currRecordClone.IdxODL = selRec.IdxODL; - currRecordClone.Valore = selRec.Valore; - // METODO PER UPDATE FLUX - await MDService.DossiersInsert(currRecordClone); - currRecordClone = null; - isEditing = false; - await Task.Delay(1); - StateHasChanged(); - } - return; - } - else - { - currRecordClone = null; - await Task.Delay(1); - await JSRuntime.InvokeAsync("location.reload"); - - } - - } - - protected override async Task OnInitializedAsync() - { - ListGruppiFase = await MDService.ElencoGruppiFase(); - ListStati = await MDService.AnagStatiComm(); - await reloadData(true); - } - - protected async void OnSeachUpdated() - { - await InvokeAsync(() => - { - currPage = 1; - StateHasChanged(); - }); - } - - protected async Task selRecord(Dossiers selRec) - { - currRecord = selRec; - await RecordSel.InvokeAsync(selRec); - listaFlux = MDService.getFluxLog(selRec.Valore); - await toggleTableFlux(); - } - protected async Task cloneRecord(Dossiers selRec) - { - // creo record duplicato... - Dossiers newRec = new Dossiers() - { - IdxDossier = selRec.IdxDossier, - DataType = selRec.DataType, - DtRif = selRec.DtRif, - IdxMacchina = selRec.IdxMacchina, - CodArticolo = selRec.CodArticolo, - IdxODL = selRec.IdxODL, - Valore = selRec.Valore, - }; - currRecordClone = selRec; - await Task.Delay(1); - } - private List? ListGruppiFase; - protected async Task UpdateData() { currRecord = null; await reloadData(true); } - private string css() - { - string answ = ""; - if (isEditing) - { - answ = "visible"; - } - else - { - answ = "hidden"; - } - return answ; - } #endregion Protected Methods @@ -291,13 +257,19 @@ namespace MP.SPEC.Components private int _totalCount = 0; - private Dossiers? currRecord = null; - private Dossiers? currRecordClone = null; + private FluxLogDTO? currFluxLogDto = null; + + private DossierModel? currRecord = null; + + private DossierModel? currRecordClone = null; + + private List? ListGruppiFase; + + private List? ListRecords; - private List? ListRecords; private List? ListStati; - private List? SearchRecords; + private List? SearchRecords; #endregion Private Fields @@ -317,6 +289,8 @@ namespace MP.SPEC.Components private bool isLoading { get; set; } = false; + private SelectDossierParams lastFilter { get; set; } = new SelectDossierParams() { CurrPage = -1 }; + private List? listaFlux { get; set; } = null; private int MaxRecord @@ -324,6 +298,9 @@ namespace MP.SPEC.Components get => SelFilter.MaxRecord; } + [Inject] + private NavigationManager NavManager { get; set; } = null!; + private int numRecord { get => SelFilter.NumRec; @@ -339,6 +316,7 @@ namespace MP.SPEC.Components { get => SelFilter.DtEnd; } + private DateTime SelDtStart { get => SelFilter.DtStart; @@ -368,6 +346,35 @@ namespace MP.SPEC.Components #region Private Methods + private async Task closeTableFlux() + { + currFluxLogDto = null; + currRecord = null; + visualizzaFlux = true; + isEditing = false; + await RecordSelFlux.InvokeAsync(currFluxLogDto); + await Task.Delay(1); + } + + private string css() + { + string answ = ""; + if (isEditing) + { + answ = "visible"; + } + else + { + answ = "hidden"; + } + return answ; + } + + private void enableEditing() + { + isEditing = true; + } + private async Task reloadData(bool setChanged) { isLoading = true; @@ -402,14 +409,10 @@ namespace MP.SPEC.Components return answ; } - private async Task closeTableFlux() + private string traduci(string lemma) { - currFluxLogDto = null; - currRecord = null; - visualizzaFlux = true; - isEditing = false; - await RecordSelFlux.InvokeAsync(currFluxLogDto); - await Task.Delay(1); + var answ = MDService.Traduci(lemma, "IT"); + return answ; } #endregion Private Methods diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 81bc0a03..bdcf0c87 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -338,7 +338,7 @@ namespace MP.SPEC.Data /// /// record dossier da eliminare /// - public async Task DossiersDeleteRecord(Dossiers selRecord) + public async Task DossiersDeleteRecord(DossierModel selRecord) { bool result = false; Stopwatch stopWatch = new Stopwatch(); @@ -361,9 +361,9 @@ namespace MP.SPEC.Data /// Data minima per estrazione records /// Data Massima per estrazione records /// - public async Task> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtStart, DateTime DtEnd) + public async Task> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtStart, DateTime DtEnd) { - List? result = new List(); + List? result = new List(); Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); string readType = "DB"; @@ -372,7 +372,7 @@ namespace MP.SPEC.Data RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) { - result = JsonConvert.DeserializeObject>($"{rawData}"); + result = JsonConvert.DeserializeObject>($"{rawData}"); readType = "REDIS"; } else @@ -384,7 +384,7 @@ namespace MP.SPEC.Data } if (result == null) { - result = new List(); + result = new List(); } stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; @@ -397,7 +397,7 @@ namespace MP.SPEC.Data /// /// /// - public async Task DossiersInsert(Dossiers currDoss) + public async Task DossiersInsert(DossierModel currDoss) { // aggiorno record sul DB bool answ = await dbController.DossiersInsert(currDoss); @@ -451,7 +451,7 @@ namespace MP.SPEC.Data /// /// /// - public async Task DossiersUpdateValore(Dossiers currDoss) + public async Task DossiersUpdateValore(DossierModel currDoss) { // aggiorno record sul DB bool answ = await dbController.DossiersUpdateValore(currDoss); @@ -910,7 +910,7 @@ namespace MP.SPEC.Data return answ; } - public async Task updateDossierValue(Dossiers currDoss, FluxLogDTO editFL) + public async Task updateDossierValue(DossierModel currDoss, FluxLogDTO editFL) { bool answ = false; // recupero intero set valori dossier deserializzando... diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 7b05c1a1..41d48c46 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2211.409 + 6.16.2211.410 diff --git a/MP.SPEC/Pages/DOSS.razor.cs b/MP.SPEC/Pages/DOSS.razor.cs index af62c038..db3034d7 100644 --- a/MP.SPEC/Pages/DOSS.razor.cs +++ b/MP.SPEC/Pages/DOSS.razor.cs @@ -50,7 +50,7 @@ namespace MP.SPEC.Pages isFiltering = false; } - protected async Task selRecordDoss(Dossiers selDoss) + protected async Task selRecordDoss(DossierModel selDoss) { currRecordDoss = selDoss; await Task.Delay(1); @@ -78,7 +78,7 @@ namespace MP.SPEC.Pages set => currFilter.CurrPage = value; } - private Dossiers? currRecordDoss { get; set; } = null; + private DossierModel? currRecordDoss { get; set; } = null; private bool isEditing { diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 383b221f..1ded9ae5 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2211.409

+

Versione: 6.16.2211.410


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 289a3afe..45c4675e 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.409 +6.16.2211.410 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 9becd7e2..47c7e4e5 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.409 + 6.16.2211.410 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 From d13a1b7833b875273db9a076b16bd7d78ce51e73 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 4 Nov 2022 15:20:35 +0100 Subject: [PATCH 10/16] aggiunta clona dossier --- MP.SPEC/Components/ListDossiers.razor | 90 +++++++++++++++--------- MP.SPEC/Components/ListDossiers.razor.cs | 62 +++++++++++++++- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 6 files changed, 121 insertions(+), 39 deletions(-) diff --git a/MP.SPEC/Components/ListDossiers.razor b/MP.SPEC/Components/ListDossiers.razor index 83356622..2f906524 100644 --- a/MP.SPEC/Components/ListDossiers.razor +++ b/MP.SPEC/Components/ListDossiers.razor @@ -81,9 +81,6 @@ else } - - - @if (currRecordClone != null) { @@ -92,50 +89,70 @@ else
    - Modifica Parametro -
    -
    - @if (isEditing) - { - PENDING CHANGES... - } + Nuovo Dossier
    -
    +
    - ARTICOLO - -
    -
    -
    -
    - FASE - + @if (ListMacchine != null) { - foreach (var item in ListGruppiFase) + foreach (var item in ListMacchine) { - + @if (item.IdxMacchina == currRecordClone.IdxMacchina) + { + + + } + else + { + + } } }
    - -
    +
    - MACCHINA - + FASE +
    -
    + +
    - DATA - + ARTICOLI + +
    @@ -179,7 +196,14 @@ else
- +
+ + @if (currRecord != null) + { + + + } +
Articolo Fase @record.IdxMacchina -
@record.MachineNav.Descrizione
+ @*
@record.MachineNav.Descrizione
*@
@record.DtRif diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index f04d9b29..6acba0e4 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Components; +using Microsoft.EntityFrameworkCore.Query.Internal; using Microsoft.JSInterop; using MP.Data.DatabaseModels; using MP.Data.DTO; @@ -41,7 +42,30 @@ namespace MP.SPEC.Components } return answ; } + private bool selectFirst(string idxMacchina) + { + //string firstMacchina = ""; + bool answ = false; + if (ListMacchine != null) + { + if (idxMacchina == idxMacchina) + { + answ = true; + } + else + { + answ = false; + } + //var rawData = ListMacchine.Select(x => x.IdxMacchina).FirstOrDefault(); + //firstMacchina = rawData != null ? rawData : ""; + } + //if (firstMacchina == idxMacchina) + //{ + // answ = true; + //} + return answ; + } public string checkSelPar(FluxLogDTO recordSel) { string answ = ""; @@ -112,8 +136,9 @@ namespace MP.SPEC.Components // creo record duplicato... DossierModel newRec = new DossierModel() { - IdxDossier = 0, + //IdxDossier = 0, DataType = selRec.DataType, + KeyRichiesta = selRec.KeyRichiesta, DtRif = DateTime.Now, IdxMacchina = selRec.IdxMacchina, CodArticolo = selRec.CodArticolo, @@ -158,17 +183,43 @@ namespace MP.SPEC.Components if (currRecordClone != null) { // serializzo valore x flux log... + + DossierFluxLogDTO? valoreDeserializzato = JsonConvert.DeserializeObject(selRec.Valore); + if (valoreDeserializzato != null) + { + + listaFlux = valoreDeserializzato + .ODL + .OrderBy(x => x.CodFlux) + .ToList(); + } + + if (listaFlux != null) + { + foreach (var item in listaFlux) + { + item.IdxMacchina = selRec.IdxMacchina; + item.Valore = "0"; + item.dtEvento = DateTime.Now; + } + } + DossierFluxLogDTO updatedResult = new DossierFluxLogDTO() { ODL = listaFlux }; string newVal = JsonConvert.SerializeObject(updatedResult); // preparo x insert currRecordClone.DtRif = DateTime.Now; + currRecordClone.IdxMacchina = selRec.IdxMacchina; + currRecordClone.CodArticolo = selRec.CodArticolo; + currRecordClone.KeyRichiesta = selRec.KeyRichiesta; currRecordClone.Valore = newVal; // METODO PER UPDATE FLUX await MDService.DossiersInsert(currRecordClone); + //await reloadData(true); currRecordClone = null; isEditing = false; await Task.Delay(1); StateHasChanged(); + NavManager.NavigateTo(NavManager.Uri, true); } return; } @@ -177,7 +228,7 @@ namespace MP.SPEC.Components currRecordClone = null; await Task.Delay(1); // TOGLIERE!!!!! - await JSRuntime.InvokeAsync("location.reload"); + NavManager.NavigateTo("DOSS", true); } } @@ -185,6 +236,8 @@ namespace MP.SPEC.Components { ListGruppiFase = await MDService.ElencoGruppiFase(); ListStati = await MDService.AnagStatiComm(); + ListArticoli = await MDService.ArticoliGetSearch(100000, "BAGLIETTO", ""); + ListMacchine = await MDService.MacchineGetAll(); await reloadData(true); } @@ -271,6 +324,10 @@ namespace MP.SPEC.Components private List? SearchRecords; + private List? ListMacchine; + + private List? ListArticoli; + #endregion Private Fields #region Private Properties @@ -350,6 +407,7 @@ namespace MP.SPEC.Components { currFluxLogDto = null; currRecord = null; + currRecordClone = null; visualizzaFlux = true; isEditing = false; await RecordSelFlux.InvokeAsync(currFluxLogDto); diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 41d48c46..e67b133f 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2211.410 + 6.16.2211.415 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 1ded9ae5..ca2c5ffb 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2211.410

+

Versione: 6.16.2211.415


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 45c4675e..89994502 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.410 +6.16.2211.415 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 47c7e4e5..ba47b183 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.410 + 6.16.2211.415 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 From dbb4fbf9e231985fdc85262cccecd604d510faef Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 4 Nov 2022 15:50:40 +0100 Subject: [PATCH 11/16] Inizio update LAND x problemi GC --- MP.Land/Components/CmpTop.razor | 55 -------------- MP.Land/Components/CmpTop.razor.cs | 83 ++++++++++++++++++++ MP.Land/Components/HomeLink.razor | 76 ------------------- MP.Land/Components/HomeLink.razor.cs | 109 +++++++++++++++++++++++++++ MP.Land/MP.Land.csproj | 2 +- MP.Land/Pages/About.razor.cs | 62 +++++++-------- MP.Land/Pages/Contacts.razor | 14 ---- MP.Land/Pages/Contacts.razor.cs | 36 +++++++++ MP.Land/Pages/Index.razor.cs | 27 ++++--- MP.Land/Pages/SysInfo.razor | 62 ++------------- MP.Land/Pages/SysInfo.razor.cs | 72 ++++++++++++++++++ MP.Land/Pages/UpdateManager.razor.cs | 62 ++++++++------- MP.Land/Pages/UserQr.razor.cs | 3 + MP.Land/Resources/ChangeLog.html | 2 +- MP.Land/Resources/VersNum.txt | 2 +- MP.Land/Resources/manifest.xml | 2 +- MP.Land/Shared/MainLayout.razor | 32 -------- MP.Land/Shared/MainLayout.razor.cs | 52 +++++++++++++ 18 files changed, 448 insertions(+), 305 deletions(-) create mode 100644 MP.Land/Components/CmpTop.razor.cs create mode 100644 MP.Land/Components/HomeLink.razor.cs create mode 100644 MP.Land/Pages/Contacts.razor.cs create mode 100644 MP.Land/Pages/SysInfo.razor.cs create mode 100644 MP.Land/Shared/MainLayout.razor.cs diff --git a/MP.Land/Components/CmpTop.razor b/MP.Land/Components/CmpTop.razor index 4c81ffd1..534995a0 100644 --- a/MP.Land/Components/CmpTop.razor +++ b/MP.Land/Components/CmpTop.razor @@ -22,62 +22,7 @@ -@code { - //[CascadingParameter] - //private Task AuthenticationStateTask { get; set; } - - [CascadingParameter(Name = "ShowSearch")] - private bool ShowSearch { get; set; } - - private string userName = ""; - - private string PageName { get; set; } - private string PageIcon { get; set; } - - protected override async Task OnInitializedAsync() - { - await forceReload(); - } - - protected override void OnInitialized() - { - AppMessages.EA_PageUpdated += OnPageUpdate; - } - public void OnPageUpdate() - { - PageName = AppMessages.PageName; - PageIcon = AppMessages.PageIcon; - InvokeAsync(() => - { - StateHasChanged(); - }); - } - - public void Dispose() - { - AppMessages.EA_PageUpdated -= OnPageUpdate; - } - - private async Task forceReload() - { - userName = "N.A."; - await Task.Delay(1); -#if false -var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); -var user = authState.User; - -if (user.Identity.IsAuthenticated) -{ -userName = $"{user.Identity.Name}"; -} -else -{ -userName = "N.A."; -} -#endif - } -} @* // Vedere anche: // https://docs.microsoft.com/en-us/aspnet/core/blazor/security/?view=aspnetcore-5.0#:~:text=Blazor%20uses%20the%20existing%20ASP.NET%20Core%20authentication%20mechanisms,all%20client-side%20code%20can%20be%20modified%20by%20users diff --git a/MP.Land/Components/CmpTop.razor.cs b/MP.Land/Components/CmpTop.razor.cs new file mode 100644 index 00000000..1706938e --- /dev/null +++ b/MP.Land/Components/CmpTop.razor.cs @@ -0,0 +1,83 @@ +using Microsoft.AspNetCore.Components; +using System; +using System.Threading.Tasks; + +namespace MP.Land.Components +{ + public partial class CmpTop + { + #region Public Methods + + public void Dispose() + { + AppMessages.EA_PageUpdated -= OnPageUpdate; + GC.Collect(); + } + + public void OnPageUpdate() + { + PageName = AppMessages.PageName; + PageIcon = AppMessages.PageIcon; + InvokeAsync(() => + { + StateHasChanged(); + }); + } + + #endregion Public Methods + + #region Protected Methods + + protected override void OnInitialized() + { + AppMessages.EA_PageUpdated += OnPageUpdate; + } + + protected override async Task OnInitializedAsync() + { + await forceReload(); + } + + #endregion Protected Methods + + #region Private Fields + + private string userName = ""; + + #endregion Private Fields + + #region Private Properties + + private string PageIcon { get; set; } + + private string PageName { get; set; } + + [CascadingParameter(Name = "ShowSearch")] + private bool ShowSearch { get; set; } + + #endregion Private Properties + + #region Private Methods + + private async Task forceReload() + { + userName = "N.A."; + await Task.Delay(1); +#if false +var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); +var user = authState.User; + +if (user.Identity.IsAuthenticated) +{ +userName = $"{user.Identity.Name}"; +} +else +{ +userName = "N.A."; +} +#endif + } + + #endregion Private Methods + } +} \ No newline at end of file diff --git a/MP.Land/Components/HomeLink.razor b/MP.Land/Components/HomeLink.razor index e7eaef7e..c95301c7 100644 --- a/MP.Land/Components/HomeLink.razor +++ b/MP.Land/Components/HomeLink.razor @@ -53,79 +53,3 @@ else // disegno box non cliccabile e licenza mancante } -@code { - - [Parameter] - public UpdMan CurrItem { get; set; } - - protected List AKVList - { - get - { - return LicServ.AKVList; - } - set - { - LicServ.AKVList = value; - } - } - - - protected override async Task OnInitializedAsync() - { - // check init AKV - if (AKVList == null || AKVList.Count == 0) - { - AKVList = await DataService.AnagKeyValList(); - LicServ.InitAkv(); - } - } - - - protected string getAKVString(string nomeVar) - { - string answ = ""; - if (AKVList != null) - { - var currRec = AKVList.FirstOrDefault(x => x.NomeVar == nomeVar); - if (currRec != null) - { - answ = currRec.ValString; - } - } - return answ; - } - - protected AnagKeyValueModel getAKVRec(string nomeVar) - { - AnagKeyValueModel answ = new AnagKeyValueModel(); - if (AKVList != null) - { - answ = AKVList.FirstOrDefault(x => x.NomeVar == nomeVar); - } - return answ; - } - - protected bool authOk() - { - bool allOk = !string.IsNullOrEmpty(CurrItem.LicenseKey); - if (allOk) - { - allOk = LicServ.checkLicenseActive(CurrItem.LicenseKey); - } - return allOk; - } - - protected string fullUrl(string relUrl) - { - return $"{Configuration["ServerConf:BaseUrl"]}{relUrl}"; - } - - protected MarkupString traduci(string lemma) - { - MarkupString answ; - string rawHtml = DataService.Traduci(lemma, "IT"); - answ = new MarkupString(rawHtml); - return answ; - } -} \ No newline at end of file diff --git a/MP.Land/Components/HomeLink.razor.cs b/MP.Land/Components/HomeLink.razor.cs new file mode 100644 index 00000000..fee7c062 --- /dev/null +++ b/MP.Land/Components/HomeLink.razor.cs @@ -0,0 +1,109 @@ +using Microsoft.AspNetCore.Components; +using MP.AppAuth.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace MP.Land.Components +{ + public partial class HomeLink : IDisposable + { + #region Public Properties + + [Parameter] + public UpdMan CurrItem { get; set; } + + #endregion Public Properties + + #region Public Methods + + public void Dispose() + { + GC.Collect(); + } + + #endregion Public Methods + + #region Protected Properties + + protected List AKVList + { + get + { + return LicServ.AKVList; + } + + set + { + LicServ.AKVList = value; + } + } + + #endregion Protected Properties + + #region Protected Methods + + protected bool authOk() + { + bool allOk = !string.IsNullOrEmpty(CurrItem.LicenseKey); + if (allOk) + { + allOk = LicServ.checkLicenseActive(CurrItem.LicenseKey); + } + + return allOk; + } + + protected string fullUrl(string relUrl) + { + return $"{Configuration["ServerConf:BaseUrl"]}{relUrl}"; + } + + protected AnagKeyValueModel getAKVRec(string nomeVar) + { + AnagKeyValueModel answ = new AnagKeyValueModel(); + if (AKVList != null) + { + answ = AKVList.FirstOrDefault(x => x.NomeVar == nomeVar); + } + + return answ; + } + + protected string getAKVString(string nomeVar) + { + string answ = ""; + if (AKVList != null) + { + var currRec = AKVList.FirstOrDefault(x => x.NomeVar == nomeVar); + if (currRec != null) + { + answ = currRec.ValString; + } + } + + return answ; + } + + protected override async Task OnInitializedAsync() + { + // check init AKV + if (AKVList == null || AKVList.Count == 0) + { + AKVList = await DataService.AnagKeyValList(); + LicServ.InitAkv(); + } + } + + protected MarkupString traduci(string lemma) + { + MarkupString answ; + string rawHtml = DataService.Traduci(lemma, "IT"); + answ = new MarkupString(rawHtml); + return answ; + } + + #endregion Protected Methods + } +} \ No newline at end of file diff --git a/MP.Land/MP.Land.csproj b/MP.Land/MP.Land.csproj index 46488966..f3047c6d 100644 --- a/MP.Land/MP.Land.csproj +++ b/MP.Land/MP.Land.csproj @@ -3,7 +3,7 @@ net6.0 MP.Land - 6.16.2210.2110 + 6.16.2211.0415 diff --git a/MP.Land/Pages/About.razor.cs b/MP.Land/Pages/About.razor.cs index d07f8e45..a423fa16 100644 --- a/MP.Land/Pages/About.razor.cs +++ b/MP.Land/Pages/About.razor.cs @@ -1,40 +1,16 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components; -using System.Net.Http; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Components.Authorization; -using Microsoft.AspNetCore.Components.Forms; -using Microsoft.AspNetCore.Components.Routing; -using Microsoft.AspNetCore.Components.Web; -using Microsoft.AspNetCore.Components.Web.Virtualization; -using Microsoft.JSInterop; -using MP.Land; -using MP.Land.Shared; -using MP.Land.Data; using NLog; +using System; +using System.Threading.Tasks; namespace MP.Land.Pages { - public partial class About + public partial class About { - private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); - private string Titolo = ""; - private string Messaggio = ""; + #region Public Methods - private string ServerStatus = "SrvState"; - private string Installazione = "Inst"; - private string Applicazione = "App"; - private string Licenze = "#"; - private DateTime Scadenza = DateTime.Today; - private string MastKey = "########################"; + #endregion Public Methods - private string mainCss = "alert alert-info"; - private string remSrvCss = "bg-warning text-secondary"; - private string expDateCss = "bg-warning text-secondary"; - private string licenseCss = "bg-warning text-secondary"; + #region Protected Methods protected override async Task OnInitializedAsync() { @@ -43,6 +19,28 @@ namespace MP.Land.Pages await reloadLicenseData(); } + #endregion Protected Methods + + #region Private Fields + + private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); + private string Applicazione = "App"; + private string expDateCss = "bg-warning text-secondary"; + private string Installazione = "Inst"; + private string licenseCss = "bg-warning text-secondary"; + private string Licenze = "#"; + private string mainCss = "alert alert-info"; + private string MastKey = "########################"; + private string Messaggio = ""; + private string remSrvCss = "bg-warning text-secondary"; + private DateTime Scadenza = DateTime.Today; + private string ServerStatus = "SrvState"; + private string Titolo = ""; + + #endregion Private Fields + + #region Private Methods + private async Task reloadLicenseData() { int cDelay = 5; @@ -62,7 +60,7 @@ namespace MP.Land.Pages Licenze = $"{LicServ.NumLicDb}/{LicServ.NumLicRemote}"; licenseCss = ""; } - catch(Exception exc) + catch (Exception exc) { licenseCss = "bg-dark text-warning"; Log.Error($"Eccezione in reloadLicenseData:{Environment.NewLine}{exc}"); @@ -86,5 +84,7 @@ namespace MP.Land.Pages AppMService.PageName = "About"; AppMService.PageIcon = "fas fa-info-circle pr-2"; } + + #endregion Private Methods } } \ No newline at end of file diff --git a/MP.Land/Pages/Contacts.razor b/MP.Land/Pages/Contacts.razor index 22c72416..d621d0db 100644 --- a/MP.Land/Pages/Contacts.razor +++ b/MP.Land/Pages/Contacts.razor @@ -69,17 +69,3 @@ -@code { - - protected string Titolo = ""; - protected string Messaggio = ""; - - protected override void OnInitialized() - { - Titolo = "Mapo MES"; - Messaggio = "I nostri contattatti e siti di supporto"; - AppMService.ShowSearch = false; - AppMService.PageName = "Contacts"; - AppMService.PageIcon = "fas fa-envelope pr-2"; - } -} \ No newline at end of file diff --git a/MP.Land/Pages/Contacts.razor.cs b/MP.Land/Pages/Contacts.razor.cs new file mode 100644 index 00000000..7820bac8 --- /dev/null +++ b/MP.Land/Pages/Contacts.razor.cs @@ -0,0 +1,36 @@ +using System; + +namespace MP.Land.Pages +{ + public partial class Contacts : IDisposable + { + #region Public Methods + + public void Dispose() + { + GC.Collect(); + } + + #endregion Public Methods + + #region Protected Fields + + protected string Messaggio = ""; + protected string Titolo = ""; + + #endregion Protected Fields + + #region Protected Methods + + protected override void OnInitialized() + { + Titolo = "Mapo MES"; + Messaggio = "I nostri contattatti e siti di supporto"; + AppMService.ShowSearch = false; + AppMService.PageName = "Contacts"; + AppMService.PageIcon = "fas fa-envelope pr-2"; + } + + #endregion Protected Methods + } +} \ No newline at end of file diff --git a/MP.Land/Pages/Index.razor.cs b/MP.Land/Pages/Index.razor.cs index 89eb18b1..a11764f3 100644 --- a/MP.Land/Pages/Index.razor.cs +++ b/MP.Land/Pages/Index.razor.cs @@ -1,22 +1,23 @@ -using System; +using Microsoft.AspNetCore.Components; +using MP.Land.Data; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using MP.Land.Data; -using MP.Land.Components; -using Microsoft.AspNetCore.Components; -using Microsoft.Extensions.Configuration; -using MP.AppAuth.Models; namespace MP.Land.Pages { - public partial class Index + public partial class Index : IDisposable { - #region Private Fields + #region Public Methods - private List ListRecords; + public void Dispose() + { + ListRecords = null; + GC.Collect(); + } - #endregion Private Fields + #endregion Public Methods #region Protected Fields @@ -63,5 +64,11 @@ namespace MP.Land.Pages } #endregion Protected Methods + + #region Private Fields + + private List ListRecords; + + #endregion Private Fields } } \ No newline at end of file diff --git a/MP.Land/Pages/SysInfo.razor b/MP.Land/Pages/SysInfo.razor index d5cfbb5c..f4e8ffe2 100644 --- a/MP.Land/Pages/SysInfo.razor +++ b/MP.Land/Pages/SysInfo.razor @@ -42,25 +42,25 @@
    -
    Environment
    + Environment

    @Environment

    -
    Main DB Conf
    + Main DB Conf

    @DbNameExample

    -
    .net framework
    + .net framework

    @currHwSwInfo.runtimeImg

    -
    Main Assembly
    + Main Assembly

    @currHwSwInfo.mainAssembly

    @@ -81,7 +81,7 @@
    -
    Server Stats
    + Server Stats

    @currHwSwInfo.ServerStats
    @@ -89,7 +89,7 @@
    -
    IIS Stats
    + IIS Stats

    @currHwSwInfo.IISStats
    @@ -112,7 +112,7 @@
    -
    Elenco librerie
    + Elenco librerie @currHwSwInfo.numLibraries

    @@ -133,51 +133,3 @@

    -@code { - - // imposto i vari dati da mostrare a video senza indicare come bypassare... - protected string Titolo = "MAPO System Info"; - protected string Messaggio = "HW & SW details"; - protected HwSwInfo currHwSwInfo = HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()); - - protected string masterLic = ""; - - protected override async Task OnInitializedAsync() - { - await ReloadData(); - } - - protected async Task ReloadData() - { - var akvList = await DataService.AnagKeyValList(); - var licRecord = akvList - .Where(x => x.NomeVar == "MAPO") - .FirstOrDefault(); - if (licRecord != null) - { - masterLic = licRecord.ValString; - } - } - - protected string DbNameExample - { - get - { - string answ = Configuration["ConnectionStrings:DefaultConnection"]; - if (answ.IndexOf(";User ID=") > 0) - { - answ = answ.Substring(0, answ.IndexOf(";User ID=")); - } - return answ; - } - } - protected string Environment - { - get - { - string answ = Configuration["Environment"]; - return answ; - } - } - -} \ No newline at end of file diff --git a/MP.Land/Pages/SysInfo.razor.cs b/MP.Land/Pages/SysInfo.razor.cs new file mode 100644 index 00000000..a899e4f4 --- /dev/null +++ b/MP.Land/Pages/SysInfo.razor.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; +using System.Net.Http; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components.Authorization; +using Microsoft.AspNetCore.Components.Forms; +using Microsoft.AspNetCore.Components.Routing; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components.Web.Virtualization; +using Microsoft.JSInterop; +using MP.Land; +using MP.Land.Shared; +using MP.AppAuth; +using MP.Land.Data; +using Microsoft.Extensions.Configuration; + +namespace MP.Land.Pages +{ + public partial class SysInfo : IDisposable + { + public void Dispose() + { + GC.Collect(); + } + + // imposto i vari dati da mostrare a video senza indicare come bypassare... + protected string Titolo = "MAPO System Info"; + protected string Messaggio = "HW & SW details"; + protected HwSwInfo currHwSwInfo = HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()); + protected string masterLic = ""; + protected override async Task OnInitializedAsync() + { + await ReloadData(); + } + + protected async Task ReloadData() + { + var akvList = await DataService.AnagKeyValList(); + var licRecord = akvList.Where(x => x.NomeVar == "MAPO").FirstOrDefault(); + if (licRecord != null) + { + masterLic = licRecord.ValString; + } + } + + protected string DbNameExample + { + get + { + string answ = Configuration["ConnectionStrings:DefaultConnection"]; + if (answ.IndexOf(";User ID=") > 0) + { + answ = answ.Substring(0, answ.IndexOf(";User ID=")); + } + + return answ; + } + } + + protected string Environment + { + get + { + string answ = Configuration["Environment"]; + return answ; + } + } + } +} \ No newline at end of file diff --git a/MP.Land/Pages/UpdateManager.razor.cs b/MP.Land/Pages/UpdateManager.razor.cs index 5833a384..83737913 100644 --- a/MP.Land/Pages/UpdateManager.razor.cs +++ b/MP.Land/Pages/UpdateManager.razor.cs @@ -10,22 +10,24 @@ using System.Threading.Tasks; namespace MP.Land.Pages { - public partial class UpdateManager + public partial class UpdateManager : IDisposable { - #region Private Fields + #region Public Methods - private List ListRecords; + public void Dispose() + { + ListRecords = null; + GC.Collect(); + } - #endregion Private Fields + #endregion Public Methods #region Protected Fields protected int numDone = 0; protected int numTot = 0; protected int totalCount = 0; - protected double TotalMb = 0; - protected UpdateMan updateManAuth = new UpdateMan("SWDownloader", "viaD@nte16"); #endregion Protected Fields @@ -42,34 +44,12 @@ namespace MP.Land.Pages protected AppAuthService DataService { get; set; } protected string outMessages { get; set; } = ""; - protected int percLoading { get; set; } = 0; - protected bool showProgress { get; set; } = false; protected bool showUpdate { get; set; } = false; #endregion Protected Properties - #region Private Methods - - private async Task scaricaSingolo(AppAuth.Models.UpdMan item) - { - long size = 0; - if (item.IsAuth) - { - size = updateManAuth.downloadLatest(item.ManifestUrl, localPath(item.LocalRepo), item.PackName); - } - else - { - size = UpdateMan.obj.downloadLatest(item.ManifestUrl, localPath(item.LocalRepo), item.PackName); - } - numDone++; - percLoading = 100 * numDone / numTot; - return await Task.FromResult(size); - } - - #endregion Private Methods - #region Protected Methods /// @@ -151,5 +131,31 @@ namespace MP.Land.Pages } #endregion Protected Methods + + #region Private Fields + + private List ListRecords; + + #endregion Private Fields + + #region Private Methods + + private async Task scaricaSingolo(AppAuth.Models.UpdMan item) + { + long size = 0; + if (item.IsAuth) + { + size = updateManAuth.downloadLatest(item.ManifestUrl, localPath(item.LocalRepo), item.PackName); + } + else + { + size = UpdateMan.obj.downloadLatest(item.ManifestUrl, localPath(item.LocalRepo), item.PackName); + } + numDone++; + percLoading = 100 * numDone / numTot; + return await Task.FromResult(size); + } + + #endregion Private Methods } } \ No newline at end of file diff --git a/MP.Land/Pages/UserQr.razor.cs b/MP.Land/Pages/UserQr.razor.cs index fc85f926..61b68363 100644 --- a/MP.Land/Pages/UserQr.razor.cs +++ b/MP.Land/Pages/UserQr.razor.cs @@ -16,6 +16,9 @@ namespace MP.Land.Pages public void Dispose() { AppMService.EA_SearchUpdated -= OnSeachUpdated; + AppMService.EA_FilterUpdated -= OnFilterUpdated; + ListRecords = null; + GC.Collect(); } #endregion Public Methods diff --git a/MP.Land/Resources/ChangeLog.html b/MP.Land/Resources/ChangeLog.html index 16b19149..36121c06 100644 --- a/MP.Land/Resources/ChangeLog.html +++ b/MP.Land/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo gestione Programmi MAPO -

    Versione: 6.16.2210.2110

    +

    Versione: 6.16.2211.0415


    Note di rilascio:
      diff --git a/MP.Land/Resources/VersNum.txt b/MP.Land/Resources/VersNum.txt index 148d3a17..dd77557b 100644 --- a/MP.Land/Resources/VersNum.txt +++ b/MP.Land/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.2110 +6.16.2211.0415 diff --git a/MP.Land/Resources/manifest.xml b/MP.Land/Resources/manifest.xml index 06b6c830..e664437e 100644 --- a/MP.Land/Resources/manifest.xml +++ b/MP.Land/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.2110 + 6.16.2211.0415 https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html false diff --git a/MP.Land/Shared/MainLayout.razor b/MP.Land/Shared/MainLayout.razor index 8af3c918..e316dc69 100644 --- a/MP.Land/Shared/MainLayout.razor +++ b/MP.Land/Shared/MainLayout.razor @@ -26,35 +26,3 @@
    -@code { - bool ShowSearch { get; set; } = false; - - protected override void OnInitialized() - { - AppMService.EA_ShowSearch += OnShowSearch; - AppMService.EA_HideSearch += OnHideSearch; - } - public void OnShowSearch() - { - ShowSearch = true; - InvokeAsync(() => - { - StateHasChanged(); - }); - } - public void OnHideSearch() - { - ShowSearch = false; - InvokeAsync(() => - { - StateHasChanged(); - }); - } - - public void Dispose() - { - AppMService.EA_ShowSearch -= OnShowSearch; - AppMService.EA_ShowSearch -= OnHideSearch; - } - -} \ No newline at end of file diff --git a/MP.Land/Shared/MainLayout.razor.cs b/MP.Land/Shared/MainLayout.razor.cs new file mode 100644 index 00000000..ca9bc211 --- /dev/null +++ b/MP.Land/Shared/MainLayout.razor.cs @@ -0,0 +1,52 @@ +using System; + +namespace MP.Land.Shared +{ + public partial class MainLayout + { + #region Public Methods + + public void Dispose() + { + AppMService.EA_ShowSearch -= OnShowSearch; + AppMService.EA_ShowSearch -= OnHideSearch; + GC.Collect(); + } + + public void OnHideSearch() + { + ShowSearch = false; + InvokeAsync(() => + { + StateHasChanged(); + }); + } + + public void OnShowSearch() + { + ShowSearch = true; + InvokeAsync(() => + { + StateHasChanged(); + }); + } + + #endregion Public Methods + + #region Protected Methods + + protected override void OnInitialized() + { + AppMService.EA_ShowSearch += OnShowSearch; + AppMService.EA_HideSearch += OnHideSearch; + } + + #endregion Protected Methods + + #region Private Properties + + private bool ShowSearch { get; set; } = false; + + #endregion Private Properties + } +} \ No newline at end of file From 2c3feaa4f3f4daaa7d4a244d081a758e8b82bc91 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 4 Nov 2022 15:50:51 +0100 Subject: [PATCH 12/16] Refresh versione --- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 41d48c46..2f3a613f 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2211.410 + 6.16.2211.414 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 1ded9ae5..f769f4ca 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

    Versione: 6.16.2211.410

    +

    Versione: 6.16.2211.414


    Note di rilascio:
    • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 45c4675e..7cceff8d 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.410 +6.16.2211.414 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 47c7e4e5..673d3973 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.410 + 6.16.2211.414 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 From 8fbfea1f62ba9d32e4bc77a92bdbb447ee7013a9 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 4 Nov 2022 16:09:26 +0100 Subject: [PATCH 13/16] COmplreto refresh gestione licenze LAND - sistemato GC in generale - controllo e sistemazione calcolo data scadenza --- MP.Land/Data/LicenseService.cs | 30 +++++++++++++++++++++++++++++- MP.Land/MP.Land.csproj | 2 +- MP.Land/Pages/About.razor.cs | 9 +++------ MP.Land/Resources/ChangeLog.html | 2 +- MP.Land/Resources/VersNum.txt | 2 +- MP.Land/Resources/manifest.xml | 2 +- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 10 files changed, 40 insertions(+), 15 deletions(-) diff --git a/MP.Land/Data/LicenseService.cs b/MP.Land/Data/LicenseService.cs index a9919f55..baeb055c 100644 --- a/MP.Land/Data/LicenseService.cs +++ b/MP.Land/Data/LicenseService.cs @@ -372,7 +372,35 @@ namespace MP.Land.Data } else { - _logger.LogInformation($"Record non trovato per {authKey}"); + _logger.LogInformation($"checkLicenseActive | Record non trovato per {authKey}"); + } + } + return answ; + } + /// + /// Verifica scadenza licenza + /// + /// + /// + public DateTime getLicenseExpiry(string authKey) + { + DateTime answ = DateTime.Today.AddDays(-1); + //cerco anche nelle info AKV + if (AKVList != null) + { + var recLic = AKVList.Where(x => x.ValString == authKey).FirstOrDefault(); + int numLic = 0; + //cerco in record + if (recLic != null) + { + numLic = (int)recLic.ValInt; + // verifico scadenza licenza! + DateTime scadenza = licenseManGLS.expiryDateByAuthKey(Installazione, recLic.NomeVar, numLic, authKey); + answ = scadenza; + } + else + { + _logger.LogInformation($"getLicenseExpiry | Record non trovato per {authKey}"); } } return answ; diff --git a/MP.Land/MP.Land.csproj b/MP.Land/MP.Land.csproj index f3047c6d..e5d244a5 100644 --- a/MP.Land/MP.Land.csproj +++ b/MP.Land/MP.Land.csproj @@ -3,7 +3,7 @@ net6.0 MP.Land - 6.16.2211.0415 + 6.16.2211.0416 diff --git a/MP.Land/Pages/About.razor.cs b/MP.Land/Pages/About.razor.cs index a423fa16..2f7a0ded 100644 --- a/MP.Land/Pages/About.razor.cs +++ b/MP.Land/Pages/About.razor.cs @@ -4,12 +4,8 @@ using System.Threading.Tasks; namespace MP.Land.Pages { - public partial class About + public partial class About { - #region Public Methods - - #endregion Public Methods - #region Protected Methods protected override async Task OnInitializedAsync() @@ -43,7 +39,7 @@ namespace MP.Land.Pages private async Task reloadLicenseData() { - int cDelay = 5; + int cDelay = 10; // recupero dati await Task.Delay(cDelay); try @@ -54,6 +50,7 @@ namespace MP.Land.Pages Installazione = LicServ.Installazione; Applicazione = LicServ.Applicazione; MastKey = LicServ.MasterKey; + Scadenza = LicServ.getLicenseExpiry(LicServ.MasterKey); await Task.Delay(cDelay); var fatto = await LicServ.RefreshLicense(); await Task.Delay(cDelay); diff --git a/MP.Land/Resources/ChangeLog.html b/MP.Land/Resources/ChangeLog.html index 36121c06..9fbcacb8 100644 --- a/MP.Land/Resources/ChangeLog.html +++ b/MP.Land/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo gestione Programmi MAPO -

      Versione: 6.16.2211.0415

      +

      Versione: 6.16.2211.0416


      Note di rilascio:
        diff --git a/MP.Land/Resources/VersNum.txt b/MP.Land/Resources/VersNum.txt index dd77557b..3af0d134 100644 --- a/MP.Land/Resources/VersNum.txt +++ b/MP.Land/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.0415 +6.16.2211.0416 diff --git a/MP.Land/Resources/manifest.xml b/MP.Land/Resources/manifest.xml index e664437e..2f81485a 100644 --- a/MP.Land/Resources/manifest.xml +++ b/MP.Land/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.0415 + 6.16.2211.0416 https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html false diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 2f3a613f..e67b133f 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2211.414 + 6.16.2211.415 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index f769f4ca..ca2c5ffb 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

        Versione: 6.16.2211.414

        +

        Versione: 6.16.2211.415


        Note di rilascio:
        • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 7cceff8d..89994502 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.414 +6.16.2211.415 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 673d3973..ba47b183 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.414 + 6.16.2211.415 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 From bf654f54e6c14ded438cc675d15b58e4b69c909c Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 4 Nov 2022 16:13:02 +0100 Subject: [PATCH 14/16] resetSelect visibile solo se record selezionato + refresh dopo creazione dossier --- MP.SPEC/Components/ListDossiers.razor.cs | 11 +++++++++-- MP.SPEC/Components/ListODL.razor | 5 ++++- MP.SPEC/Components/ListPARAMS.razor | 5 ++++- MP.SPEC/Components/ListPODL.razor | 8 ++++++-- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/Articoli.razor | 7 +++++-- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 9 files changed, 32 insertions(+), 12 deletions(-) diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index 6acba0e4..a7b3c903 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -219,7 +219,7 @@ namespace MP.SPEC.Components isEditing = false; await Task.Delay(1); StateHasChanged(); - NavManager.NavigateTo(NavManager.Uri, true); + await flushCache(); } return; } @@ -413,7 +413,14 @@ namespace MP.SPEC.Components await RecordSelFlux.InvokeAsync(currFluxLogDto); await Task.Delay(1); } - + public async Task flushCache() + { + await Task.Delay(1); + await MDService.FlushRedisCache(); + await Task.Delay(1); + // rimando a pagina corrente + NavManager.NavigateTo(NavManager.Uri, true); + } private string css() { string answ = ""; diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor index 7c66823d..ed2e24d7 100644 --- a/MP.SPEC/Components/ListODL.razor +++ b/MP.SPEC/Components/ListODL.razor @@ -31,7 +31,10 @@ else
- + @if (currRecord != null) + { + + } Articolo Fase
- + @if (currRecord != null) + { + + } Data Macchina
- + @if (currRecord != null) + { + + } Articolo Fase @record.CodArticolo diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 2f3a613f..25febf97 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2211.414 + 6.16.2211.416 diff --git a/MP.SPEC/Pages/Articoli.razor b/MP.SPEC/Pages/Articoli.razor index 2cc76697..e067d09a 100644 --- a/MP.SPEC/Pages/Articoli.razor +++ b/MP.SPEC/Pages/Articoli.razor @@ -120,7 +120,10 @@
- + @if (currRecord != null) + { + + } Articolo Disegno
- +
@record.CodArticolo
diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index f769f4ca..3d2a01e5 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2211.414

+

Versione: 6.16.2211.416


Note di rilascio: