From 8e3acc8b84aced80d0f2a4c717bed83df5fb9846 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 8 Jun 2017 16:03:37 +0200 Subject: [PATCH] refresh metodi redis... --- MP-IO/Controllers/IOBController.cs | 32 ++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/MP-IO/Controllers/IOBController.cs b/MP-IO/Controllers/IOBController.cs index 74731a3f..5f4432e5 100644 --- a/MP-IO/Controllers/IOBController.cs +++ b/MP-IO/Controllers/IOBController.cs @@ -223,7 +223,7 @@ namespace MP_IO.Controllers Int32.TryParse(id.ToString(), out idx); try { - long count = memLayer.ML.setRCI(string.Format("CNT{0}", idx)); + long count = memLayer.ML.setRCntI(string.Format("CNT{0}", idx)); answ = count.ToString(); } catch (Exception exc) @@ -249,7 +249,35 @@ namespace MP_IO.Controllers Int32.TryParse(id.ToString(), out idx); try { - answ = memLayer.ML.getRSV(string.Format("CNT{0}", idx)); + int answInt = memLayer.ML.getRCnt(string.Format("CNT{0}", idx)); + answ = answInt.ToString(); + //answ = answ != "" ? answ : "0"; + } + catch (Exception exc) + { + logger.lg.scriviLog(string.Format("Errore in getrediscount{0}{1}", Environment.NewLine, exc)); + answ = "NO"; + } + } + return answ; + } + // GET: IOB/getredis/5 + public string resetrediscount(int? id) + { + string answ = "ND"; + // se id nullo --> KO! + if (id == null) + { + answ = "KO"; + } + else + { + int idx = 0; + Int32.TryParse(id.ToString(), out idx); + try + { + bool fatto = memLayer.ML.resetRCnt(string.Format("CNT{0}", idx)); + answ = fatto ? "ZEROED" : "ERROR"; } catch (Exception exc) {