diff --git a/WebCms/Models/LeafDataQuery.cs b/WebCms/Models/LeafDataQuery.cs index 0099725..712e585 100644 --- a/WebCms/Models/LeafDataQuery.cs +++ b/WebCms/Models/LeafDataQuery.cs @@ -1,6 +1,4 @@ -using System.Collections.Specialized; -using System.ComponentModel.DataAnnotations; -using System.Runtime.CompilerServices; +using System.ComponentModel.DataAnnotations; namespace LeafWeb.WebCms.Models { @@ -58,6 +56,9 @@ namespace LeafWeb.WebCms.Models [RegularExpression(FloatingPointRegex, ErrorMessage = "Must be numeric")] public string phips2 { get; set; } + [Display(Name = "Show Only Successfully Completed")] + public bool completed { get; set; } + public bool HasExtendedParameters => !( string.IsNullOrEmpty(siteid) @@ -70,6 +71,7 @@ namespace LeafWeb.WebCms.Models && string.IsNullOrEmpty(pari) && string.IsNullOrEmpty(tleaf) && string.IsNullOrEmpty(phips2) + && !completed ); } } \ No newline at end of file diff --git a/WebCms/Utility/NameValueCollectionUtil.cs b/WebCms/Utility/NameValueCollectionUtil.cs index b808bd2..9f6505f 100644 --- a/WebCms/Utility/NameValueCollectionUtil.cs +++ b/WebCms/Utility/NameValueCollectionUtil.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Collections.Specialized; +using System.Collections.Specialized; using System.Linq; -using System.Web; using System.Web.Routing; namespace LeafWeb.WebCms.Utility @@ -21,9 +18,15 @@ namespace LeafWeb.WebCms.Utility foreach (var pi in obj.GetType().GetProperties().Where(p => p.CanWrite)) { var value = pi.GetValue(obj, null); - if (value == null) - continue; - nvs.Add(prefix + pi.Name, value.ToString()); + switch (value) + { + case null: + case bool b when b == false: + continue; + default: + nvs.Add(prefix + pi.Name, value.ToString()); + break; + } } return nvs; diff --git a/WebCms/Utility/QueryFilter.cs b/WebCms/Utility/QueryFilter.cs index 74d22e3..45571df 100644 --- a/WebCms/Utility/QueryFilter.cs +++ b/WebCms/Utility/QueryFilter.cs @@ -143,6 +143,15 @@ namespace LeafWeb.WebCms.Utility select li; } + if (query.completed) + { + resultItems = + from li in resultItems + where + li.CurrentStatus == LeafInputStatusType.Complete + select li; + } + return resultItems; } } diff --git a/WebCms/Views/Queue/Index.cshtml b/WebCms/Views/Queue/Index.cshtml index 136c888..d2ad47b 100644 --- a/WebCms/Views/Queue/Index.cshtml +++ b/WebCms/Views/Queue/Index.cshtml @@ -15,7 +15,7 @@ @using (Html.BeginUmbracoForm("Search", "Queue", null, new { @action = "/leaf-data/manage-queue/" })) { -