3dddc33ec1
handleclick nel nav manager
94 lines
2.8 KiB
C#
94 lines
2.8 KiB
C#
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.SessionStorage;
|
|
using MP.Data.DTO;
|
|
using MP.INVE.Data;
|
|
using Blazored.LocalStorage;
|
|
using MP.Data.DatabaseModels;
|
|
|
|
namespace MP.INVE.Pages
|
|
{
|
|
public partial class Starter
|
|
{
|
|
[Inject]
|
|
private IConfiguration Configuration { get; set; } = null!;
|
|
|
|
[Inject]
|
|
private ISessionStorageService sessionStorage { get; set; } = null!;
|
|
[Inject]
|
|
private ILocalStorageService localStorage { get; set; } = null!;
|
|
|
|
[Inject]
|
|
private MiDataService MIDataservice { get; set; } = null!;
|
|
|
|
private int idOperatore { get; set; } = 0;
|
|
private string authKey { get; set; } = "";
|
|
private List<AnagMagModel>? elencoMagazzini;
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
await Task.Delay(1);
|
|
elencoMagazzini = MIDataservice.ElencoMagazzini();
|
|
//await getId();
|
|
}
|
|
|
|
#if false
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
{
|
|
if (firstRender)
|
|
{
|
|
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}");
|
|
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", rawCode);
|
|
}
|
|
}
|
|
#endif
|
|
|
|
protected string BaseUrlTab { get => $"{Configuration["ServerConf:BaseUrl"]}"; }
|
|
|
|
#if false
|
|
protected async Task getId()
|
|
{
|
|
OperatoreDTO sess = new OperatoreDTO();
|
|
OperatoreDTO local = new OperatoreDTO();
|
|
sess = await sessionStorage.GetItemAsync<OperatoreDTO>("MatrOpr");
|
|
local = await localStorage.GetItemAsync<OperatoreDTO>("MatrOpr");
|
|
if ((local != null))
|
|
{
|
|
string auth = local.hashAuthKey;
|
|
idOperatore = local.MatrOpr;
|
|
authKey = auth;
|
|
}
|
|
else
|
|
{
|
|
NavManager.NavigateTo("OperatoreLogin");
|
|
}
|
|
}
|
|
#endif
|
|
[Inject]
|
|
private NavigationManager NavManager { get; set; } = null!;
|
|
#if false
|
|
protected string rawCode
|
|
{
|
|
get
|
|
{
|
|
string answ = "";
|
|
answ = $"{BaseUrlTab}MatrOpr={idOperatore}&UserAuthKey={authKey}";
|
|
return answ;
|
|
}
|
|
}
|
|
#endif
|
|
}
|
|
} |