Add "show only completed" to query

This commit is contained in:
2020-07-11 21:07:43 -04:00
parent 1760870219
commit f1691f3d53
4 changed files with 48 additions and 27 deletions
+10 -7
View File
@@ -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;
+9
View File
@@ -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;
}
}