Update: Additional UI Extension Hooks

This commit is contained in:
Gary Sharp
2013-04-30 12:35:27 +10:00
parent 849736d42e
commit b17ed91fb0
84 changed files with 810 additions and 137 deletions
@@ -1,11 +1,12 @@
using System;
using Disco.Models.UI.Config.DeviceModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.Config.Models.DeviceModel
{
public class DeviceComponentsModel
public class ComponentsModel : ConfigDeviceModelComponentsModel
{
public int? DeviceModelId { get; set; }
public List<Disco.Models.Repository.DeviceComponent> DeviceComponents { get; set; }
@@ -3,17 +3,18 @@ using System.Collections.Generic;
using System.Linq;
using System.Web;
using Disco.Data.Repository;
using Disco.Models.UI.Config.DeviceModel;
namespace Disco.Web.Areas.Config.Models.DeviceModel
{
public class IndexModel
public class IndexModel : ConfigDeviceModelIndexModel
{
public List<_IndexModelDeviceModel> DeviceModels { get; set; }
public List<ConfigDeviceModelIndexModelItem> DeviceModels { get; set; }
public static IndexModel Build(DiscoDataContext dbContext)
{
var m = new IndexModel();
m.DeviceModels = dbContext.DeviceModels.OrderBy(dm => dm.Description).Select(dm => new _IndexModelDeviceModel()
m.DeviceModels = dbContext.DeviceModels.OrderBy(dm => dm.Description).Select(dm => new _IndexModelItem()
{
Id = dm.Id,
Name = dm.Description,
@@ -21,10 +22,9 @@ namespace Disco.Web.Areas.Config.Models.DeviceModel
Model = dm.Model,
ModelType = dm.ModelType,
DeviceCount = dm.Devices.Count
}).ToList();
}).Cast<ConfigDeviceModelIndexModelItem>().ToList();
return m;
}
}
}
@@ -3,15 +3,16 @@ using System.Collections.Generic;
using System.Linq;
using System.Web;
using Disco.Services.Plugins;
using Disco.Models.UI.Config.DeviceModel;
namespace Disco.Web.Areas.Config.Models.DeviceModel
{
public class ShowModel
public class ShowModel : ConfigDeviceModelShowModel
{
public Disco.Models.Repository.DeviceModel DeviceModel { get; set; }
public Models.DeviceModel.DeviceComponentsModel DeviceComponentsModel { get; set; }
public ConfigDeviceModelComponentsModel DeviceComponentsModel { get; set; }
public List<PluginFeatureManifest> WarrantyProviders { get; set; }
public bool CanDelete { get; set; }
@@ -3,10 +3,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using Disco.Models.UI.Config.DeviceModel;
namespace Disco.Web.Areas.Config.Models.DeviceModel
{
public class _IndexModelDeviceModel
public class _IndexModelItem : ConfigDeviceModelIndexModelItem
{
public int Id { get; set; }
public string Name { get; set; }