From c4a521c81e6e990756be3fd79db28e45ed4d79c3 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 25 Feb 2026 19:40:38 +0100 Subject: [PATCH] Fix reset tab3 x Blazored storage --- MP-TAB3/MP-TAB3.csproj | 2 +- MP-TAB3/Pages/Logout.razor.cs | 5 +++ MP-TAB3/Program.cs | 11 ++++- MP-TAB3/Resources/ChangeLog.html | 2 +- MP-TAB3/Resources/VersNum.txt | 2 +- MP-TAB3/Resources/manifest.xml | 2 +- MP.Data/Services/MessageService.cs | 22 +++++++++- MP.SPEC/Components/Fermate/ListMacc.razor.cs | 45 +++++++++++--------- MP.SPEC/Components/ListGiacenze.razor.cs | 8 ---- MP.SPEC/Components/SelFilterXDL.razor.cs | 9 ---- MP.SPEC/Pages/ODL.razor.cs | 10 +---- MP.SPEC/Pages/PODL.razor.cs | 2 +- MP.SPEC/Pages/Podl2Kit.razor.cs | 7 +-- MP.SPEC/Program.cs | 16 +++---- 14 files changed, 72 insertions(+), 71 deletions(-) diff --git a/MP-TAB3/MP-TAB3.csproj b/MP-TAB3/MP-TAB3.csproj index 38e01b94..1b151a8e 100644 --- a/MP-TAB3/MP-TAB3.csproj +++ b/MP-TAB3/MP-TAB3.csproj @@ -3,7 +3,7 @@ net6.0 enable - 6.16.2511.1312 + 6.16.2602.2519 enable MP_TAB3 diff --git a/MP-TAB3/Pages/Logout.razor.cs b/MP-TAB3/Pages/Logout.razor.cs index 60973fab..ffc0dc0a 100644 --- a/MP-TAB3/Pages/Logout.razor.cs +++ b/MP-TAB3/Pages/Logout.razor.cs @@ -1,4 +1,7 @@ +#if false using Blazored.LocalStorage; +#endif + using Microsoft.AspNetCore.Components; using MP.Data.DTO; using MP.Data.Services; @@ -49,6 +52,8 @@ namespace MP_TAB3.Pages await MsgServ.LastOpenedPageSet(""); var CurrOprTknLS = await MsgServ.GetCurrOperDtoLSAsync(); var CurrDevGuid = await MsgServ.GetCurrDevGuidLSAsync(); + await MsgServ.ClearAllAsync(); + await MsgServ.SetCurrDevGuidLSAsync(CurrDevGuid); if (!string.IsNullOrEmpty(CurrOprTknLS)) { var decryptedData = MsgServ.DecryptData(CurrOprTknLS); diff --git a/MP-TAB3/Program.cs b/MP-TAB3/Program.cs index 6e52aee9..178df0d6 100644 --- a/MP-TAB3/Program.cs +++ b/MP-TAB3/Program.cs @@ -1,5 +1,7 @@ +#if false using Blazored.LocalStorage; -using Blazored.SessionStorage; +using Blazored.SessionStorage; +#endif using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.StaticFiles; @@ -41,8 +43,13 @@ builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddScoped(); +#if false builder.Services.AddBlazoredLocalStorage(); -builder.Services.AddBlazoredSessionStorage(); +builder.Services.AddBlazoredSessionStorage(); +#endif +// aggiunta helper local/session storage service +builder.Services.AddScoped(); +builder.Services.AddScoped(); // gestione email builder.Services.Configure(builder.Configuration.GetSection(nameof(MailKitMailSettings))); diff --git a/MP-TAB3/Resources/ChangeLog.html b/MP-TAB3/Resources/ChangeLog.html index d3b464de..9dda5ff5 100644 --- a/MP-TAB3/Resources/ChangeLog.html +++ b/MP-TAB3/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2511.1312

+

Versione: 6.16.2602.2519


Note di rilascio:
  • diff --git a/MP-TAB3/Resources/VersNum.txt b/MP-TAB3/Resources/VersNum.txt index 0bdcf60e..535178ba 100644 --- a/MP-TAB3/Resources/VersNum.txt +++ b/MP-TAB3/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2511.1312 +6.16.2602.2519 diff --git a/MP-TAB3/Resources/manifest.xml b/MP-TAB3/Resources/manifest.xml index 73033e81..32aceeba 100644 --- a/MP-TAB3/Resources/manifest.xml +++ b/MP-TAB3/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2511.1312 + 6.16.2602.2519 https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html false diff --git a/MP.Data/Services/MessageService.cs b/MP.Data/Services/MessageService.cs index 97b0de7d..d318a2ad 100644 --- a/MP.Data/Services/MessageService.cs +++ b/MP.Data/Services/MessageService.cs @@ -1,5 +1,7 @@ -using Blazored.LocalStorage; -using Blazored.SessionStorage; +#if false +using Blazored.LocalStorage; +using Blazored.SessionStorage; +#endif using EgwCoreLib.Utils; using Microsoft.Extensions.Configuration; using MP.Data.DbModels; @@ -427,12 +429,16 @@ namespace MP.Data.Services /// public async Task GetLastMatrOprAsync() { +#if false int answ = -1; var result = await localStorage.GetItemAsync("lastMatrOpr"); if (!string.IsNullOrEmpty(result)) { answ = int.Parse(result); } + return answ; +#endif + int answ = await localStorage.GetItemAsync("lastMatrOpr", -1); return answ; } @@ -538,6 +544,18 @@ namespace MP.Data.Services return answ; } + /// + /// Clear del record OperatoreDTO nel localstorage + /// + /// + public async Task ClearAllAsync() + { + bool answ = false; + await localStorage.ClearAsync(); + answ = true; + return answ; + } + /// /// Scrive il valore di IPV4 del device nel localstoragee /// diff --git a/MP.SPEC/Components/Fermate/ListMacc.razor.cs b/MP.SPEC/Components/Fermate/ListMacc.razor.cs index 0ea9d405..01d7a5e8 100644 --- a/MP.SPEC/Components/Fermate/ListMacc.razor.cs +++ b/MP.SPEC/Components/Fermate/ListMacc.razor.cs @@ -21,29 +21,14 @@ namespace MP.SPEC.Components.Fermate #region Protected Properties - private string varName(string key) - { - return $"ListMacc_{key}"; - } - - /// - /// Rilettura preferenze utente... - /// - /// - /// - private async Task ReloadUserPref() - { - numRecord = await localStorage.GetItemAsync(varName("numRec"), 10); - } - - [Inject] - protected LocalStorageService localStorage { get; set; } = null!; - /// /// Elenco selezione corrente /// protected List CurrList { get; set; } = new List(); + [Inject] + protected ILocalStorageService localStorage { get; set; } = null!; + /// /// Conteggio elementi selezionati /// @@ -104,12 +89,12 @@ namespace MP.SPEC.Components.Fermate return answ; } - protected override async Task OnInitializedAsync() + protected override async Task OnAfterRenderAsync(bool firstRender) { await ReloadUserPref(); } - protected override async Task OnAfterRenderAsync(bool firstRender) + protected override async Task OnInitializedAsync() { await ReloadUserPref(); } @@ -121,7 +106,6 @@ namespace MP.SPEC.Components.Fermate ReloadData(); } - /// /// Richiesta update /// @@ -193,11 +177,15 @@ namespace MP.SPEC.Components.Fermate #region Private Fields private bool AllSelected = false; + private int currPage = 1; + private bool isLoading = false; private List ListRecords = new(); + private int numRecord = 10; + private int totalCount = 0; #endregion Private Fields @@ -217,6 +205,21 @@ namespace MP.SPEC.Components.Fermate isLoading = false; } + /// + /// Rilettura preferenze utente... + /// + /// + /// + private async Task ReloadUserPref() + { + numRecord = await localStorage.GetItemAsync(varName("numRec"), 10); + } + + private string varName(string key) + { + return $"ListMacc_{key}"; + } + #endregion Private Methods } } \ No newline at end of file diff --git a/MP.SPEC/Components/ListGiacenze.razor.cs b/MP.SPEC/Components/ListGiacenze.razor.cs index 9e5df93e..24f37bbe 100644 --- a/MP.SPEC/Components/ListGiacenze.razor.cs +++ b/MP.SPEC/Components/ListGiacenze.razor.cs @@ -1,6 +1,3 @@ -#if false -using Blazored.SessionStorage; -#endif using Microsoft.AspNetCore.Components; using MP.Data.DbModels; using MP.SPEC.Data; @@ -60,11 +57,6 @@ namespace MP.SPEC.Components [Inject] private NavigationManager NavManager { get; set; } = null!; -#if false - [Inject] - private ISessionStorageService sessionStorage { get; set; } = null!; -#endif - #endregion Private Properties #region Private Methods diff --git a/MP.SPEC/Components/SelFilterXDL.razor.cs b/MP.SPEC/Components/SelFilterXDL.razor.cs index a6f444ea..7577bac1 100644 --- a/MP.SPEC/Components/SelFilterXDL.razor.cs +++ b/MP.SPEC/Components/SelFilterXDL.razor.cs @@ -1,7 +1,3 @@ -#if false -using Blazored.LocalStorage; -#endif - using Microsoft.AspNetCore.Components; using MP.Data.DbModels; using MP.Data.Services; @@ -45,13 +41,8 @@ namespace MP.SPEC.Components get => currFilter.IsActive; } -#if false [Inject] protected ILocalStorageService localStorage { get; set; } = null!; -#endif - - [Inject] - protected LocalStorageService localStorage { get; set; } = null!; protected DateTime selDtEnd { diff --git a/MP.SPEC/Pages/ODL.razor.cs b/MP.SPEC/Pages/ODL.razor.cs index 6786c9b3..a364953f 100644 --- a/MP.SPEC/Pages/ODL.razor.cs +++ b/MP.SPEC/Pages/ODL.razor.cs @@ -1,6 +1,3 @@ -#if false -using Blazored.LocalStorage; -#endif using EgwCoreLib.Razor; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; @@ -46,13 +43,8 @@ namespace MP.SPEC.Pages [Inject] protected IJSRuntime JSRuntime { get; set; } = null!; -#if false [Inject] - protected ILocalStorageService localStorage { get; set; } = null!; -#endif - - [Inject] - protected LocalStorageService localStorage { get; set; } = null!; + protected ILocalStorageService localStorage { get; set; } = null!; [Inject] protected MpDataService MDService { get; set; } = null!; diff --git a/MP.SPEC/Pages/PODL.razor.cs b/MP.SPEC/Pages/PODL.razor.cs index 36f25293..ce20588b 100644 --- a/MP.SPEC/Pages/PODL.razor.cs +++ b/MP.SPEC/Pages/PODL.razor.cs @@ -67,7 +67,7 @@ namespace MP.SPEC.Pages #endif [Inject] - protected LocalStorageService localStorage { get; set; } = null!; + protected ILocalStorageService localStorage { get; set; } = null!; [Inject] protected MpDataService MDService { get; set; } = null!; diff --git a/MP.SPEC/Pages/Podl2Kit.razor.cs b/MP.SPEC/Pages/Podl2Kit.razor.cs index 28cb9722..9e8e270a 100644 --- a/MP.SPEC/Pages/Podl2Kit.razor.cs +++ b/MP.SPEC/Pages/Podl2Kit.razor.cs @@ -1,6 +1,3 @@ -#if false -using Blazored.LocalStorage; -#endif using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.JSInterop; @@ -42,11 +39,11 @@ namespace MP.SPEC.Pages #if false [Inject] - protected ILocalStorageService localStorage { get; set; } = null!; + protected ILocalStorageService localStorage { get; set; } = null!; #endif [Inject] - protected LocalStorageService localStorage { get; set; } = null!; + protected ILocalStorageService localStorage { get; set; } = null!; [Inject] protected MpDataService MDService { get; set; } = null!; diff --git a/MP.SPEC/Program.cs b/MP.SPEC/Program.cs index 2601b9bd..23fcc447 100644 --- a/MP.SPEC/Program.cs +++ b/MP.SPEC/Program.cs @@ -1,8 +1,4 @@ -#if false -using Blazored.LocalStorage; -using Blazored.SessionStorage; -#endif -using Microsoft.AspNetCore.Authentication.Negotiate; +using Microsoft.AspNetCore.Authentication.Negotiate; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.StaticFiles; @@ -161,11 +157,11 @@ builder.Services.AddSingleton(); builder.Services.AddBlazoredLocalStorage(); builder.Services.AddBlazoredSessionStorage(); #endif -// aggiunta helper seesion storage service -//builder.Services.AddScoped(); -//builder.Services.AddScoped(); -builder.Services.AddScoped(); -builder.Services.AddScoped(); +// aggiunta helper local/session storage service +builder.Services.AddScoped(); +builder.Services.AddScoped(); +//builder.Services.AddScoped(); +//builder.Services.AddScoped(); //builder.Services.AddScoped(sp => // new SessionStorageService(sp.GetRequiredService())); //builder.Services.AddScoped(sp =>