Add "show only completed" to query
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user