Permissions & Authorization for Users #24

Initial Release; Includes Database and MVC refactoring
This commit is contained in:
Gary Sharp
2013-10-10 19:13:16 +11:00
parent 172ce5524a
commit a099d68915
458 changed files with 40221 additions and 12130 deletions
@@ -11,10 +11,10 @@ namespace Disco.Web.Areas.Config.Models.DeviceBatch
{
public List<ConfigDeviceBatchIndexModelItem> DeviceBatches { get; set; }
public static IndexModel Build(DiscoDataContext dbContext)
public static IndexModel Build(DiscoDataContext Database)
{
var m = new IndexModel();
m.DeviceBatches = dbContext.DeviceBatches.OrderBy(db => db.Name).Select(db => new _IndexModelItem()
m.DeviceBatches = Database.DeviceBatches.OrderBy(db => db.Name).Select(db => new _IndexModelItem()
{
Id = db.Id,
Name = db.Name,
@@ -28,6 +28,9 @@ namespace Disco.Web.Areas.Config.Models.DeviceBatch
InsuredUntil = db.InsuredUntil
}).ToArray().Cast<ConfigDeviceBatchIndexModelItem>().ToList();
foreach (var item in m.DeviceBatches.Where(db => db.DefaultDeviceModel == null))
item.DefaultDeviceModel = "<None Specified>";
return m;
}
@@ -10,6 +10,7 @@ namespace Disco.Web.Areas.Config.Models.DeviceBatch
public class ShowModel : ConfigDeviceBatchShowModel
{
public Disco.Models.Repository.DeviceBatch DeviceBatch { get; set; }
public Disco.Models.Repository.DeviceModel DefaultDeviceModel { get; set; }
public List<Disco.Models.Repository.DeviceModel> DeviceModels { get; set; }
public List<ConfigDeviceBatchShowModelMembership> DeviceModelMembers { get; set; }
public int DeviceCount { get; set; }