Files
Disco/Disco.Web/Areas/API/Models/DocumentTemplate/ImporterUndetectedDataIdLookupModel.cs
T
Gary Sharp cd31ba4a6c Feature: Quick Search
Device/Job/User Search refactoring. Quick-Search implemented.
2014-02-06 16:11:45 +11:00

41 lines
1.4 KiB
C#

using Disco.Models.Services.Jobs.JobLists;
using Disco.Models.Services.Searching;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.API.Models.DocumentTemplate
{
public class ImporterUndetectedDataIdLookupModel
{
public string value { get; set; }
public string label { get; set; }
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(DeviceSearchResultItem item)
{
return new ImporterUndetectedDataIdLookupModel
{
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.JobId.ToString(),
label = string.Format("{0} ({1}; {2})", item.JobId, item.DeviceSerialNumber, item.UserDisplayName)
};
}
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(UserSearchResultItem item)
{
return new ImporterUndetectedDataIdLookupModel
{
value = item.Id,
label = string.Format("{0} - {1}", item.Id, item.DisplayName)
};
}
}
}