diff --git a/MP.Data/Controllers/MpInveController.cs b/MP.Data/Controllers/MpInveController.cs index ffa5fbef..ea482d01 100644 --- a/MP.Data/Controllers/MpInveController.cs +++ b/MP.Data/Controllers/MpInveController.cs @@ -644,6 +644,7 @@ namespace MP.Data.Controllers InventorySessionModel dbResult = new InventorySessionModel(); using (var dbCtx = new MoonPro_InveContext(_configuration)) { + dbResult = dbCtx .DbInveSess .Where(x => x.InveSessID == sessID) diff --git a/MP.INVE/Components/NavMenuTerm.razor b/MP.INVE/Components/NavMenuTerm.razor index d58eaf02..0b40fe4b 100644 --- a/MP.INVE/Components/NavMenuTerm.razor +++ b/MP.INVE/Components/NavMenuTerm.razor @@ -42,6 +42,17 @@ + + diff --git a/MP.INVE/Components/NavMenuTerm.razor.cs b/MP.INVE/Components/NavMenuTerm.razor.cs index 8e1e8691..9003a6ba 100644 --- a/MP.INVE/Components/NavMenuTerm.razor.cs +++ b/MP.INVE/Components/NavMenuTerm.razor.cs @@ -35,14 +35,18 @@ namespace MP.INVE.Components protected string cssScanBack = ""; protected string cssCancBack = ""; - protected string @cssCancScan = ""; + protected string cssCancScan = ""; + + + + protected string authKey = ""; + protected int idOpr = 0; protected override async Task OnInitializedAsync() { await Task.Delay(1); if (isScan) { cssCancScan = "bg-info"; - cssScanBack = "background-color: rgba(255,255,255,0.7)"; cssScan = "fw-bold text-decoration-underline"; } @@ -64,21 +68,35 @@ namespace MP.INVE.Components } protected async Task goBack() { - if (NavigationManager.Uri.Contains("")) + if (NavManager.Uri.Contains("")) await JSRuntime.InvokeVoidAsync("history.go", -1); } + + protected async Task changeSess() + { + var currSess = await localStorage.GetItemAsync("SessioneCorrente"); + + if(currSess != null) + { + authKey = currSess.hashAuthKey; + idOpr = currSess.MatrOpr; + + NavManager.NavigateTo($"Jumper?MatrOpr={idOpr}&UserAuthKey={authKey}"); + } + } protected string hideText { get => showText ? "" : "invisible"; } [Parameter] public EventCallback EC_compressUpdated { get; set; } [Parameter] public bool isScan { get; set; } = false; + [Parameter] public string link { get; set; } = ""; [Inject] protected ILocalStorageService localStorage { get; set; } = null!; [Inject] - protected NavigationManager NavigationManager { get; set; } = null!; + protected NavigationManager NavManager { get; set; } = null!; [Inject] protected IJSRuntime JSRuntime { get; set; } = null!; diff --git a/MP.INVE/Components/ProcSess.razor b/MP.INVE/Components/ProcSess.razor index 374e0314..ef0277cf 100644 --- a/MP.INVE/Components/ProcSess.razor +++ b/MP.INVE/Components/ProcSess.razor @@ -1,26 +1,37 @@ -@if (lastScanSessione != "0" && !string.IsNullOrEmpty(lastScanSessione)) +@if (isLoading) { - @if (currSess != null) + +} +else +{ + @if (lastScanSessione != "0" && !string.IsNullOrEmpty(lastScanSessione)) { -
-
- Id sessione: -
- @currSess.InveSessID -
- Descrizione sessione: -
- @currSess.Description -
- Descrizione magazzino: -
- @if (currSess.AnagMagNav != null) - { - @currSess.AnagMagNav.DescMag - } + @if (currSess != null) + { +
+
+ Id sessione: +
+ @currSess.InveSessID +
+ Descrizione sessione: +
+ @currSess.Description +
+ Descrizione magazzino: +
+ @if (currSess.AnagMagNav != null) + { + @currSess.AnagMagNav.DescMag + } +
+
- -
+ } + else + { +
Sessione inesistente
+ } } } \ No newline at end of file diff --git a/MP.INVE/Components/ProcSess.razor.cs b/MP.INVE/Components/ProcSess.razor.cs index 7682b18a..721889ff 100644 --- a/MP.INVE/Components/ProcSess.razor.cs +++ b/MP.INVE/Components/ProcSess.razor.cs @@ -40,6 +40,7 @@ namespace MP.INVE.Components [Inject] protected MessageService MsgService { get; set; } = null!; + protected bool isLoading = false; protected InventorySessionModel? currSess = new InventorySessionModel(); @@ -55,13 +56,16 @@ namespace MP.INVE.Components } private async Task reloadData(bool first) { + currSess = null; + isLoading = true; await Task.Delay(1); if (lastScanSessione != null) { currSess = MIService.InventSessByID(int.Parse(lastScanSessione)); } + isLoading = false; } - protected void connetti(int sessionId, string magazzinoId) + protected async void connetti(int sessionId, string magazzinoId) { var decrypt = MIService.DeriptData(authKey); var log = MIService.loginOperatore(idOpr, decrypt); @@ -69,24 +73,16 @@ namespace MP.INVE.Components { if (currSess != null) { - - //string hash = MIService.EncriptData(sessioneScelta.authKey); -#if false - OperatoreDTO sessionOpr = new OperatoreDTO + InveSessDTO currSess = new InveSessDTO() { MatrOpr = idOpr, - Nome = sessioneScelta.Nome, - Cognome = sessioneScelta.Cognome, + InveSessID = sessionId, + MagID = magazzinoId, hashAuthKey = authKey, - dtExp = DateTime.Now.AddMinutes(1) + dtExp = DateTime.Now.AddHours(8) }; -#endif -#if false - await localStorage.SetItemAsync("MatrOpr", currOpr); - localStorage.SetItemAsync("idSessione", inveSessionId); - await MsgService.setCurrOperDtoAsync(sessionOpr); -#endif + await localStorage.SetItemAsync("SessioneCorrente", currSess); NavManager.NavigateTo($"Acquisizione?idSess={sessionId}&idOpr={idOpr}&codMag={magazzinoId}"); } diff --git a/MP.INVE/Data/MiDataService.cs b/MP.INVE/Data/MiDataService.cs index cbd85e32..cdbe9d92 100644 --- a/MP.INVE/Data/MiDataService.cs +++ b/MP.INVE/Data/MiDataService.cs @@ -390,10 +390,10 @@ namespace MP.INVE.Data InventorySessionModel result = new InventorySessionModel(); string source = "DB"; result = dbController.InventSessByID(sessID); - if (result == null) - { - result = new InventorySessionModel(); - } + //if (result == null) + //{ + // result = new InventorySessionModel(); + //} stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; Log.Debug($"InventSessByID Read from {source}: {ts.TotalMilliseconds}ms"); diff --git a/MP.INVE/MP.INVE.csproj b/MP.INVE/MP.INVE.csproj index 0b353cef..3f2eb60e 100644 --- a/MP.INVE/MP.INVE.csproj +++ b/MP.INVE/MP.INVE.csproj @@ -5,7 +5,7 @@ enable enable MP.INVE - 6.16.2212.2812 + 6.16.2212.2815 diff --git a/MP.INVE/Pages/Invio.razor.cs b/MP.INVE/Pages/Invio.razor.cs index 8a5fae9a..95533ab6 100644 --- a/MP.INVE/Pages/Invio.razor.cs +++ b/MP.INVE/Pages/Invio.razor.cs @@ -140,7 +140,7 @@ namespace MP.INVE.Pages if ((sessione.DtEnd == null) && (!sessione.Transferred)) { await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}"); - await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", rawCode); + await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", sessione.InveSessID); } } } diff --git a/MP.INVE/Pages/Jumper.razor b/MP.INVE/Pages/Jumper.razor index 99977787..4393e5cb 100644 --- a/MP.INVE/Pages/Jumper.razor +++ b/MP.INVE/Pages/Jumper.razor @@ -6,26 +6,12 @@ } else { - @if (idOpr == "0") - { - Selezionare l'operatore - } - else - { - Selezionare la sessione - } + Scansionare la sessione @**@ - @if (rawScan != "") - { - @if (string.IsNullOrEmpty(idOpr)) - { - - } - else if(inveSessionId == 0) - { - - } + @if (!string.IsNullOrEmpty(rawScan)) + { + } } diff --git a/MP.INVE/Pages/Jumper.razor.cs b/MP.INVE/Pages/Jumper.razor.cs index 425467a4..1a8a52ec 100644 --- a/MP.INVE/Pages/Jumper.razor.cs +++ b/MP.INVE/Pages/Jumper.razor.cs @@ -117,13 +117,14 @@ namespace MP.INVE.Pages Dictionary uriProcDict = new Dictionary(); protected void saveScan(string newScan) { - uriProcDict.Clear(); + //uriProcDict.Clear(); if (!string.IsNullOrEmpty(newScan)) { +#if false //eseguo split su "?" e divido in due il link - //var uriProc1 = newScan.Split("?"); + var uriProc1 = newScan.Split("?"); //eseguo split su "&" e divido il rimanente del link ottenendo così le variabili singole - var uriProc2 = newScan.Split("&"); + var uriProc2 = uriProc1[1].Split("&"); string[] uriProc3; for (int i = 0; i < uriProc2.Length; i++) @@ -139,7 +140,9 @@ namespace MP.INVE.Pages else { rawScan = uriProcDict["IdSessione"]; - } + } +#endif + rawScan = newScan; } } protected string rawScan { get; set; } = null!; diff --git a/MP.INVE/Resources/ChangeLog.html b/MP.INVE/Resources/ChangeLog.html index 1b0f1be9..798fac8c 100644 --- a/MP.INVE/Resources/ChangeLog.html +++ b/MP.INVE/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOINVE -

Versione: 6.16.2212.2812

+

Versione: 6.16.2212.2815


Note di rilascio:
  • diff --git a/MP.INVE/Resources/VersNum.txt b/MP.INVE/Resources/VersNum.txt index 65e0e45e..b1d3f509 100644 --- a/MP.INVE/Resources/VersNum.txt +++ b/MP.INVE/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2212.2812 +6.16.2212.2815 diff --git a/MP.INVE/Resources/manifest.xml b/MP.INVE/Resources/manifest.xml index 7cea4f89..cbba0261 100644 --- a/MP.INVE/Resources/manifest.xml +++ b/MP.INVE/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2212.2812 + 6.16.2212.2815 https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html false