diff --git a/GPW_Admin/BaseUserControl.cs b/GPW_Admin/BaseUserControl.cs index 76e2732..9a01361 100644 --- a/GPW_Admin/BaseUserControl.cs +++ b/GPW_Admin/BaseUserControl.cs @@ -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; }