50d65eebaa
- renaming classi gestione DbModels in - spostamento anagrafica flussi da auth a generale
129 lines
3.8 KiB
C#
129 lines
3.8 KiB
C#
using Blazored.LocalStorage;
|
|
using Blazored.SessionStorage;
|
|
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.AspNetCore.WebUtilities;
|
|
using MP.Data.DbModels;
|
|
using MP.Data.DTO;
|
|
using MP.INVE.Data;
|
|
using Newtonsoft.Json;
|
|
using System.Numerics;
|
|
using System.Web;
|
|
|
|
namespace MP.INVE.Pages
|
|
{
|
|
public partial class Jumper
|
|
{
|
|
#region Protected Properties
|
|
|
|
protected string authKey { get; set; } = "";
|
|
|
|
protected string codMag { get; set; } = "";
|
|
|
|
protected AnagOperatoriModel currOpr { get; set; } = null!;
|
|
protected string idOpr { get; set; } = "";
|
|
|
|
protected int inveSessionId { get; set; } = 0;
|
|
protected bool isFullUrl { get; set; } = false;
|
|
|
|
[Inject]
|
|
protected ILocalStorageService localStorage { get; set; } = null!;
|
|
|
|
[Inject]
|
|
protected MiDataService MIService { get; set; } = null!;
|
|
|
|
[Inject]
|
|
protected MessageService MsgService { get; set; } = null!;
|
|
|
|
[Inject]
|
|
protected NavigationManager NavManager { get; set; } = null!;
|
|
|
|
protected string rawScan { get; set; } = null!;
|
|
|
|
[Inject]
|
|
protected ISessionStorageService sessionStorage { get; set; } = null!;
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Protected Methods
|
|
|
|
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))
|
|
{
|
|
if (!string.IsNullOrEmpty(_matrOpr))
|
|
{
|
|
idOpr = _matrOpr;
|
|
}
|
|
}
|
|
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("UserAuthKey", out var _authKey))
|
|
{
|
|
if (!string.IsNullOrEmpty(_authKey))
|
|
{
|
|
authKey = _authKey;
|
|
}
|
|
}
|
|
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("idSessione", out var _inveSessionId))
|
|
{
|
|
if (_inveSessionId != 0)
|
|
{
|
|
inveSessionId = int.Parse(_inveSessionId);
|
|
}
|
|
}
|
|
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("idMag", out var _codMag))
|
|
{
|
|
if (!string.IsNullOrEmpty(_codMag))
|
|
{
|
|
codMag = _codMag;
|
|
}
|
|
}
|
|
}
|
|
|
|
protected void saveScan(string newScan)
|
|
{
|
|
//uriProcDict.Clear();
|
|
if (!string.IsNullOrEmpty(newScan))
|
|
{
|
|
#if false
|
|
//eseguo split su "?" e divido in due il link
|
|
var uriProc1 = newScan.Split("?");
|
|
//eseguo split su "&" e divido il rimanente del link ottenendo cos� le variabili singole
|
|
var uriProc2 = uriProc1[1].Split("&");
|
|
string[] uriProc3;
|
|
|
|
for (int i = 0; i < uriProc2.Length; i++)
|
|
{
|
|
uriProc3 = uriProc2[i].Split("=");
|
|
uriProcDict.Add(uriProc3[0], uriProc3[1]);
|
|
}
|
|
|
|
if (string.IsNullOrEmpty(idOpr))
|
|
{
|
|
rawScan = uriProcDict["MatrOpr"];
|
|
}
|
|
else
|
|
{
|
|
rawScan = uriProcDict["IdSessione"];
|
|
}
|
|
#endif
|
|
rawScan = newScan;
|
|
}
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Fields
|
|
|
|
private List<AnagOperatoriModel> operatore = new List<AnagOperatoriModel>();
|
|
private Dictionary<string, string> uriProcDict = new Dictionary<string, string>();
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Private Properties
|
|
|
|
private bool logged { get; set; } = false;
|
|
|
|
#endregion Private Properties
|
|
}
|
|
} |