Fix reset tab3 x Blazored storage

This commit is contained in:
Samuele Locatelli
2026-02-25 19:40:38 +01:00
parent 4890692531
commit c4a521c81e
14 changed files with 72 additions and 71 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2511.1312</Version>
<Version>6.16.2602.2519</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB3</RootNamespace>
</PropertyGroup>
+5
View File
@@ -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);
+9 -2
View File
@@ -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<OrderDataSrv>();
builder.Services.AddSingleton<SharedMemService>();
builder.Services.AddSingleton<TabDataService>();
builder.Services.AddScoped<MessageService>();
#if false
builder.Services.AddBlazoredLocalStorage();
builder.Services.AddBlazoredSessionStorage();
builder.Services.AddBlazoredSessionStorage();
#endif
// aggiunta helper local/session storage service
builder.Services.AddScoped<ISessionStorageService, SessionStorageService>();
builder.Services.AddScoped<ILocalStorageService, LocalStorageService>();
// gestione email
builder.Services.Configure<MailKitMailSettings>(builder.Configuration.GetSection(nameof(MailKitMailSettings)));
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2511.1312</h4>
<h4>Versione: 6.16.2602.2519</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2511.1312
6.16.2602.2519
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2511.1312</version>
<version>6.16.2602.2519</version>
<url>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+20 -2
View File
@@ -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
/// <returns></returns>
public async Task<int> GetLastMatrOprAsync()
{
#if false
int answ = -1;
var result = await localStorage.GetItemAsync<string>("lastMatrOpr");
if (!string.IsNullOrEmpty(result))
{
answ = int.Parse(result);
}
return answ;
#endif
int answ = await localStorage.GetItemAsync<int>("lastMatrOpr", -1);
return answ;
}
@@ -538,6 +544,18 @@ namespace MP.Data.Services
return answ;
}
/// <summary>
/// Clear del record OperatoreDTO nel localstorage
/// </summary>
/// <returns></returns>
public async Task<bool> ClearAllAsync()
{
bool answ = false;
await localStorage.ClearAsync();
answ = true;
return answ;
}
/// <summary>
/// Scrive il valore di IPV4 del device nel localstoragee
/// </summary>
+24 -21
View File
@@ -21,29 +21,14 @@ namespace MP.SPEC.Components.Fermate
#region Protected Properties
private string varName(string key)
{
return $"ListMacc_{key}";
}
/// <summary>
/// Rilettura preferenze utente...
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
private async Task ReloadUserPref()
{
numRecord = await localStorage.GetItemAsync<int>(varName("numRec"), 10);
}
[Inject]
protected LocalStorageService localStorage { get; set; } = null!;
/// <summary>
/// Elenco selezione corrente
/// </summary>
protected List<string> CurrList { get; set; } = new List<string>();
[Inject]
protected ILocalStorageService localStorage { get; set; } = null!;
/// <summary>
/// Conteggio elementi selezionati
/// </summary>
@@ -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();
}
/// <summary>
/// Richiesta update
/// </summary>
@@ -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<MappaStatoExplModel> ListRecords = new();
private int numRecord = 10;
private int totalCount = 0;
#endregion Private Fields
@@ -217,6 +205,21 @@ namespace MP.SPEC.Components.Fermate
isLoading = false;
}
/// <summary>
/// Rilettura preferenze utente...
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
private async Task ReloadUserPref()
{
numRecord = await localStorage.GetItemAsync<int>(varName("numRec"), 10);
}
private string varName(string key)
{
return $"ListMacc_{key}";
}
#endregion Private Methods
}
}
-8
View File
@@ -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
-9
View File
@@ -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
{
+1 -9
View File
@@ -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!;
+1 -1
View File
@@ -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!;
+2 -5
View File
@@ -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!;
+6 -10
View File
@@ -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<TabDataFeeder>();
builder.Services.AddBlazoredLocalStorage();
builder.Services.AddBlazoredSessionStorage();
#endif
// aggiunta helper seesion storage service
//builder.Services.AddScoped<ISessionStorageService, SessionStorageService>();
//builder.Services.AddScoped<ILocalStorageService, LocalStorageService>();
builder.Services.AddScoped<SessionStorageService>();
builder.Services.AddScoped<LocalStorageService>();
// aggiunta helper local/session storage service
builder.Services.AddScoped<ISessionStorageService, SessionStorageService>();
builder.Services.AddScoped<ILocalStorageService, LocalStorageService>();
//builder.Services.AddScoped<SessionStorageService>();
//builder.Services.AddScoped<LocalStorageService>();
//builder.Services.AddScoped<ISessionStorageService>(sp =>
// new SessionStorageService(sp.GetRequiredService<IJSRuntime>()));
//builder.Services.AddScoped<ILocalStorageService>(sp =>