Fix calcolo true/false ore lav OK
This commit is contained in:
@@ -208,7 +208,17 @@ namespace GPW_Admin
|
||||
public bool toBool(object valore)
|
||||
{
|
||||
bool answ = false;
|
||||
bool.TryParse($"{valore}", out answ);
|
||||
string strVal = $"{valore}";
|
||||
// se è lungh 1 (0/1) converto 0=false, 1 = true...
|
||||
if (strVal.Length == 1)
|
||||
{
|
||||
answ = strVal == "1" ? true : false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// se è un valore testuale --> converisone boolean
|
||||
bool.TryParse($"{valore}", out answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user