Make ViewModel bool parameters nullable

This commit is contained in:
2020-08-03 08:26:28 -04:00
parent 803717d9e5
commit b1bff76159
6 changed files with 22 additions and 9 deletions
+4 -4
View File
@@ -57,10 +57,10 @@ namespace LeafWeb.WebCms.Models
public string phips2 { get; set; }
[Display(Name = "Show Only Successfully Completed")]
public bool compl { get; set; }
public bool? compl { get; set; }
[Display(Name = "Only my data")]
public bool usr { get; set; }
public bool? usr { get; set; }
public bool HasExtendedParameters =>
!(
@@ -74,12 +74,12 @@ namespace LeafWeb.WebCms.Models
&& string.IsNullOrEmpty(pari)
&& string.IsNullOrEmpty(tleaf)
&& string.IsNullOrEmpty(phips2)
&& !compl
&& !(compl.HasValue && compl.Value)
);
public bool HasParameters =>
HasExtendedParameters
|| !string.IsNullOrEmpty(q)
|| usr;
|| usr.HasValue && usr.Value;
}
}