Switch to using string instead of bool for checkbox values
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace LeafWeb.WebCms.Models
|
||||
{
|
||||
@@ -57,10 +58,17 @@ namespace LeafWeb.WebCms.Models
|
||||
public string phips2 { get; set; }
|
||||
|
||||
[Display(Name = "Show Only Successfully Completed")]
|
||||
public bool? compl { get; set; }
|
||||
[UIHint("Checkbox")]
|
||||
public string compl { get; set; }
|
||||
|
||||
public bool ShowOnlySuccessfullyCompleted => !string.IsNullOrEmpty(compl);
|
||||
|
||||
[Display(Name = "Only my data")]
|
||||
public bool? usr { get; set; }
|
||||
[UIHint("Checkbox")]
|
||||
public string usr { get; set; }
|
||||
|
||||
public bool OnlyUserData => !string.IsNullOrEmpty(usr);
|
||||
|
||||
|
||||
public bool HasExtendedParameters =>
|
||||
!(
|
||||
@@ -74,12 +82,12 @@ namespace LeafWeb.WebCms.Models
|
||||
&& string.IsNullOrEmpty(pari)
|
||||
&& string.IsNullOrEmpty(tleaf)
|
||||
&& string.IsNullOrEmpty(phips2)
|
||||
&& !(compl.HasValue && compl.Value)
|
||||
&& string.IsNullOrEmpty(compl)
|
||||
);
|
||||
|
||||
public bool HasParameters =>
|
||||
HasExtendedParameters
|
||||
|| !string.IsNullOrEmpty(q)
|
||||
|| usr.HasValue && usr.Value;
|
||||
|| !string.IsNullOrEmpty(usr);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user