From cc551835045d290747609bc7a22f771fddcdb25f Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Thu, 15 Dec 2022 17:12:40 +0100 Subject: [PATCH] fix grafici --- MP.INVE/Components/NavMenuTerm.razor.cs | 1 + MP.INVE/Components/ProcSuggestion.razor.cs | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/MP.INVE/Components/NavMenuTerm.razor.cs b/MP.INVE/Components/NavMenuTerm.razor.cs index c6a9a90c..95459c71 100644 --- a/MP.INVE/Components/NavMenuTerm.razor.cs +++ b/MP.INVE/Components/NavMenuTerm.razor.cs @@ -54,6 +54,7 @@ namespace MP.INVE.Components } protected async Task goBack() { + if(NavigationManager.Uri.Contains("")) await JSRuntime.InvokeVoidAsync("history.go", -1); } protected string hideText { get => showText ? "" : "invisible"; } diff --git a/MP.INVE/Components/ProcSuggestion.razor.cs b/MP.INVE/Components/ProcSuggestion.razor.cs index a45547cc..295c1027 100644 --- a/MP.INVE/Components/ProcSuggestion.razor.cs +++ b/MP.INVE/Components/ProcSuggestion.razor.cs @@ -39,9 +39,10 @@ namespace MP.INVE.Components public int sessID { get; set; } = 0; [Parameter] public string magID { get; set; } = ""; - + private string tipo { get; set; } = ""; private string canMod = "false"; + public string lastScanCheck { get; set; } = ""; protected AnagUdcModel? udc; protected AnagLottoModel? lottoInterno; @@ -73,6 +74,10 @@ namespace MP.INVE.Components currLottoInterno = null; currUdc = null; alreadyScan = null; + if (lastScan.StartsWith("S")) + { + lastScanCheck= lastScan.Substring(1); + } // se il valore scansionato è != null... if (string.IsNullOrEmpty(lastScan)) { @@ -86,7 +91,7 @@ namespace MP.INVE.Components var result = await MIService.tryGetConfig("MAG_SmartUdcEdit"); int sessIDSearch = 0; - if (lastScan.Contains("MFI") && lastScan.Length == 14) + if (lastScanCheck.Contains("MFI") && lastScanCheck.Length == 14) { sessIDSearch = sessID; } @@ -115,7 +120,7 @@ namespace MP.INVE.Components canMod = result; } await Task.Delay(1); - udc = MIService.IsUDC(lastScan); + udc = MIService.IsUDC(lastScanCheck); if (udc != null && !udc.UDC.Contains("MSL")) { @@ -131,6 +136,7 @@ namespace MP.INVE.Components } else { + if (lastScan.StartsWith("M") && lastScan.Length == 10) { lottoInterno = MIService.LottoInterno(lastScan); @@ -138,7 +144,7 @@ namespace MP.INVE.Components else { listLottiEsterni = MIService.LottoEsterno("", lastScan, magID); - if(listLottiEsterni.Count == 1) + if (listLottiEsterni.Count == 1) { lottoEsterno = listLottiEsterni.FirstOrDefault(); } @@ -200,20 +206,20 @@ namespace MP.INVE.Components if (artExists != null) { var force = false; - if(articoloScan != oldArt) + if (articoloScan != oldArt) { force = true; } var lottoSave = lastScan; var known = false; var unique = false; - if(currUdc != null) + if (currUdc != null) { lottoSave = currUdc.Lotto; known = true; unique = true; } - else if(currLottoEsterno != null || currLottoInterno != null) + else if (currLottoEsterno != null || currLottoInterno != null) { known = true;