diff --git a/MP.Data/MP.Data.csproj b/MP.Data/MP.Data.csproj index 8f08d1cd..ce53566c 100644 --- a/MP.Data/MP.Data.csproj +++ b/MP.Data/MP.Data.csproj @@ -16,6 +16,7 @@ + diff --git a/MP.Data/Utils.cs b/MP.Data/Utils.cs index 555607d8..87026808 100644 --- a/MP.Data/Utils.cs +++ b/MP.Data/Utils.cs @@ -1,4 +1,7 @@ -using System; +using Blazored.LocalStorage; +using Microsoft.AspNetCore.Components; +using MP.Data.DTO; +using System; using System.Collections.Generic; using System.ComponentModel; using System.IO; @@ -10,6 +13,7 @@ namespace MP.Data public class Utils { #region Public Properties + public static string redKeyArtUsed { @@ -105,6 +109,20 @@ namespace MP.Data return answ; } + [Inject] + protected ILocalStorageService localStorage { get; set; } = null!; + [Inject] + protected NavigationManager NavManager { get; set; } = null!; + protected async Task getId() + { + OperatoreDTO local = new OperatoreDTO(); + local = await localStorage.GetItemAsync("MatrOpr"); + if ((local == null)) + { + NavManager.NavigateTo("OperatoreLogin"); + } + } + #endregion Public Methods } } \ No newline at end of file diff --git a/MP.INVE/Data/LoginService.cs b/MP.INVE/Data/LoginService.cs index dd08f946..e2e124bf 100644 --- a/MP.INVE/Data/LoginService.cs +++ b/MP.INVE/Data/LoginService.cs @@ -1,4 +1,6 @@ -using MP.Data.DTO; +using Blazored.LocalStorage; +using Microsoft.AspNetCore.Components; +using MP.Data.DTO; using Newtonsoft.Json; using NLog; using StackExchange.Redis; @@ -220,6 +222,9 @@ namespace MP.INVE.Data protected HttpClient HttpClient { get; set; } protected IHttpContextAccessor HttpContextAccessor { get; set; } + [Inject] + protected ILocalStorageService localStorage { get; set; } + #endregion Protected Properties #region Private Fields diff --git a/MP.INVE/MP.INVE.csproj b/MP.INVE/MP.INVE.csproj index 3689cff4..c37ab6ce 100644 --- a/MP.INVE/MP.INVE.csproj +++ b/MP.INVE/MP.INVE.csproj @@ -5,7 +5,7 @@ enable enable MP.INVE - 6.16.2211.1615 + 6.16.2211.1616 diff --git a/MP.INVE/Pages/Acquisizione.razor b/MP.INVE/Pages/Acquisizione.razor index cc8f5205..a7b2ae9b 100644 --- a/MP.INVE/Pages/Acquisizione.razor +++ b/MP.INVE/Pages/Acquisizione.razor @@ -2,6 +2,4 @@

Acquisizione

-@code { -} diff --git a/MP.INVE/Pages/Acquisizione.razor.cs b/MP.INVE/Pages/Acquisizione.razor.cs new file mode 100644 index 00000000..99a28ab5 --- /dev/null +++ b/MP.INVE/Pages/Acquisizione.razor.cs @@ -0,0 +1,44 @@ +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.INVE; +using MP.INVE.Shared; +using MP.INVE.Components; +using Blazored.LocalStorage; +using MP.Data.DTO; + +namespace MP.INVE.Pages +{ + public partial class Acquisizione + { +#if false + [Inject] + protected ILocalStorageService localStorage { get; set; } = null!; + [Inject] + protected NavigationManager NavManager { get; set; } = null!; + protected async Task getId() + { + OperatoreDTO local = new OperatoreDTO(); + local = await localStorage.GetItemAsync("MatrOpr"); + if ((local == null)) + { + NavManager.NavigateTo("OperatoreLogin"); + } + } +#endif + protected override async Task OnInitializedAsync() + { + //await getId(); + } + } +} \ No newline at end of file diff --git a/MP.INVE/Pages/Index.razor.cs b/MP.INVE/Pages/Index.razor.cs index 1bf390b6..24845251 100644 --- a/MP.INVE/Pages/Index.razor.cs +++ b/MP.INVE/Pages/Index.razor.cs @@ -1,5 +1,7 @@ +using Blazored.LocalStorage; using Microsoft.AspNetCore.Components; using MP.Data.DatabaseModels; +using MP.Data.DTO; using MP.INVE.Data; namespace MP.INVE.Pages @@ -29,9 +31,24 @@ namespace MP.INVE.Pages // currAzienda = currRec.Valore; // } //} + //await getId(); await Task.Delay(1); } - +#if false + [Inject] + protected ILocalStorageService localStorage { get; set; } = null!; + [Inject] + protected NavigationManager NavManager { get; set; } = null!; + protected async Task getId() + { + OperatoreDTO local = new OperatoreDTO(); + local = await localStorage.GetItemAsync("MatrOpr"); + if ((local == null)) + { + NavManager.NavigateTo("OperatoreLogin"); + } + } +#endif #endregion Protected Methods #region Private Fields diff --git a/MP.INVE/Pages/Invio.razor b/MP.INVE/Pages/Invio.razor index 6199b0ca..c481ef41 100644 --- a/MP.INVE/Pages/Invio.razor +++ b/MP.INVE/Pages/Invio.razor @@ -2,6 +2,4 @@

Invio

-@code { -} diff --git a/MP.INVE/Pages/Invio.razor.cs b/MP.INVE/Pages/Invio.razor.cs new file mode 100644 index 00000000..9988e20a --- /dev/null +++ b/MP.INVE/Pages/Invio.razor.cs @@ -0,0 +1,31 @@ +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.INVE; +using MP.INVE.Shared; +using MP.INVE.Components; +using Blazored.LocalStorage; +using MP.Data.DTO; +using MP.Data; + +namespace MP.INVE.Pages +{ + public partial class Invio + { + + protected override async Task OnInitializedAsync() + { + + } + } +} \ No newline at end of file diff --git a/MP.INVE/Pages/Session.razor.cs b/MP.INVE/Pages/Session.razor.cs index 936bfa3d..92a8377d 100644 --- a/MP.INVE/Pages/Session.razor.cs +++ b/MP.INVE/Pages/Session.razor.cs @@ -16,6 +16,8 @@ using MP.INVE.Shared; using MP.INVE.Components; using MP.Data.DatabaseModels; using MP.INVE.Data; +using MP.Data.DTO; +using Blazored.LocalStorage; namespace MP.INVE.Pages { @@ -29,8 +31,25 @@ namespace MP.INVE.Pages protected override async Task OnInitializedAsync() { //await FilterChanged.InvokeAsync(actFilter); + //await getId(); await Task.Delay(1); elencoSessioni = MIDataservice.InventSessCurrList(); } + +#if false + [Inject] + protected ILocalStorageService localStorage { get; set; } = null!; + [Inject] + protected NavigationManager NavManager { get; set; } = null!; + protected async Task getId() + { + OperatoreDTO local = new OperatoreDTO(); + local = await localStorage.GetItemAsync("MatrOpr"); + if ((local == null)) + { + NavManager.NavigateTo("OperatoreLogin"); + } + } +#endif } } \ No newline at end of file diff --git a/MP.INVE/Program.cs b/MP.INVE/Program.cs index 7fab8411..1326542e 100644 --- a/MP.INVE/Program.cs +++ b/MP.INVE/Program.cs @@ -41,6 +41,7 @@ builder.Services.AddHttpContextAccessor(); builder.Services.AddSingleton(redisMultiplexer); builder.Services.AddSingleton(); builder.Services.AddScoped(); +builder.Services.AddScoped(); // aggiungere servizio da usare come DI x gestione session, aggiungere anche local storage builder.Services.AddBlazoredSessionStorage(); diff --git a/MP.INVE/Resources/ChangeLog.html b/MP.INVE/Resources/ChangeLog.html index 08233761..db464b6c 100644 --- a/MP.INVE/Resources/ChangeLog.html +++ b/MP.INVE/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOINVE -

Versione: 6.16.2211.1615

+

Versione: 6.16.2211.1616


Note di rilascio:
  • diff --git a/MP.INVE/Resources/VersNum.txt b/MP.INVE/Resources/VersNum.txt index e237fd3e..c7a3e740 100644 --- a/MP.INVE/Resources/VersNum.txt +++ b/MP.INVE/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.1615 +6.16.2211.1616 diff --git a/MP.INVE/Resources/manifest.xml b/MP.INVE/Resources/manifest.xml index 09e085a6..6db4351e 100644 --- a/MP.INVE/Resources/manifest.xml +++ b/MP.INVE/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.1615 + 6.16.2211.1616 https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html false