diff --git a/MP.INVE/Components/ProcSess.razor b/MP.INVE/Components/ProcSess.razor index 2d3a5591..374e0314 100644 --- a/MP.INVE/Components/ProcSess.razor +++ b/MP.INVE/Components/ProcSess.razor @@ -1,23 +1,26 @@ @if (lastScanSessione != "0" && !string.IsNullOrEmpty(lastScanSessione)) { - @if (sessioneScelta != null) + @if (currSess != null) {
Id sessione:
- @sessioneScelta.InveSessID + @currSess.InveSessID
Descrizione sessione:
- @sessioneScelta.Description + @currSess.Description
Descrizione magazzino:
- @sessioneScelta.AnagMagNav.DescMag + @if (currSess.AnagMagNav != null) + { + @currSess.AnagMagNav.DescMag + }
- +
} } \ No newline at end of file diff --git a/MP.INVE/Components/ProcSess.razor.cs b/MP.INVE/Components/ProcSess.razor.cs index 1335f1df..7682b18a 100644 --- a/MP.INVE/Components/ProcSess.razor.cs +++ b/MP.INVE/Components/ProcSess.razor.cs @@ -41,8 +41,7 @@ namespace MP.INVE.Components protected MessageService MsgService { get; set; } = null!; - protected InventorySessionModel? sessioneScelta = new InventorySessionModel(); - protected List? elencoSessioni = new List(); + protected InventorySessionModel? currSess = new InventorySessionModel(); protected override async Task OnInitializedAsync() { @@ -59,16 +58,16 @@ namespace MP.INVE.Components await Task.Delay(1); if (lastScanSessione != null) { - sessioneScelta = MIService.InventSessByID(int.Parse(lastScanSessione)); + currSess = MIService.InventSessByID(int.Parse(lastScanSessione)); } } - protected async void connetti(int sessionId, string magazzinoId) + protected void connetti(int sessionId, string magazzinoId) { var decrypt = MIService.DeriptData(authKey); var log = MIService.loginOperatore(idOpr, decrypt); if (log) { - if (sessioneScelta != null) + if (currSess != null) { //string hash = MIService.EncriptData(sessioneScelta.authKey); diff --git a/MP.INVE/Pages/Jumper.razor b/MP.INVE/Pages/Jumper.razor index d50d059f..99977787 100644 --- a/MP.INVE/Pages/Jumper.razor +++ b/MP.INVE/Pages/Jumper.razor @@ -16,17 +16,16 @@ else } @**@ - @json @if (rawScan != "") { @if (string.IsNullOrEmpty(idOpr)) { } - @*@if(inveSessionId == 0) + else if(inveSessionId == 0) { - }*@ + } } } diff --git a/MP.INVE/Pages/Jumper.razor.cs b/MP.INVE/Pages/Jumper.razor.cs index a1c092e6..05567e3d 100644 --- a/MP.INVE/Pages/Jumper.razor.cs +++ b/MP.INVE/Pages/Jumper.razor.cs @@ -46,26 +46,36 @@ namespace MP.INVE.Pages { 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) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("idSessione", out var _inveSessionId) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("idMag", out var _codMag)) + 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; } - if (inveSessionId != 0) - { - inveSessionId = int.Parse(_inveSessionId); - } - } + +#if false if (!string.IsNullOrEmpty(idOpr) && !string.IsNullOrEmpty(authKey)) { isFullUrl = true; @@ -100,13 +110,14 @@ namespace MP.INVE.Pages NavManager.NavigateTo($"Acquisizione?idSess={inveSessionId}&idOpr={idOpr}&codMag={codMag}"); } } - } + } +#endif } string json = ""; - Dictionary uriProc = new Dictionary(); + Dictionary uriProcDict = new Dictionary(); protected void saveScan(string newScan) { - uriProc.Clear(); + uriProcDict.Clear(); if (!string.IsNullOrEmpty(newScan)) { //eseguo split su "?" e divido in due il link @@ -118,12 +129,17 @@ namespace MP.INVE.Pages for (int i = 0; i < uriProc2.Length; i++) { uriProc3 = uriProc2[i].Split("="); - uriProc.Add(uriProc3[0], uriProc3[1]); + uriProcDict.Add(uriProc3[0], uriProc3[1]); } - json = JsonConvert.SerializeObject(uriProc); - - rawScan = uriProc["MatrOpr"]; + if (string.IsNullOrEmpty(idOpr)) + { + rawScan = uriProcDict["MatrOpr"]; + } + else + { + rawScan = uriProcDict["IdSessione"]; + } } } protected string rawScan { get; set; } = null!;