Files
mapo-core/MP.INVE/Pages/Jumper.razor.cs
T
zaccaria.majid 8118574c9b bozza jumper
2022-11-21 15:49:30 +01:00

61 lines
2.0 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.LocalStorage;
using Microsoft.AspNetCore.WebUtilities;
using MP.INVE.Data;
using MP.Data.DatabaseModels;
namespace MP.INVE.Pages
{
public partial class Jumper
{
[Inject]
protected ILocalStorageService localStorage { get; set; } = null!;
[Inject]
protected NavigationManager NavManager { get; set; } = null!;
[Inject]
protected MiDataService MIService { get; set; } = null!;
private string logged { get; set; } = "";
private List<AnagOperatoriModel> operatore = new List<AnagOperatoriModel>();
protected string idOPeratore { get; set; } = null!;
protected string authKey { get; set; } = null!;
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("MatrOpr", out var _matrOpr) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("UserAuthKey", out var _authKey))
{
idOPeratore = _matrOpr;
authKey = _authKey;
}
operatore = MIService.ElencoOperatori(int.Parse(idOPeratore), MIService.DeriptData(authKey));
if(operatore.Count == 1)
{
logged = "success";
NavManager.NavigateTo("Acquisizione");
}
else
{
logged = "not success";
}
}
}
}