bozza local storage

This commit is contained in:
zaccaria.majid
2022-11-16 16:47:48 +01:00
parent 630ff7462c
commit 87c1ba13b8
14 changed files with 143 additions and 11 deletions
+1
View File
@@ -16,6 +16,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.9" />
+19 -1
View File
@@ -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<OperatoreDTO>("MatrOpr");
if ((local == null))
{
NavManager.NavigateTo("OperatoreLogin");
}
}
#endregion Public Methods
}
}
+6 -1
View File
@@ -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
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.INVE</RootNamespace>
<Version>6.16.2211.1615</Version>
<Version>6.16.2211.1616</Version>
</PropertyGroup>
<ItemGroup>
-2
View File
@@ -2,6 +2,4 @@
<h3>Acquisizione</h3>
@code {
}
+44
View File
@@ -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<OperatoreDTO>("MatrOpr");
if ((local == null))
{
NavManager.NavigateTo("OperatoreLogin");
}
}
#endif
protected override async Task OnInitializedAsync()
{
//await getId();
}
}
}
+18 -1
View File
@@ -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<OperatoreDTO>("MatrOpr");
if ((local == null))
{
NavManager.NavigateTo("OperatoreLogin");
}
}
#endif
#endregion Protected Methods
#region Private Fields
-2
View File
@@ -2,6 +2,4 @@
<h3>Invio</h3>
@code {
}
+31
View File
@@ -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()
{
}
}
}
+19
View File
@@ -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<OperatoreDTO>("MatrOpr");
if ((local == null))
{
NavManager.NavigateTo("OperatoreLogin");
}
}
#endif
}
}
+1
View File
@@ -41,6 +41,7 @@ builder.Services.AddHttpContextAccessor();
builder.Services.AddSingleton<IConnectionMultiplexer>(redisMultiplexer);
builder.Services.AddSingleton<MiDataService>();
builder.Services.AddScoped<MessageService>();
builder.Services.AddScoped<LoginService>();
// aggiungere servizio da usare come DI x gestione session, aggiungere anche local storage
builder.Services.AddBlazoredSessionStorage();
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOINVE </i>
<h4>Versione: 6.16.2211.1615</h4>
<h4>Versione: 6.16.2211.1616</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2211.1615
6.16.2211.1616
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2211.1615</version>
<version>6.16.2211.1616</version>
<url>https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>