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
@@ -0,0 +1,13 @@
using Disco.Models.UI.Config.DeviceProfile;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.Config.Models.DeviceProfile
{
public class CreateModel : ConfigDeviceProfileCreateModel
{
public Disco.Models.Repository.DeviceProfile DeviceProfile { get; set; }
}
}
@@ -1,11 +1,12 @@
using System;
using Disco.Models.UI.Config.DeviceProfile;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.Config.Models.DeviceProfile
{
public class DefaultsModel
public class DefaultsModel : ConfigDeviceProfileDefaultsModel
{
public List<Disco.Models.Repository.DeviceProfile> DeviceProfiles { get; set; }
public List<Disco.Models.Repository.DeviceProfile> DeviceProfilesAndNone { get; set; }
@@ -4,17 +4,18 @@ using System.Linq;
using System.Web;
using Disco.Data.Repository;
using Disco.BI.Extensions;
using Disco.Models.UI.Config.DeviceProfile;
namespace Disco.Web.Areas.Config.Models.DeviceProfile
{
public class IndexModel
public class IndexModel : ConfigDeviceProfileIndexModel
{
public List<_IndexModelDeviceProfile> DeviceProfiles { get; set; }
public List<ConfigDeviceProfileIndexModelItem> DeviceProfiles { get; set; }
public static IndexModel Build(DiscoDataContext dbContext)
{
var m = new IndexModel();
m.DeviceProfiles = dbContext.DeviceProfiles.OrderBy(dp => dp.Name).Select(dp => new _IndexModelDeviceProfile()
m.DeviceProfiles = dbContext.DeviceProfiles.OrderBy(dp => dp.Name).Select(dp => new _IndexModelItem()
{
Id = dp.Id,
Name = dp.Name,
@@ -24,7 +25,7 @@ namespace Disco.Web.Areas.Config.Models.DeviceProfile
DistributionTypeId = dp.DistributionTypeDb,
DeviceCount = dp.Devices.Count,
DeviceDecommissionedCount = dp.Devices.Count(d => d.DecommissionedDate.HasValue)
}).ToList();
}).Cast<ConfigDeviceProfileIndexModelItem>().ToList();
if (DiscoApplication.MultiSiteMode)
{
@@ -4,10 +4,11 @@ using System.Linq;
using System.Web;
using System.Web.Mvc;
using Disco.Services.Plugins;
using Disco.Models.UI.Config.DeviceProfile;
namespace Disco.Web.Areas.Config.Models.DeviceProfile
{
public class ShowModel
public class ShowModel : ConfigDeviceProfileShowModel
{
public Disco.Models.Repository.DeviceProfile DeviceProfile { get; set; }
public List<SelectListItem> DeviceProfileDistributionTypes { get; set; }
@@ -4,16 +4,16 @@ using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using Disco.Web.Extensions;
using Disco.Models.UI.Config.DeviceProfile;
namespace Disco.Web.Areas.Config.Models.DeviceProfile
{
public class _IndexModelDeviceProfile
public class _IndexModelItem : ConfigDeviceProfileIndexModelItem
{
public int Id { get; set; }
public string Name { get; set; }
public string ShortName { get; set; }
public int? Address { get; set; }
//public string AddressShortName { get; set; }
public string AddressName { get; set; }
public string Description { get; set; }
public int DistributionTypeId { get; set; }