From 9853d9d1bf5d92c987ff064e13dcceff8f942b38 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Thu, 15 Dec 2022 15:30:55 +0100 Subject: [PATCH] sempre fix gestione lotto esterno --- MP.INVE/Components/ProcSuggestion.razor.cs | 8 +++++++- MP.INVE/Data/MiDataService.cs | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/MP.INVE/Components/ProcSuggestion.razor.cs b/MP.INVE/Components/ProcSuggestion.razor.cs index f56aa515..a45547cc 100644 --- a/MP.INVE/Components/ProcSuggestion.razor.cs +++ b/MP.INVE/Components/ProcSuggestion.razor.cs @@ -46,6 +46,7 @@ namespace MP.INVE.Components protected AnagUdcModel? udc; protected AnagLottoModel? lottoInterno; protected AnagLottiArca? lottoEsterno; + protected List? listLottiEsterni; protected ScanDataModel? alreadyScan; protected AnagUdcModel? currUdc; @@ -136,8 +137,13 @@ namespace MP.INVE.Components } else { - lottoEsterno = MIService.LottoEsterno("", lastScan, magID); + listLottiEsterni = MIService.LottoEsterno("", lastScan, magID); + if(listLottiEsterni.Count == 1) + { + lottoEsterno = listLottiEsterni.FirstOrDefault(); + } } + if (lottoInterno != null) { canSave = true; diff --git a/MP.INVE/Data/MiDataService.cs b/MP.INVE/Data/MiDataService.cs index daa4bb91..94cffed8 100644 --- a/MP.INVE/Data/MiDataService.cs +++ b/MP.INVE/Data/MiDataService.cs @@ -314,12 +314,12 @@ namespace MP.INVE.Data } - public AnagLottiArca LottoEsterno(string codArt, string codLotto, string codMagazzino) + public List LottoEsterno(string codArt, string codLotto, string codMagazzino) { string source = ""; Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); - AnagLottiArca? result = new AnagLottiArca(); + List? result = new List(); // cerco in redis... result = dbController.LottoEsterno(codArt, codLotto, codMagazzino); source = "DB"; @@ -392,12 +392,12 @@ namespace MP.INVE.Data return result; } - public ScanDataModel ScanByValueSessionOpr(string scanData, int inveSessId, string Opr) + public List ScanByValueSessionOpr(string scanData, int inveSessId, string Opr) { string source = ""; Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); - ScanDataModel? result = new ScanDataModel(); + List? result = new List(); result = dbController.ScanByValueSessionOpr(scanData, inveSessId, Opr); source = "DB"; stopWatch.Stop();