Minor update x tentativo ottimizzazione input (da rivedere)
This commit is contained in:
@@ -1043,9 +1043,6 @@ namespace MP.IOC.Data
|
||||
};
|
||||
// salva e processa
|
||||
answ = await scriviRigaEventoAsync(newRecEv);
|
||||
//currTask = scriviRigaEvento(idxMacchina, idxTipoEv, codArticolo, valEsteso, 0, "-", dtEve, DateTime.Now);
|
||||
// forzo RESET dati macchina...
|
||||
await ResetDatiMacchinaAsync(idxMacchina);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -3036,12 +3033,24 @@ namespace MP.IOC.Data
|
||||
}
|
||||
}
|
||||
// inizio processing vero e proprio INPUT...
|
||||
if (idxMacchina != null && valore != null)
|
||||
if (string.IsNullOrEmpty(idxMacchina))
|
||||
{
|
||||
if (idxMacchina != "" && valore != "")
|
||||
string errore = "Errore: missing IdxMacchina";
|
||||
Log.Warn(errore);
|
||||
answ = errore;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrEmpty(valore))
|
||||
{
|
||||
string errore = "Errore: missing valore";
|
||||
Log.Warn(errore);
|
||||
answ = errore;
|
||||
}
|
||||
else
|
||||
{
|
||||
// se abilitato registro evento sul DB
|
||||
if (!string.IsNullOrEmpty(idxMacchina) && await IobSLogEnabAsync(idxMacchina))
|
||||
if (await IobSLogEnabAsync(idxMacchina))
|
||||
{
|
||||
int cntVal = 0;
|
||||
int.TryParse(contatore, out cntVal);
|
||||
@@ -3075,6 +3084,8 @@ namespace MP.IOC.Data
|
||||
// gestisce i casi DB/REDIS secondo necessità
|
||||
await CheckMicroStatoAsync(idxMacchina, valore, dataOraEvento, contatore, datiMacc);
|
||||
}
|
||||
// forzo RESET dati macchina...
|
||||
await ResetDatiMacchinaAsync(idxMacchina);
|
||||
// registro in risposta che è andato tutto bene...
|
||||
answ = "OK";
|
||||
}
|
||||
@@ -3085,18 +3096,6 @@ namespace MP.IOC.Data
|
||||
answ = errore;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string errore = "Errore: parametri macchina/valore vuoti";
|
||||
Log.Warn(errore);
|
||||
answ = errore;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string errore = "Errore: mancano parametri macchina/valore";
|
||||
Log.Warn(errore);
|
||||
answ = errore;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
|
||||
Reference in New Issue
Block a user