Files
Disco/Disco.Web/Areas/API/Models/DocumentTemplate/ImporterUndetectedDataIdLookupModel.cs
T
Gary Sharp 3f63281dc4 Feature: Job Queues
Also UI style, theme and element changes
2014-02-03 14:50:08 +11:00

41 lines
1.4 KiB
C#

using Disco.Models.BI.Search;
using Disco.Models.Services.Jobs.JobLists;
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(Disco.Models.BI.Search.DeviceSearchResultItem item)
{
return new ImporterUndetectedDataIdLookupModel
{
value = item.SerialNumber,
label = string.Format("{0} - {1} - {2}", item.SerialNumber, 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)
};
}
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(UserSearchResultItem item)
{
return new ImporterUndetectedDataIdLookupModel
{
value = item.Id,
label = string.Format("{0} - {1}", item.Id, item.DisplayName)
};
}
}
}