diff --git a/MP-IO/Controllers/IOBController.cs b/MP-IO/Controllers/IOBController.cs
index 7a4a71b7..00a9ecb8 100644
--- a/MP-IO/Controllers/IOBController.cs
+++ b/MP-IO/Controllers/IOBController.cs
@@ -29,19 +29,8 @@ namespace MP_IO.Controllers
try
{
- bool isEnabled = false;
- // verifico se sia abilitato INSERT x una data macchina... con REDIS se abilitato
- if (memLayer.ML.CRB("IOB_RedEnab"))
- {
- isEnabled = DataLayer.insEnab(idx);
- }
- // ...oppure dritto su DB
- else
- {
- isEnabled = MapoDb.MapoDb.obj.insEnabled(idx);
- }
// salvo risposta!
- answ = isEnabled ? "OK" : "NO";
+ answ = DataLayer.insEnab(idx) ? "OK" : "NO";
}
catch (Exception exc)
{
@@ -66,19 +55,7 @@ namespace MP_IO.Controllers
Int32.TryParse(id.ToString(), out idx);
try
{
- bool isEnabled = false;
- // verifico se sia abilitato SignalLog x una data macchina... con REDIS se abilitato
- if (memLayer.ML.CRB("IOB_RedEnab"))
- {
- isEnabled = DataLayer.sLogEnab(idx);
- }
- // ...oppure dritto su DB
- else
- {
- isEnabled = MapoDb.MapoDb.obj.sLogEnabled(idx);
- }
- // salvo risposta!
- answ = isEnabled ? "OK" : "NO";
+ answ = DataLayer.sLogEnab(idx) ? "OK" : "NO";
}
catch (Exception exc)
{
diff --git a/MapoDb/DataLayer.cs b/MapoDb/DataLayer.cs
index be83bc4d..7f0bb083 100644
--- a/MapoDb/DataLayer.cs
+++ b/MapoDb/DataLayer.cs
@@ -555,7 +555,7 @@ namespace MapoDb
///
///
///
- public static Dictionary mDatiMacchine(int idxMacchina)
+ public static Dictionary mDatiMacchine(int idxMacchina)
{
// hard coded dimensione vettore DatiMacchine
Dictionary answ = new Dictionary();
@@ -605,7 +605,7 @@ namespace MapoDb
answ.Add("MatrOpr", rigaMSFD.MatrOpr.ToString());
answ.Add("lastVal", rigaMSFD.lastVal);
answ.Add("TCBase", rigaMSFD.TempoCicloBase.ToString());
-
+
//...e SETUP
answ.Add("CodMacc", rigaMSFD.codmacchina);
answ.Add("IdxFamIn", rigaMSFD.IdxFamigliaIngresso.ToString());
@@ -728,12 +728,20 @@ namespace MapoDb
public static bool insEnab(int idxMacchina)
{
bool answ = false;
- try
+ if (memLayer.ML.CRB("IOB_RedEnab"))
{
- answ = Convert.ToBoolean(mDatiMacchinaVal(idxMacchina, "insEnabled"));
+ try
+ {
+ answ = Convert.ToBoolean(mDatiMacchinaVal(idxMacchina, "insEnabled"));
+ }
+ catch
+ { }
+ }
+ // ...oppure dritto su DB
+ else
+ {
+ answ = MapoDb.obj.insEnabled(idxMacchina);
}
- catch
- { }
return answ;
}
///
@@ -744,12 +752,20 @@ namespace MapoDb
public static bool sLogEnab(int idxMacchina)
{
bool answ = false;
- try
+ if (memLayer.ML.CRB("IOB_RedEnab"))
{
- answ = Convert.ToBoolean(mDatiMacchinaVal(idxMacchina, "sLogEnabled"));
+ try
+ {
+ answ = Convert.ToBoolean(mDatiMacchinaVal(idxMacchina, "sLogEnabled"));
+ }
+ catch
+ { }
+ }
+ // ...oppure dritto su DB
+ else
+ {
+ answ = MapoDb.obj.sLogEnabled(idxMacchina);
}
- catch
- { }
return answ;
}