GIT: perform LF normalization

This commit is contained in:
Gary Sharp
2013-02-28 17:15:46 +11:00
parent 989f08a24d
commit 7d9be5620d
729 changed files with 300734 additions and 300712 deletions
@@ -1,87 +1,87 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using Disco.Data.Repository;
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
{
[CustomValidation(typeof(CreateModelValidation), "ValidateCreateModel")]
public class CreateModel
{
public Disco.Models.Repository.DocumentTemplate DocumentTemplate { get; set; }
[Required]
public HttpPostedFileBase Template { get; set; }
public List<string> Types { get; set; }
public List<string> SubTypes { get; set; }
public List<Disco.Models.Repository.JobType> JobTypes { get; set; }
public List<Disco.Models.Repository.JobSubType> JobSubTypes { get; set; }
public List<string> Scopes
{
get
{
return Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.ToList();
}
}
public List<Disco.Models.Repository.JobType> GetJobTypes
{
get
{
if (Types != null)
{
var types = this.Types;
return this.JobTypes.Where(m => types.Contains(m.Id)).ToList();
}
return null;
}
}
public List<Disco.Models.Repository.JobSubType> GetJobSubTypes
{
get
{
if (SubTypes != null)
{
var subTypes = this.SubTypes;
return this.JobSubTypes.Where(m => subTypes.Contains(String.Format("{0}_{1}", m.JobTypeId, m.Id))).ToList();
}
return null;
}
}
public void UpdateModel(DiscoDataContext dbContext)
{
if (this.JobTypes == null)
JobTypes = dbContext.JobTypes.ToList();
if (this.JobSubTypes == null)
JobSubTypes = dbContext.JobSubTypes.ToList();
}
}
public class CreateModelValidation
{
public static ValidationResult ValidateCreateModel(CreateModel model)
{
if (model.DocumentTemplate != null && model.DocumentTemplate.Scope == Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Job)
{
if (model.Types != null && model.SubTypes != null)
{
var typeId = string.Format("{0}_", model.Types);
model.SubTypes = model.SubTypes.Where(m => model.Types.Contains(m.Substring(0, m.IndexOf("_")))).ToList();
}
}
return ValidationResult.Success;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using Disco.Data.Repository;
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
{
[CustomValidation(typeof(CreateModelValidation), "ValidateCreateModel")]
public class CreateModel
{
public Disco.Models.Repository.DocumentTemplate DocumentTemplate { get; set; }
[Required]
public HttpPostedFileBase Template { get; set; }
public List<string> Types { get; set; }
public List<string> SubTypes { get; set; }
public List<Disco.Models.Repository.JobType> JobTypes { get; set; }
public List<Disco.Models.Repository.JobSubType> JobSubTypes { get; set; }
public List<string> Scopes
{
get
{
return Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.ToList();
}
}
public List<Disco.Models.Repository.JobType> GetJobTypes
{
get
{
if (Types != null)
{
var types = this.Types;
return this.JobTypes.Where(m => types.Contains(m.Id)).ToList();
}
return null;
}
}
public List<Disco.Models.Repository.JobSubType> GetJobSubTypes
{
get
{
if (SubTypes != null)
{
var subTypes = this.SubTypes;
return this.JobSubTypes.Where(m => subTypes.Contains(String.Format("{0}_{1}", m.JobTypeId, m.Id))).ToList();
}
return null;
}
}
public void UpdateModel(DiscoDataContext dbContext)
{
if (this.JobTypes == null)
JobTypes = dbContext.JobTypes.ToList();
if (this.JobSubTypes == null)
JobSubTypes = dbContext.JobSubTypes.ToList();
}
}
public class CreateModelValidation
{
public static ValidationResult ValidateCreateModel(CreateModel model)
{
if (model.DocumentTemplate != null && model.DocumentTemplate.Scope == Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Job)
{
if (model.Types != null && model.SubTypes != null)
{
var typeId = string.Format("{0}_", model.Types);
model.SubTypes = model.SubTypes.Where(m => model.Types.Contains(m.Substring(0, m.IndexOf("_")))).ToList();
}
}
return ValidationResult.Success;
}
}
}
@@ -1,21 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
{
public class ExpressionBrowserModel
{
public string DeviceType { get; set; }
public string UserType { get; set; }
public string JobType { get; set; }
//public string DataExtType { get; set; }
//public string DeviceExtType { get; set; }
//public string UserExtType { get; set; }
public Dictionary<string, string> Variables { get; set; }
public Dictionary<string, string> ExtensionLibraries { get; set; }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
{
public class ExpressionBrowserModel
{
public string DeviceType { get; set; }
public string UserType { get; set; }
public string JobType { get; set; }
//public string DataExtType { get; set; }
//public string DeviceExtType { get; set; }
//public string UserExtType { get; set; }
public Dictionary<string, string> Variables { get; set; }
public Dictionary<string, string> ExtensionLibraries { get; set; }
}
}
@@ -1,12 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
{
public class IndexModel
{
public List<Disco.Models.Repository.DocumentTemplate> DocumentTemplates { get; set; }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
{
public class IndexModel
{
public List<Disco.Models.Repository.DocumentTemplate> DocumentTemplates { get; set; }
}
}
@@ -1,74 +1,74 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Disco.Data.Repository;
using Disco.Models.Repository;
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
{
public class ShowModel
{
public Disco.Models.Repository.DocumentTemplate DocumentTemplate { get; set; }
public int StoredInstanceCount { get; set; }
public List<Disco.BI.Expressions.Expression> TemplateExpressions { get; set; }
public List<string> Types { get; set; }
public List<string> SubTypes { get; set; }
public List<Disco.Models.Repository.JobType> JobTypes { get; set; }
public List<Disco.Models.Repository.JobSubType> JobSubTypes { get; set; }
public ShowModel()
{
this.Types = new List<string>();
this.SubTypes = new List<string>();
}
public List<string> Scopes
{
get
{
return Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.ToList();
}
}
public void UpdateModel(DiscoDataContext dbContext)
{
switch (this.DocumentTemplate.Scope)
{
case Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Device:
this.StoredInstanceCount = dbContext.DeviceAttachments.Count(a => a.DocumentTemplateId == this.DocumentTemplate.Id);
break;
case Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Job:
this.StoredInstanceCount = dbContext.JobAttachments.Count(a => a.DocumentTemplateId == this.DocumentTemplate.Id);
break;
case Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.User:
this.StoredInstanceCount = dbContext.UserAttachments.Count(a => a.DocumentTemplateId == this.DocumentTemplate.Id);
break;
}
if (this.JobTypes == null)
JobTypes = dbContext.JobTypes.ToList();
if (this.JobSubTypes == null)
JobSubTypes = dbContext.JobSubTypes.ToList();
if (DocumentTemplate != null)
{
if (DocumentTemplate.JobSubTypes != null)
{
foreach (var jst in DocumentTemplate.JobSubTypes)
{
if (!Types.Contains(jst.JobTypeId))
Types.Add(jst.JobTypeId);
SubTypes.Add(string.Format("{0}_{1}", jst.JobTypeId, jst.Id));
}
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Disco.Data.Repository;
using Disco.Models.Repository;
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
{
public class ShowModel
{
public Disco.Models.Repository.DocumentTemplate DocumentTemplate { get; set; }
public int StoredInstanceCount { get; set; }
public List<Disco.BI.Expressions.Expression> TemplateExpressions { get; set; }
public List<string> Types { get; set; }
public List<string> SubTypes { get; set; }
public List<Disco.Models.Repository.JobType> JobTypes { get; set; }
public List<Disco.Models.Repository.JobSubType> JobSubTypes { get; set; }
public ShowModel()
{
this.Types = new List<string>();
this.SubTypes = new List<string>();
}
public List<string> Scopes
{
get
{
return Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.ToList();
}
}
public void UpdateModel(DiscoDataContext dbContext)
{
switch (this.DocumentTemplate.Scope)
{
case Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Device:
this.StoredInstanceCount = dbContext.DeviceAttachments.Count(a => a.DocumentTemplateId == this.DocumentTemplate.Id);
break;
case Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Job:
this.StoredInstanceCount = dbContext.JobAttachments.Count(a => a.DocumentTemplateId == this.DocumentTemplate.Id);
break;
case Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.User:
this.StoredInstanceCount = dbContext.UserAttachments.Count(a => a.DocumentTemplateId == this.DocumentTemplate.Id);
break;
}
if (this.JobTypes == null)
JobTypes = dbContext.JobTypes.ToList();
if (this.JobSubTypes == null)
JobSubTypes = dbContext.JobSubTypes.ToList();
if (DocumentTemplate != null)
{
if (DocumentTemplate.JobSubTypes != null)
{
foreach (var jst in DocumentTemplate.JobSubTypes)
{
if (!Types.Contains(jst.JobTypeId))
Types.Add(jst.JobTypeId);
SubTypes.Add(string.Format("{0}_{1}", jst.JobTypeId, jst.Id));
}
}
}
}
}
}
@@ -1,30 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Disco.BI;
using Disco.BI.Extensions;
using Disco.Web.Extensions;
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
{
public class UndetectedPagesModel
{
public List<Disco.Models.Repository.DocumentTemplate> DocumentTemplates { get; set; }
public List<SelectListItem> DocumentTemplatesSelectListItems
{
get
{
var list = new List<SelectListItem>();
list.Add(new SelectListItem() { Selected = false, Value = "--DEVICE", Text = "<Generic Device Document>" });
list.Add(new SelectListItem() { Selected = true, Value = "--JOB", Text = "<Generic Job Document>" });
list.Add(new SelectListItem() { Selected = false, Value = "--USER", Text = "<Generic User Document>" });
list.AddRange(this.DocumentTemplates.ToSelectListItems());
return list;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Disco.BI;
using Disco.BI.Extensions;
using Disco.Web.Extensions;
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
{
public class UndetectedPagesModel
{
public List<Disco.Models.Repository.DocumentTemplate> DocumentTemplates { get; set; }
public List<SelectListItem> DocumentTemplatesSelectListItems
{
get
{
var list = new List<SelectListItem>();
list.Add(new SelectListItem() { Selected = false, Value = "--DEVICE", Text = "<Generic Device Document>" });
list.Add(new SelectListItem() { Selected = true, Value = "--JOB", Text = "<Generic Job Document>" });
list.Add(new SelectListItem() { Selected = false, Value = "--USER", Text = "<Generic User Document>" });
list.AddRange(this.DocumentTemplates.ToSelectListItems());
return list;
}
}
}
}