From eec6bd99e2101b547d4cd89fccec97cd8548aa8b Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 6 Dec 2018 17:17:26 +0100 Subject: [PATCH] Fix serializzazioni varie, vers 1033 --- MP-Site/WebUserControls/mod_statoMacchina.ascx.cs | 3 ++- MapoDb/resoconti.cs | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/MP-Site/WebUserControls/mod_statoMacchina.ascx.cs b/MP-Site/WebUserControls/mod_statoMacchina.ascx.cs index e5d1a63f..ef8ff7ae 100644 --- a/MP-Site/WebUserControls/mod_statoMacchina.ascx.cs +++ b/MP-Site/WebUserControls/mod_statoMacchina.ascx.cs @@ -65,7 +65,8 @@ namespace MP_SITE.WebUserControls string hashKeyMSE = memLayer.ML.redHash("Tab:MSE:" + IdxMacchina); string hashKeyAS = memLayer.ML.redHash("Tab:AnagStati"); string serVal = ""; - if (memLayer.ML.redHashPresent(hashKeyMSE)) + if (memLayer.ML.redKeyPresent(hashKeyMSE)) + //if (memLayer.ML.redHashPresent(hashKeyMSE)) { serVal = memLayer.ML.getRSV(hashKeyMSE); tabMSE = (DS_ProdTempi.MappaStatoExplDataTable)memLayer.ML.deserializeVal(serVal); diff --git a/MapoDb/resoconti.cs b/MapoDb/resoconti.cs index e528f164..db3110fd 100644 --- a/MapoDb/resoconti.cs +++ b/MapoDb/resoconti.cs @@ -372,7 +372,9 @@ public class resoconti Dictionary answ = new Dictionary(); if (memLayer.ML.isInCacheObject("codColore")) { - answ = (Dictionary)memLayer.ML.objCacheObj("codColore"); + string redKey = memLayer.ML.redHash("codColore"); + string serVal = memLayer.ML.getRSV(redKey); + answ = JsonConvert.DeserializeObject>(serVal); } else { @@ -401,7 +403,8 @@ public class resoconti } answ.Add(item.IdxStato, _colore); } - memLayer.ML.setCacheVal("codColore", answ, true); + string serVal = JsonConvert.SerializeObject(answ); + memLayer.ML.setCacheVal("codColore", serVal, true); } return answ; }