GIT: perform LF normalization
This commit is contained in:
@@ -1,34 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Data.Repository;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceBatch
|
||||
{
|
||||
public class IndexModel
|
||||
{
|
||||
public List<_IndexModelDeviceBatch> DeviceBatches { get; set; }
|
||||
|
||||
public static IndexModel Build(DiscoDataContext dbContext)
|
||||
{
|
||||
var m = new IndexModel();
|
||||
m.DeviceBatches = dbContext.DeviceBatches.OrderBy(db => db.Name).Select(db => new _IndexModelDeviceBatch()
|
||||
{
|
||||
Id = db.Id,
|
||||
Name = db.Name,
|
||||
PurchaseDate = db.PurchaseDate,
|
||||
PurchaseUnitQuantity = db.UnitQuantity,
|
||||
DeviceCount = db.Devices.Count,
|
||||
DeviceDecommissionedCount = db.Devices.Count(d=> d.DecommissionedDate.HasValue),
|
||||
DefaultDeviceModel = db.DefaultDeviceModel.Description,
|
||||
WarrantyExpires = db.WarrantyValidUntil,
|
||||
InsuranceSupplier = db.InsuranceSupplier,
|
||||
InsuredUntil = db.InsuredUntil
|
||||
}).ToList();
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Data.Repository;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceBatch
|
||||
{
|
||||
public class IndexModel
|
||||
{
|
||||
public List<_IndexModelDeviceBatch> DeviceBatches { get; set; }
|
||||
|
||||
public static IndexModel Build(DiscoDataContext dbContext)
|
||||
{
|
||||
var m = new IndexModel();
|
||||
m.DeviceBatches = dbContext.DeviceBatches.OrderBy(db => db.Name).Select(db => new _IndexModelDeviceBatch()
|
||||
{
|
||||
Id = db.Id,
|
||||
Name = db.Name,
|
||||
PurchaseDate = db.PurchaseDate,
|
||||
PurchaseUnitQuantity = db.UnitQuantity,
|
||||
DeviceCount = db.Devices.Count,
|
||||
DeviceDecommissionedCount = db.Devices.Count(d=> d.DecommissionedDate.HasValue),
|
||||
DefaultDeviceModel = db.DefaultDeviceModel.Description,
|
||||
WarrantyExpires = db.WarrantyValidUntil,
|
||||
InsuranceSupplier = db.InsuranceSupplier,
|
||||
InsuredUntil = db.InsuredUntil
|
||||
}).ToList();
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceBatch
|
||||
{
|
||||
public class ShowModel
|
||||
{
|
||||
public Disco.Models.Repository.DeviceBatch DeviceBatch { get; set; }
|
||||
public List<SelectListItem> DeviceModels { get; set; }
|
||||
public int DeviceCount { get; set; }
|
||||
public int DeviceDecommissionedCount { get; set; }
|
||||
public bool CanDelete { get; set; }
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceBatch
|
||||
{
|
||||
public class ShowModel
|
||||
{
|
||||
public Disco.Models.Repository.DeviceBatch DeviceBatch { get; set; }
|
||||
public List<SelectListItem> DeviceModels { get; set; }
|
||||
public int DeviceCount { get; set; }
|
||||
public int DeviceDecommissionedCount { get; set; }
|
||||
public bool CanDelete { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceBatch
|
||||
{
|
||||
public class _IndexModelDeviceBatch
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
[Required(), DisplayFormat(ApplyFormatInEditMode = true, ConvertEmptyStringToNull = true, DataFormatString = "{0:yyyy/MM/dd}", HtmlEncode = false)]
|
||||
public DateTime PurchaseDate { get; set; }
|
||||
public int DeviceCount { get; set; }
|
||||
public int DeviceDecommissionedCount { get; set; }
|
||||
public int? PurchaseUnitQuantity { get; set; }
|
||||
public string DefaultDeviceModel { get; set; }
|
||||
public DateTime? WarrantyExpires { get; set; }
|
||||
public DateTime? InsuredUntil { get; set; }
|
||||
public string InsuranceSupplier { get; set; }
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceBatch
|
||||
{
|
||||
public class _IndexModelDeviceBatch
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
[Required(), DisplayFormat(ApplyFormatInEditMode = true, ConvertEmptyStringToNull = true, DataFormatString = "{0:yyyy/MM/dd}", HtmlEncode = false)]
|
||||
public DateTime PurchaseDate { get; set; }
|
||||
public int DeviceCount { get; set; }
|
||||
public int DeviceDecommissionedCount { get; set; }
|
||||
public int? PurchaseUnitQuantity { get; set; }
|
||||
public string DefaultDeviceModel { get; set; }
|
||||
public DateTime? WarrantyExpires { get; set; }
|
||||
public DateTime? InsuredUntil { get; set; }
|
||||
public string InsuranceSupplier { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user