Move query to utility class
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Caching;
|
||||
@@ -10,6 +9,7 @@ using LeafWeb.Core.Utility;
|
||||
using LeafWeb.WebCms.Models;
|
||||
using LeafWeb.WebCms.Services;
|
||||
using LeafWeb.WebCms.Services.PiscalQueue;
|
||||
using LeafWeb.WebCms.Utility;
|
||||
using Umbraco.Web.Mvc;
|
||||
|
||||
namespace LeafWeb.WebCms.Controllers
|
||||
@@ -21,26 +21,12 @@ namespace LeafWeb.WebCms.Controllers
|
||||
|
||||
public ActionResult Index(LeafDataQuery query)
|
||||
{
|
||||
//query.lat = 32;
|
||||
|
||||
var resultItems =
|
||||
DataService.GetLeafInputsOrdered();
|
||||
|
||||
// search functionality
|
||||
if (!string.IsNullOrEmpty(query.q))
|
||||
{
|
||||
foreach (var piece in query.q.Split(' ').Select(p => p.Trim()))
|
||||
{
|
||||
resultItems =
|
||||
from li in resultItems
|
||||
where li.Name.Contains(piece)
|
||||
|| li.Identifier.Contains(piece)
|
||||
|| li.SiteId.Contains(piece)
|
||||
select li;
|
||||
}
|
||||
}
|
||||
resultItems = QueryFilter.Search(resultItems, query);
|
||||
|
||||
var timeInProgressEstimater = TimeInProgressEstimater();
|
||||
var timeInProgressEstimater = TimeInProgressEstimater();
|
||||
|
||||
var serviceDescription = ServiceDescription();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user