Update: Device Count Details

More information about device membership in Batches, Profiles and
Models.
This commit is contained in:
Gary Sharp
2013-07-25 17:47:40 +10:00
parent ad6b1b19b6
commit 19503366c4
27 changed files with 883 additions and 482 deletions
@@ -11,6 +11,7 @@ namespace Disco.Web.Areas.Config.Models.DeviceBatch
{
public Disco.Models.Repository.DeviceBatch DeviceBatch { get; set; }
public List<Disco.Models.Repository.DeviceModel> DeviceModels { get; set; }
public List<ConfigDeviceBatchShowModelMembership> DeviceModelMembers { get; set; }
public int DeviceCount { get; set; }
public int DeviceDecommissionedCount { get; set; }
public bool CanDelete { get; set; }
@@ -0,0 +1,15 @@
using Disco.Models.UI.Config.DeviceBatch;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.Config.Models.DeviceBatch
{
public class _ShowModelMembership : ConfigDeviceBatchShowModelMembership
{
public Disco.Models.Repository.DeviceModel DeviceModel { get; set; }
public int DeviceCount { get; set; }
public int DeviceDecommissionedCount { get; set; }
}
}
@@ -21,7 +21,8 @@ namespace Disco.Web.Areas.Config.Models.DeviceModel
Manufacturer = dm.Manufacturer,
Model = dm.Model,
ModelType = dm.ModelType,
DeviceCount = dm.Devices.Count
DeviceCount = dm.Devices.Count,
DeviceDecommissionedCount = dm.Devices.Count(d => d.DecommissionedDate.HasValue)
}).ToArray().Cast<ConfigDeviceModelIndexModelItem>().ToList();
return m;
@@ -15,6 +15,9 @@ namespace Disco.Web.Areas.Config.Models.DeviceModel
public List<PluginFeatureManifest> WarrantyProviders { get; set; }
public int DeviceCount { get; set; }
public int DeviceDecommissionedCount { get; set; }
public bool CanDelete { get; set; }
}
}
@@ -15,6 +15,7 @@ namespace Disco.Web.Areas.Config.Models.DeviceModel
public string Model { get; set; }
public string ModelType { get; set; }
public int DeviceCount { get; set; }
public int DeviceDecommissionedCount { get; set; }
public override string ToString()
{
@@ -16,6 +16,9 @@ namespace Disco.Web.Areas.Config.Models.DeviceProfile
public List<PluginFeatureManifest> CertificateProviders { get; set; }
public int DeviceCount { get; set; }
public int DeviceDecommissionedCount { get; set; }
public bool CanDelete { get; set; }
}
}