From 1b82c45f61eeb48b337ff5396264e367f28ad18d Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 1 Dec 2022 12:59:35 +0100 Subject: [PATCH] Fix naviazione ODL --- MP.Data/Controllers/MpSpecController.cs | 15 --------------- MP.SPEC/Components/ListOdlLotto.razor | 2 +- MP.SPEC/Components/ListOdlLotto.razor.cs | 2 +- MP.SPEC/Data/MpDataService.cs | 8 ++++++-- MP.SPEC/Pages/PODL.razor.cs | 8 +++++--- 5 files changed, 13 insertions(+), 22 deletions(-) diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index e45e05e8..1b09a9c8 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -719,22 +719,7 @@ namespace MP.Data.Controllers g => g.IdxMacchina, m => m.IdxMacchina, (g, m) => m - - //(m, g) => new Macchine - //{ - // IdxMacchina = m.IdxMacchina, - // CodMacchina = m.CodMacchina, - // Descrizione = m.Descrizione, - // Nome = m.Nome, - // Note = m.Note, - // url = m.url, - // locazione = m.locazione, - // css = m.css, - // RowNum = m.RowNum, - // ColNum = m.ColNum - //} ) - //.Distinct() .AsNoTracking() .OrderBy(x => x.IdxMacchina) .ToList(); diff --git a/MP.SPEC/Components/ListOdlLotto.razor b/MP.SPEC/Components/ListOdlLotto.razor index 81c8c85b..810910bc 100644 --- a/MP.SPEC/Components/ListOdlLotto.razor +++ b/MP.SPEC/Components/ListOdlLotto.razor @@ -18,7 +18,7 @@ { - + @item diff --git a/MP.SPEC/Components/ListOdlLotto.razor.cs b/MP.SPEC/Components/ListOdlLotto.razor.cs index 616e2bd3..6eede785 100644 --- a/MP.SPEC/Components/ListOdlLotto.razor.cs +++ b/MP.SPEC/Components/ListOdlLotto.razor.cs @@ -22,7 +22,7 @@ namespace MP.SPEC.Components { [Parameter] - public string BatchSel { get; set; } + public string BatchSel { get; set; } = null!; private List elencoODL { get; set; } = new List(); diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index a4dbd916..5cb0397d 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -1074,8 +1074,12 @@ namespace MP.SPEC.Data RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) { - result = JsonConvert.DeserializeObject($"{rawData}"); - readType = "REDIS"; + var rawResult = JsonConvert.DeserializeObject($"{rawData}"); + if (rawResult != null) + { + result = rawResult; + readType = "REDIS"; + } } else { diff --git a/MP.SPEC/Pages/PODL.razor.cs b/MP.SPEC/Pages/PODL.razor.cs index 89aaf465..9f349cad 100644 --- a/MP.SPEC/Pages/PODL.razor.cs +++ b/MP.SPEC/Pages/PODL.razor.cs @@ -234,8 +234,6 @@ namespace MP.SPEC.Pages private List? ListStati; - private List? SearchRecords; - #endregion Private Fields #region Private Properties @@ -428,7 +426,11 @@ namespace MP.SPEC.Pages ListArticoli = await MDService.ArticoliGetSearch(100, currAzienda, artSearch); if (ListGruppiFase != null) { - currGruppoSel = ListGruppiFase.Where(x => x.CodGruppo == selReparto).FirstOrDefault(); + var firstGroup = ListGruppiFase.Where(x => x.CodGruppo == selReparto).FirstOrDefault(); + if (firstGroup != null) + { + currGruppoSel = firstGroup; + } } isLoading = false; }