Feature: Device Importing - Initial

This commit is contained in:
Gary Sharp
2013-07-22 21:16:31 +10:00
parent ab3ad25944
commit a3aaed1d13
25 changed files with 748 additions and 20 deletions
+15 -2
View File
@@ -64,7 +64,7 @@ namespace Disco.Web.Controllers
if (!string.IsNullOrEmpty(m.Device.SerialNumber) && dbContext.Devices.Count(d => d.SerialNumber == m.Device.SerialNumber) > 0)
ModelState.AddModelError("Device.SerialNumber", "A Device what this Serial Number already exists");
}
if (ModelState.IsValid)
{
@@ -76,6 +76,19 @@ namespace Disco.Web.Controllers
}
#endregion
#region Import
[HttpGet]
public virtual ActionResult Import()
{
Models.Device.ImportModel m = new Models.Device.ImportModel();
// UI Extensions
UIExtensions.ExecuteExtensions<DeviceImportModel>(this.ControllerContext, m);
return View();
}
#endregion
#region Show
public virtual ActionResult Show(string id)
{
@@ -118,7 +131,7 @@ namespace Disco.Web.Controllers
HideClosedJobs = true,
EnablePaging = false
};
m.Jobs.Fill(dbContext, BI.JobBI.Searching.BuildJobTableModel(dbContext).Where(j => j.DeviceSerialNumber == m.Device.SerialNumber).OrderByDescending(j => j.Id));
m.Jobs.Fill(dbContext, BI.JobBI.Searching.BuildJobTableModel(dbContext).Where(j => j.DeviceSerialNumber == m.Device.SerialNumber).OrderByDescending(j => j.Id));
m.Certificates = dbContext.DeviceCertificates.Where(c => c.DeviceSerialNumber == m.Device.SerialNumber).ToList();