- FIX errore ri-scrittura parametri (ex Giacovelli)
This commit is contained in:
Samuele Locatelli
2022-07-14 11:23:05 +02:00
parent 7b893a067b
commit 6cea80a232
+15 -5
View File
@@ -3622,7 +3622,7 @@ namespace MapoDb
gestEmail.geAuth.mandaEmail(mittente, destinatario, oggetto, corpo);
fatto = true;
}
catch(Exception exc)
catch (Exception exc)
{
logger.lg.scriviLog($"Eccezione in sendEmail{Environment.NewLine}{exc}", tipoLog.ERROR);
}
@@ -3679,13 +3679,23 @@ namespace MapoDb
foreach (var item in currValues)
{
// se fosse un valore WRITE e mi ha dato un valore vuoto --> mando un fix x riscrittura
if (item.writable && string.IsNullOrEmpty(item.value))
if (item.writable && (string.IsNullOrEmpty(item.value) || string.IsNullOrEmpty(item.reqValue)))
{
logger.lg.scriviLog($"setCurrObjItems | parametro empty | {item.uid} | reqVal: {item.reqValue}");
taskType currTask = (taskType)Enum.Parse(typeof(taskType), item.uid);
addCheckTask4Machine(idxMacchina, currTask, item.value);
logger.lg.scriviLog($"setCurrObjItems | parametro empty | {item.uid} | Value: {item.value} | reqVal: {item.reqValue}");
// se è un parametro dei "task principali...
try
{
taskType currTask = (taskType)Enum.Parse(typeof(taskType), item.uid);
string newVal = !string.IsNullOrEmpty(item.reqValue) ? item.reqValue : $"{item.value}";
addCheckTask4Machine(idxMacchina, currTask, newVal);
}
catch (Exception exc)
{
logger.lg.scriviLog($"Eccezione in setCurrObjItems in fase di riaccodamento{Environment.NewLine}{exc}");
}
}
}
answ = true;
}
return answ;
}