From 50d0f973d7827989e9fa7a314b8380ee0d3b2d3d Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Wed, 28 Dec 2022 12:38:26 +0100 Subject: [PATCH 1/4] minor fix --- MP.INVE/Pages/Jumper.razor | 4 ++-- MP.INVE/Pages/Jumper.razor.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MP.INVE/Pages/Jumper.razor b/MP.INVE/Pages/Jumper.razor index 99977787..604ba77b 100644 --- a/MP.INVE/Pages/Jumper.razor +++ b/MP.INVE/Pages/Jumper.razor @@ -8,11 +8,11 @@ else { @if (idOpr == "0") { - Selezionare l'operatore + Scansionare l'operatore } else { - Selezionare la sessione + Scansionare la sessione } @**@ diff --git a/MP.INVE/Pages/Jumper.razor.cs b/MP.INVE/Pages/Jumper.razor.cs index 425467a4..05567e3d 100644 --- a/MP.INVE/Pages/Jumper.razor.cs +++ b/MP.INVE/Pages/Jumper.razor.cs @@ -121,9 +121,9 @@ namespace MP.INVE.Pages if (!string.IsNullOrEmpty(newScan)) { //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++) From 94c119b70c13150c13afd5be04e50bc34122cec5 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Wed, 28 Dec 2022 14:40:30 +0100 Subject: [PATCH 2/4] cambio approccio login operatore --- MP.INVE/Components/ProcSess.razor | 51 +++++++++++++++++----------- MP.INVE/Components/ProcSess.razor.cs | 23 +++---------- MP.INVE/Data/MiDataService.cs | 8 ++--- MP.INVE/MP.INVE.csproj | 2 +- MP.INVE/Pages/Invio.razor.cs | 2 +- MP.INVE/Pages/Jumper.razor | 22 +++--------- MP.INVE/Pages/Jumper.razor.cs | 7 ++-- MP.INVE/Resources/ChangeLog.html | 2 +- MP.INVE/Resources/VersNum.txt | 2 +- MP.INVE/Resources/manifest.xml | 2 +- 10 files changed, 53 insertions(+), 68 deletions(-) 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..c3b69b5c 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,11 +56,14 @@ 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) { @@ -69,25 +73,6 @@ namespace MP.INVE.Components { if (currSess != null) { - - //string hash = MIService.EncriptData(sessioneScelta.authKey); -#if false - OperatoreDTO sessionOpr = new OperatoreDTO - { - MatrOpr = idOpr, - Nome = sessioneScelta.Nome, - Cognome = sessioneScelta.Cognome, - hashAuthKey = authKey, - dtExp = DateTime.Now.AddMinutes(1) - }; -#endif - -#if false - await localStorage.SetItemAsync("MatrOpr", currOpr); - localStorage.SetItemAsync("idSessione", inveSessionId); - await MsgService.setCurrOperDtoAsync(sessionOpr); -#endif - 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..ef1a8f3e 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.2814 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 604ba77b..4393e5cb 100644 --- a/MP.INVE/Pages/Jumper.razor +++ b/MP.INVE/Pages/Jumper.razor @@ -6,26 +6,12 @@ } else { - @if (idOpr == "0") - { - Scansionare l'operatore - } - else - { - Scansionare 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 05567e3d..1a8a52ec 100644 --- a/MP.INVE/Pages/Jumper.razor.cs +++ b/MP.INVE/Pages/Jumper.razor.cs @@ -117,9 +117,10 @@ 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("?"); //eseguo split su "&" e divido il rimanente del link ottenendo così le variabili singole @@ -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..c0b96a0c 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.2814


Note di rilascio:
  • diff --git a/MP.INVE/Resources/VersNum.txt b/MP.INVE/Resources/VersNum.txt index 65e0e45e..cdd33687 100644 --- a/MP.INVE/Resources/VersNum.txt +++ b/MP.INVE/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2212.2812 +6.16.2212.2814 diff --git a/MP.INVE/Resources/manifest.xml b/MP.INVE/Resources/manifest.xml index 7cea4f89..47efcbe2 100644 --- a/MP.INVE/Resources/manifest.xml +++ b/MP.INVE/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2212.2812 + 6.16.2212.2814 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 From 31d8386867d02c572c316e62030decf76f9d4a92 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Wed, 28 Dec 2022 15:18:44 +0100 Subject: [PATCH 3/4] fix login terminalino --- MP.Data/Controllers/MpInveController.cs | 1 + MP.INVE/Components/NavMenuTerm.razor | 11 +++++++++++ MP.INVE/Components/NavMenuTerm.razor.cs | 26 +++++++++++++++++++++---- MP.INVE/Components/ProcSess.razor.cs | 13 ++++++++++++- MP.INVE/MP.INVE.csproj | 2 +- MP.INVE/Resources/ChangeLog.html | 2 +- MP.INVE/Resources/VersNum.txt | 2 +- MP.INVE/Resources/manifest.xml | 2 +- 8 files changed, 50 insertions(+), 9 deletions(-) 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..3f3bef7f 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.cs b/MP.INVE/Components/ProcSess.razor.cs index c3b69b5c..721889ff 100644 --- a/MP.INVE/Components/ProcSess.razor.cs +++ b/MP.INVE/Components/ProcSess.razor.cs @@ -65,7 +65,7 @@ namespace MP.INVE.Components } 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); @@ -73,6 +73,17 @@ namespace MP.INVE.Components { if (currSess != null) { + InveSessDTO currSess = new InveSessDTO() + { + MatrOpr = idOpr, + InveSessID = sessionId, + MagID = magazzinoId, + hashAuthKey = authKey, + dtExp = DateTime.Now.AddHours(8) + }; + + await localStorage.SetItemAsync("SessioneCorrente", currSess); + NavManager.NavigateTo($"Acquisizione?idSess={sessionId}&idOpr={idOpr}&codMag={magazzinoId}"); } } diff --git a/MP.INVE/MP.INVE.csproj b/MP.INVE/MP.INVE.csproj index ef1a8f3e..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.2814 + 6.16.2212.2815 diff --git a/MP.INVE/Resources/ChangeLog.html b/MP.INVE/Resources/ChangeLog.html index c0b96a0c..798fac8c 100644 --- a/MP.INVE/Resources/ChangeLog.html +++ b/MP.INVE/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOINVE -

Versione: 6.16.2212.2814

+

Versione: 6.16.2212.2815


Note di rilascio:
  • diff --git a/MP.INVE/Resources/VersNum.txt b/MP.INVE/Resources/VersNum.txt index cdd33687..b1d3f509 100644 --- a/MP.INVE/Resources/VersNum.txt +++ b/MP.INVE/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2212.2814 +6.16.2212.2815 diff --git a/MP.INVE/Resources/manifest.xml b/MP.INVE/Resources/manifest.xml index 47efcbe2..cbba0261 100644 --- a/MP.INVE/Resources/manifest.xml +++ b/MP.INVE/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2212.2814 + 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 From eb8a70dd44a1eabfabb42430fd8267bf9866b442 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Wed, 28 Dec 2022 15:23:36 +0100 Subject: [PATCH 4/4] cambio icona --- MP.INVE/Components/NavMenuTerm.razor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MP.INVE/Components/NavMenuTerm.razor b/MP.INVE/Components/NavMenuTerm.razor index 3f3bef7f..0b40fe4b 100644 --- a/MP.INVE/Components/NavMenuTerm.razor +++ b/MP.INVE/Components/NavMenuTerm.razor @@ -46,7 +46,7 @@