modifica IOB x gestione migliore errori in scrittura DB (si spera...)
This commit is contained in:
@@ -30,13 +30,21 @@ namespace MP_IO.Controllers
|
||||
{
|
||||
int idx = 0;
|
||||
Int32.TryParse(id.ToString(), out idx);
|
||||
// verifico se sia abilitato INSERT x una data macchina
|
||||
if (MapoDb.MapoDb.obj.insEnabled(idx))
|
||||
try
|
||||
{
|
||||
answ = "OK";
|
||||
// verifico se sia abilitato INSERT x una data macchina
|
||||
if (MapoDb.MapoDb.obj.insEnabled(idx))
|
||||
{
|
||||
answ = "OK";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "NO";
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in enabled{0}{1}", Environment.NewLine, exc));
|
||||
answ = "NO";
|
||||
}
|
||||
}
|
||||
@@ -55,13 +63,21 @@ namespace MP_IO.Controllers
|
||||
{
|
||||
int idx = 0;
|
||||
Int32.TryParse(id.ToString(), out idx);
|
||||
// verifico se sia abilitato SignalLog x una data macchina
|
||||
if (MapoDb.MapoDb.obj.sLogEnabled(idx))
|
||||
try
|
||||
{
|
||||
answ = "OK";
|
||||
// verifico se sia abilitato SignalLog x una data macchina
|
||||
if (MapoDb.MapoDb.obj.sLogEnabled(idx))
|
||||
{
|
||||
answ = "OK";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "NO";
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in sLog{0}{1}", Environment.NewLine, exc));
|
||||
answ = "NO";
|
||||
}
|
||||
}
|
||||
@@ -78,7 +94,15 @@ namespace MP_IO.Controllers
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Valori letti:{0}idxMacchina: {1}{0}valore: {2}{0}dtEve: {3}{0}dtCurr: {4}{0}cnt: {5}", Environment.NewLine, id, valore, dtEve, dtCurr, cnt), tipoLog.INFO);
|
||||
}
|
||||
answ = DataLayer.processInput(id, valore, dtEve, dtCurr, cnt);
|
||||
try
|
||||
{
|
||||
answ = DataLayer.processInput(id, valore, dtEve, dtCurr, cnt);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in input{0}{1}", Environment.NewLine, exc));
|
||||
answ = "NO";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user