Make ViewModel bool parameters nullable
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user