Feature: Quick Search

Device/Job/User Search refactoring. Quick-Search implemented.
This commit is contained in:
Gary Sharp
2014-02-06 16:11:45 +11:00
parent 9ea0273936
commit cd31ba4a6c
53 changed files with 1045 additions and 470 deletions
@@ -1,5 +1,5 @@
using Disco.Models.BI.Search;
using Disco.Models.Services.Jobs.JobLists;
using Disco.Models.Services.Jobs.JobLists;
using Disco.Models.Services.Searching;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -12,20 +12,20 @@ namespace Disco.Web.Areas.API.Models.DocumentTemplate
public string value { get; set; }
public string label { get; set; }
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(Disco.Models.BI.Search.DeviceSearchResultItem item)
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(DeviceSearchResultItem item)
{
return new ImporterUndetectedDataIdLookupModel
{
value = item.SerialNumber,
label = string.Format("{0} - {1} - {2}", item.SerialNumber, item.ComputerName, item.DeviceModelDescription)
value = item.Id,
label = string.Format("{0} - {1} - {2}", item.Id, item.ComputerName, item.DeviceModelDescription)
};
}
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(JobTableItemModel item)
{
return new ImporterUndetectedDataIdLookupModel
{
value = item.Id.ToString(),
label = string.Format("{0} ({1}; {2})", item.Id, item.DeviceSerialNumber, item.UserDisplayName)
value = item.JobId.ToString(),
label = string.Format("{0} ({1}; {2})", item.JobId, item.DeviceSerialNumber, item.UserDisplayName)
};
}
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(UserSearchResultItem item)