diff --git a/Disco.Models/Disco.Models.csproj b/Disco.Models/Disco.Models.csproj index 2904bef0..aff8334d 100644 --- a/Disco.Models/Disco.Models.csproj +++ b/Disco.Models/Disco.Models.csproj @@ -189,6 +189,7 @@ + diff --git a/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchShowModel.cs b/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchShowModel.cs index d4b0c6ec..c9b8bb41 100644 --- a/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchShowModel.cs +++ b/Disco.Models/UI/Config/DeviceBatch/ConfigDeviceBatchShowModel.cs @@ -1,18 +1,15 @@ -using System; +using Disco.Models.UI.Config.Shared; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Disco.Models.UI.Config.DeviceBatch { - public interface ConfigDeviceBatchShowModel : BaseUIModel + public interface ConfigDeviceBatchShowModel : BaseUIModel, ConfigSharedDeviceGroupDocumentTemplateBulkGenerate { - Disco.Models.Repository.DeviceBatch DeviceBatch { get; set; } + Repository.DeviceBatch DeviceBatch { get; set; } - Disco.Models.Repository.DeviceModel DefaultDeviceModel { get; set; } + Repository.DeviceModel DefaultDeviceModel { get; set; } - List DeviceModels { get; set; } + List DeviceModels { get; set; } List DeviceModelMembers { get; set; } diff --git a/Disco.Models/UI/Config/DeviceModel/ConfigDeviceModelShowModel.cs b/Disco.Models/UI/Config/DeviceModel/ConfigDeviceModelShowModel.cs index f448fc89..80e1249a 100644 --- a/Disco.Models/UI/Config/DeviceModel/ConfigDeviceModelShowModel.cs +++ b/Disco.Models/UI/Config/DeviceModel/ConfigDeviceModelShowModel.cs @@ -1,12 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Disco.Models.UI.Config.Shared; namespace Disco.Models.UI.Config.DeviceModel { - public interface ConfigDeviceModelShowModel : BaseUIModel + public interface ConfigDeviceModelShowModel : BaseUIModel, ConfigSharedDeviceGroupDocumentTemplateBulkGenerate { Disco.Models.Repository.DeviceModel DeviceModel { get; set; } diff --git a/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileShowModel.cs b/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileShowModel.cs index 7d1a9a0e..5894dc20 100644 --- a/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileShowModel.cs +++ b/Disco.Models/UI/Config/DeviceProfile/ConfigDeviceProfileShowModel.cs @@ -1,9 +1,10 @@ using Disco.Models.BI.Config; +using Disco.Models.UI.Config.Shared; using System.Collections.Generic; namespace Disco.Models.UI.Config.DeviceProfile { - public interface ConfigDeviceProfileShowModel : BaseUIModel + public interface ConfigDeviceProfileShowModel : BaseUIModel, ConfigSharedDeviceGroupDocumentTemplateBulkGenerate { Repository.DeviceProfile DeviceProfile { get; set; } OrganisationAddress DefaultOrganisationAddress { get; set; } diff --git a/Disco.Models/UI/Config/Shared/ConfigSharedDeviceGroupDocumentTemplateBulkGenerate.cs b/Disco.Models/UI/Config/Shared/ConfigSharedDeviceGroupDocumentTemplateBulkGenerate.cs new file mode 100644 index 00000000..71e85cb3 --- /dev/null +++ b/Disco.Models/UI/Config/Shared/ConfigSharedDeviceGroupDocumentTemplateBulkGenerate.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; + +namespace Disco.Models.UI.Config.Shared +{ + public interface ConfigSharedDeviceGroupDocumentTemplateBulkGenerate : BaseUIModel + { + List BulkGenerateDocumentTemplates { get; set; } + int DeviceGroupId { get; } + } +} diff --git a/Disco.Models/UI/Config/Shared/ConfigSharedTaskStatusModel.cs b/Disco.Models/UI/Config/Shared/ConfigSharedTaskStatusModel.cs index afdd226c..e0857d4e 100644 --- a/Disco.Models/UI/Config/Shared/ConfigSharedTaskStatusModel.cs +++ b/Disco.Models/UI/Config/Shared/ConfigSharedTaskStatusModel.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Disco.Models.UI.Config.Shared +namespace Disco.Models.UI.Config.Shared { public interface ConfigSharedTaskStatusModel : BaseUIModel { diff --git a/Disco.Web/Areas/API/Controllers/DocumentTemplateController.cs b/Disco.Web/Areas/API/Controllers/DocumentTemplateController.cs index a0b72761..750ba47c 100644 --- a/Disco.Web/Areas/API/Controllers/DocumentTemplateController.cs +++ b/Disco.Web/Areas/API/Controllers/DocumentTemplateController.cs @@ -666,6 +666,105 @@ public virtual ActionResult ImporterUndetectedDelete(string id) } } + [DiscoAuthorizeAll(Claims.Config.DeviceModel.Show, Claims.Config.DocumentTemplate.BulkGenerate)] + public virtual ActionResult BulkGenerateDeviceModel(string id, int deviceGroupId) + { + var template = Database.DocumentTemplates.FirstOrDefault(t => t.Id == id); + if (template == null) + return HttpNotFound("Document Template not found"); + + var deviceModel = Database.DeviceModels.FirstOrDefault(m => m.Id == deviceGroupId); + if (deviceModel is null) + return HttpNotFound("Device Model not found"); + + List dataIds; + switch (template.AttachmentType) + { + case AttachmentTypes.Device: + dataIds = Database.Devices.Where(d => d.DeviceModelId == deviceModel.Id && d.DecommissionedDate == null).Select(d => d.SerialNumber).ToList(); + break; + case AttachmentTypes.Job: + dataIds = Database.Jobs.Where(j => j.ClosedDate == null && j.Device.DeviceModelId == deviceModel.Id).Select(j => j.Id).AsEnumerable().Select(j => j.ToString()).ToList(); + break; + case AttachmentTypes.User: + dataIds = Database.Users.Where(u => u.DeviceUserAssignments.Any(a => a.UnassignedDate == null && a.Device.DeviceModelId == deviceModel.Id)).Select(u => u.UserId).ToList(); + break; + default: + throw new NotSupportedException("The template type is not supported"); + } + + if (!dataIds.Any()) + return HttpNotFound($"No {template.AttachmentType} targets in scope"); + + return BulkGenerate(template.Id, string.Join(Environment.NewLine, dataIds)); + } + + [DiscoAuthorizeAll(Claims.Config.DeviceProfile.Show, Claims.Config.DocumentTemplate.BulkGenerate)] + public virtual ActionResult BulkGenerateDeviceProfile(string id, int deviceGroupId) + { + var template = Database.DocumentTemplates.FirstOrDefault(t => t.Id == id); + if (template == null) + return HttpNotFound("Document Template not found"); + + var deviceProfile = Database.DeviceProfiles.FirstOrDefault(m => m.Id == deviceGroupId); + if (deviceProfile is null) + return HttpNotFound("Device Profile not found"); + + List dataIds; + switch (template.AttachmentType) + { + case AttachmentTypes.Device: + dataIds = Database.Devices.Where(d => d.DeviceProfileId == deviceProfile.Id && d.DecommissionedDate == null).Select(d => d.SerialNumber).ToList(); + break; + case AttachmentTypes.Job: + dataIds = Database.Jobs.Where(j => j.ClosedDate == null && j.Device.DeviceProfileId == deviceProfile.Id).Select(j => j.Id).AsEnumerable().Select(j => j.ToString()).ToList(); + break; + case AttachmentTypes.User: + dataIds = Database.Users.Where(u => u.DeviceUserAssignments.Any(a => a.UnassignedDate == null && a.Device.DeviceProfileId == deviceProfile.Id)).Select(u => u.UserId).ToList(); + break; + default: + throw new NotSupportedException("The template type is not supported"); + } + + if (!dataIds.Any()) + return HttpNotFound($"No {template.AttachmentType} targets in scope"); + + return BulkGenerate(template.Id, string.Join(Environment.NewLine, dataIds)); + } + + [DiscoAuthorizeAll(Claims.Config.DeviceBatch.Show, Claims.Config.DocumentTemplate.BulkGenerate)] + public virtual ActionResult BulkGenerateDeviceBatch(string id, int deviceGroupId) + { + var template = Database.DocumentTemplates.FirstOrDefault(t => t.Id == id); + if (template == null) + return HttpNotFound("Document Template not found"); + + var deviceBatch = Database.DeviceBatches.FirstOrDefault(m => m.Id == deviceGroupId); + if (deviceBatch is null) + return HttpNotFound("Device Batch not found"); + + List dataIds; + switch (template.AttachmentType) + { + case AttachmentTypes.Device: + dataIds = Database.Devices.Where(d => d.DeviceBatchId == deviceBatch.Id && d.DecommissionedDate == null).Select(d => d.SerialNumber).ToList(); + break; + case AttachmentTypes.Job: + dataIds = Database.Jobs.Where(j => j.ClosedDate == null && j.Device.DeviceBatchId == deviceBatch.Id).Select(j => j.Id).AsEnumerable().Select(j => j.ToString()).ToList(); + break; + case AttachmentTypes.User: + dataIds = Database.Users.Where(u => u.DeviceUserAssignments.Any(a => a.UnassignedDate == null && a.Device.DeviceBatchId == deviceBatch.Id)).Select(u => u.UserId).ToList(); + break; + default: + throw new NotSupportedException("The template type is not supported"); + } + + if (!dataIds.Any()) + return HttpNotFound($"No {template.AttachmentType} targets in scope"); + + return BulkGenerate(template.Id, string.Join(Environment.NewLine, dataIds)); + } + [DiscoAuthorize(Claims.Config.DocumentTemplate.BulkGenerate)] public virtual ActionResult BulkGenerate(string id, string DataIds = null, bool InsertBlankPage = false) { diff --git a/Disco.Web/Areas/Config/Controllers/DeviceBatchController.cs b/Disco.Web/Areas/Config/Controllers/DeviceBatchController.cs index 6e7ebb41..583b5511 100644 --- a/Disco.Web/Areas/Config/Controllers/DeviceBatchController.cs +++ b/Disco.Web/Areas/Config/Controllers/DeviceBatchController.cs @@ -61,6 +61,9 @@ public virtual ActionResult Index(int? id) m.DefaultDeviceModel = m.DeviceBatch.DefaultDeviceModelId.HasValue ? Database.DeviceModels.Find(m.DeviceBatch.DefaultDeviceModelId.Value) : null; } + if (m.DeviceModelMembers.Any(g => g.DeviceCount - g.DeviceDecommissionedCount > 0)) + m.BulkGenerateDocumentTemplates = Database.DocumentTemplates.Where(t => !t.IsHidden).ToList(); + // UI Extensions UIExtensions.ExecuteExtensions(this.ControllerContext, m); diff --git a/Disco.Web/Areas/Config/Controllers/DeviceModelController.cs b/Disco.Web/Areas/Config/Controllers/DeviceModelController.cs index 2edb6219..cc2191e3 100644 --- a/Disco.Web/Areas/Config/Controllers/DeviceModelController.cs +++ b/Disco.Web/Areas/Config/Controllers/DeviceModelController.cs @@ -41,6 +41,9 @@ public virtual ActionResult Index(int? id) m.CanDelete = m.DeviceModel.CanDelete(Database); + if (m.DeviceCount - m.DeviceDecommissionedCount > 0) + m.BulkGenerateDocumentTemplates = Database.DocumentTemplates.Where(t => !t.IsHidden).ToList(); + // UI Extensions UIExtensions.ExecuteExtensions(this.ControllerContext, m); diff --git a/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs b/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs index 81cbc8cc..771bb889 100644 --- a/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs +++ b/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs @@ -63,6 +63,9 @@ public virtual ActionResult Index(int? id) } m.CanDelete = m.DeviceProfile.CanDelete(Database); + if (m.DeviceCount - m.DeviceDecommissionedCount > 0) + m.BulkGenerateDocumentTemplates = Database.DocumentTemplates.Where(t => !t.IsHidden).ToList(); + // UI Extensions UIExtensions.ExecuteExtensions(this.ControllerContext, m); diff --git a/Disco.Web/Areas/Config/Models/DeviceBatch/ShowModel.cs b/Disco.Web/Areas/Config/Models/DeviceBatch/ShowModel.cs index c9d9eb98..9dc1ad04 100644 --- a/Disco.Web/Areas/Config/Models/DeviceBatch/ShowModel.cs +++ b/Disco.Web/Areas/Config/Models/DeviceBatch/ShowModel.cs @@ -1,10 +1,11 @@ using Disco.Models.UI.Config.DeviceBatch; using Disco.Services.Devices.ManagedGroups; +using Disco.Web.Areas.Config.Models.Shared; using System.Collections.Generic; namespace Disco.Web.Areas.Config.Models.DeviceBatch { - public class ShowModel : ConfigDeviceBatchShowModel + public class ShowModel : DeviceGroupDocumentTemplateBulkGenerateModel, ConfigDeviceBatchShowModel { public Disco.Models.Repository.DeviceBatch DeviceBatch { get; set; } @@ -19,5 +20,7 @@ public class ShowModel : ConfigDeviceBatchShowModel public int DeviceCount { get; set; } public int DeviceDecommissionedCount { get; set; } public bool CanDelete { get; set; } + + public override int DeviceGroupId => DeviceBatch.Id; } } \ No newline at end of file diff --git a/Disco.Web/Areas/Config/Models/DeviceModel/ShowModel.cs b/Disco.Web/Areas/Config/Models/DeviceModel/ShowModel.cs index e975b35f..ec1cfffd 100644 --- a/Disco.Web/Areas/Config/Models/DeviceModel/ShowModel.cs +++ b/Disco.Web/Areas/Config/Models/DeviceModel/ShowModel.cs @@ -1,13 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; +using Disco.Models.UI.Config.DeviceModel; using Disco.Services.Plugins; -using Disco.Models.UI.Config.DeviceModel; +using Disco.Web.Areas.Config.Models.Shared; +using System.Collections.Generic; namespace Disco.Web.Areas.Config.Models.DeviceModel { - public class ShowModel : ConfigDeviceModelShowModel + public class ShowModel : DeviceGroupDocumentTemplateBulkGenerateModel, ConfigDeviceModelShowModel { public Disco.Models.Repository.DeviceModel DeviceModel { get; set; } @@ -20,5 +18,7 @@ public class ShowModel : ConfigDeviceModelShowModel public int DeviceDecommissionedCount { get; set; } public bool CanDelete { get; set; } + + public override int DeviceGroupId => DeviceModel.Id; } } \ No newline at end of file diff --git a/Disco.Web/Areas/Config/Models/DeviceProfile/ShowModel.cs b/Disco.Web/Areas/Config/Models/DeviceProfile/ShowModel.cs index f1eafb06..e0c6394e 100644 --- a/Disco.Web/Areas/Config/Models/DeviceProfile/ShowModel.cs +++ b/Disco.Web/Areas/Config/Models/DeviceProfile/ShowModel.cs @@ -2,12 +2,13 @@ using Disco.Services.Devices.ManagedGroups; using Disco.Services.Interop.ActiveDirectory; using Disco.Services.Plugins; +using Disco.Web.Areas.Config.Models.Shared; using System.Collections.Generic; using System.Web.Mvc; namespace Disco.Web.Areas.Config.Models.DeviceProfile { - public class ShowModel : ConfigDeviceProfileShowModel + public class ShowModel : DeviceGroupDocumentTemplateBulkGenerateModel, ConfigDeviceProfileShowModel { public Disco.Models.Repository.DeviceProfile DeviceProfile { get; set; } public List DeviceProfileDistributionTypes { get; set; } @@ -42,5 +43,7 @@ public string FriendlyOrganisationalUnitName public int DeviceDecommissionedCount { get; set; } public bool CanDelete { get; set; } + + public override int DeviceGroupId => DeviceProfile.Id; } } \ No newline at end of file diff --git a/Disco.Web/Areas/Config/Models/Shared/DeviceGroupDocumentTemplateBulkGenerateModel.cs b/Disco.Web/Areas/Config/Models/Shared/DeviceGroupDocumentTemplateBulkGenerateModel.cs new file mode 100644 index 00000000..25bf99f6 --- /dev/null +++ b/Disco.Web/Areas/Config/Models/Shared/DeviceGroupDocumentTemplateBulkGenerateModel.cs @@ -0,0 +1,12 @@ +using Disco.Models.UI.Config.Shared; +using System.Collections.Generic; + +namespace Disco.Web.Areas.Config.Models.Shared +{ + public abstract class DeviceGroupDocumentTemplateBulkGenerateModel : ConfigSharedDeviceGroupDocumentTemplateBulkGenerate + { + public List BulkGenerateDocumentTemplates { get; set; } + + public abstract int DeviceGroupId { get; } + } +} diff --git a/Disco.Web/Areas/Config/Views/DeviceBatch/Show.cshtml b/Disco.Web/Areas/Config/Views/DeviceBatch/Show.cshtml index a93870cc..18d756ec 100644 --- a/Disco.Web/Areas/Config/Views/DeviceBatch/Show.cshtml +++ b/Disco.Web/Areas/Config/Views/DeviceBatch/Show.cshtml @@ -1007,6 +1007,7 @@ +@Html.Partial(MVC.Config.Shared.Views._DeviceGroupDocumentBulkGenerate, Model);
@if (Model.CanDelete) { diff --git a/Disco.Web/Areas/Config/Views/DeviceBatch/Show.generated.cs b/Disco.Web/Areas/Config/Views/DeviceBatch/Show.generated.cs index 3a5de9ef..fa94c260 100644 --- a/Disco.Web/Areas/Config/Views/DeviceBatch/Show.generated.cs +++ b/Disco.Web/Areas/Config/Views/DeviceBatch/Show.generated.cs @@ -2720,21 +2720,29 @@ function buildAttachment(a, canRemove, quick) { #line default #line hidden -WriteLiteral("
\r\n \r\n \r\n \r\n\r\n<" + -"div"); +WriteLiteral(" \r\n \r\n \r\n \r\n\r\n"); + + + #line 1010 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" +Write(Html.Partial(MVC.Config.Shared.Views._DeviceGroupDocumentBulkGenerate, Model)); + + + #line default + #line hidden +WriteLiteral(";\r\n\r\n"); - #line 1011 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1012 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden - #line 1011 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1012 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.CanDelete) { @@ -2742,14 +2750,14 @@ function buildAttachment(a, canRemove, quick) { #line default #line hidden - #line 1013 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1014 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLinkButton("Delete", MVC.API.DeviceBatch.Delete(Model.DeviceBatch.Id, true), "buttonDelete")); #line default #line hidden - #line 1013 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1014 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } @@ -2759,7 +2767,7 @@ function buildAttachment(a, canRemove, quick) { WriteLiteral(" "); - #line 1015 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1016 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.DeviceCount > 0) { if (Authorization.Has(Claims.Device.Actions.Export)) @@ -2769,14 +2777,14 @@ function buildAttachment(a, canRemove, quick) { #line default #line hidden - #line 1019 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1020 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.Exporting.DeviceExportTypes.Batch, Model.DeviceBatch.Id))); #line default #line hidden - #line 1019 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1020 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0) @@ -2786,14 +2794,14 @@ function buildAttachment(a, canRemove, quick) { #line default #line hidden - #line 1023 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1024 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch"))); #line default #line hidden - #line 1023 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" + #line 1024 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } diff --git a/Disco.Web/Areas/Config/Views/DeviceModel/Index.cshtml b/Disco.Web/Areas/Config/Views/DeviceModel/Index.cshtml index c4ff6d28..9c8819b5 100644 --- a/Disco.Web/Areas/Config/Views/DeviceModel/Index.cshtml +++ b/Disco.Web/Areas/Config/Views/DeviceModel/Index.cshtml @@ -44,7 +44,14 @@ @Html.DisplayFor(modelItem => item.ModelType) - @item.DeviceCount.ToString("n0") + @if (item.DeviceCount > 0 && Authorization.Has(Claims.Device.Search)) + { + @Html.ActionLink(string.Format("View {0}", item.DeviceCount), MVC.Search.Query(item.Id.ToString(), "DeviceModel")) + } + else + { + @item.DeviceCount.ToString("n0") + } @if (item.DeviceDecommissionedCount > 0) { diff --git a/Disco.Web/Areas/Config/Views/DeviceModel/Index.generated.cs b/Disco.Web/Areas/Config/Views/DeviceModel/Index.generated.cs index a4d6ad59..f211c827 100644 --- a/Disco.Web/Areas/Config/Views/DeviceModel/Index.generated.cs +++ b/Disco.Web/Areas/Config/Views/DeviceModel/Index.generated.cs @@ -185,25 +185,62 @@ public override void Execute() #line hidden WriteLiteral("\r\n \r\n \r\n"); -WriteLiteral(" "); - #line 47 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" - Write(item.DeviceCount.ToString("n0")); + + + #line default + #line hidden + + #line 47 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" + if (item.DeviceCount > 0 && Authorization.Has(Claims.Device.Search)) + { #line default #line hidden -WriteLiteral("\r\n"); +WriteLiteral(" "); - #line 48 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" - + #line 49 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" + Write(Html.ActionLink(string.Format("View {0}", item.DeviceCount), MVC.Search.Query(item.Id.ToString(), "DeviceModel"))); + #line default #line hidden +WriteLiteral("\r\n"); + + + #line 50 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" + } + else + { + - #line 48 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" + #line default + #line hidden +WriteLiteral(" "); + + + #line 53 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" + Write(item.DeviceCount.ToString("n0")); + + + #line default + #line hidden +WriteLiteral("\r\n"); + + + #line 54 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" "); + + + #line 55 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" if (item.DeviceDecommissionedCount > 0) { @@ -214,21 +251,21 @@ public override void Execute() WriteLiteral(" class=\"smallMessage\""); -WriteAttribute("title", Tuple.Create(" title=\"", 2020), Tuple.Create("\"", 2091) +WriteAttribute("title", Tuple.Create(" title=\"", 2371), Tuple.Create("\"", 2442) - #line 50 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" -, Tuple.Create(Tuple.Create("", 2028), Tuple.Create(item.DeviceDecommissionedCount.ToString("n0") + #line 57 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" +, Tuple.Create(Tuple.Create("", 2379), Tuple.Create(item.DeviceDecommissionedCount.ToString("n0") #line default #line hidden -, 2028), false) -, Tuple.Create(Tuple.Create(" ", 2076), Tuple.Create("Decommissioned", 2077), true) +, 2379), false) +, Tuple.Create(Tuple.Create(" ", 2427), Tuple.Create("Decommissioned", 2428), true) ); WriteLiteral(">\r\n ("); - #line 51 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" + #line 58 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" Write(item.DeviceDecommissionedCount.ToString("n0")); @@ -237,7 +274,7 @@ public override void Execute() WriteLiteral(")\r\n \r\n"); - #line 53 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" + #line 60 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" } @@ -246,7 +283,7 @@ public override void Execute() WriteLiteral(" \r\n \r\n"); - #line 56 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" + #line 63 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" } @@ -261,7 +298,7 @@ public override void Execute() WriteLiteral(" "); - #line 59 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" + #line 66 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml" Write(Html.ActionLinkButton("Generic Components", MVC.Config.DeviceModel.GenericComponents())); diff --git a/Disco.Web/Areas/Config/Views/DeviceModel/Show.cshtml b/Disco.Web/Areas/Config/Views/DeviceModel/Show.cshtml index 2962b799..201b1948 100644 --- a/Disco.Web/Areas/Config/Views/DeviceModel/Show.cshtml +++ b/Disco.Web/Areas/Config/Views/DeviceModel/Show.cshtml @@ -15,21 +15,24 @@
- - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - + + + + - - - - + + + + - - - - - - - - - -
Id: + + Id: @Html.DisplayFor(model => model.DeviceModel.Id)
Description: + + Description: @if (canConfig) + + @if (canConfig) { - @Html.EditorFor(model => model.DeviceModel.Description) - @AjaxHelpers.AjaxSave() - @AjaxHelpers.AjaxLoader() - + } else { - @Html.DisplayFor(model => model.DeviceModel.Description) + @Html.DisplayFor(model => model.DeviceModel.Description) } -
Manufacturer: - - @Html.DisplayFor(model => model.DeviceModel.Manufacturer) -
Model: - - @Html.DisplayFor(model => model.DeviceModel.Model) -
Statistics -
@Model.DeviceCount.ToString("n0") @(Model.DeviceCount == 1 ? "devices is" : "devices are") of this model type.
- @if (Model.DeviceDecommissionedCount > 0) - { -
@Model.DeviceDecommissionedCount.ToString("n0") @(Model.DeviceDecommissionedCount == 1 ? "device is" : "devices are") decommissioned.
- } -
Default Purchase Date: - @if (canConfig) - { +
+ Manufacturer: + + @Html.DisplayFor(model => model.DeviceModel.Manufacturer) +
+ Model: + + @Html.DisplayFor(model => model.DeviceModel.Model) +
Statistics +
@Model.DeviceCount.ToString("n0") @(Model.DeviceCount == 1 ? "devices is" : "devices are") of this model type.
+ @if (Model.DeviceDecommissionedCount > 0) + { +
@Model.DeviceDecommissionedCount.ToString("n0") @(Model.DeviceDecommissionedCount == 1 ? "device is" : "devices are") decommissioned.
+ } +
+ Default Purchase Date: + + @if (canConfig) + { @Html.EditorFor(model => model.DeviceModel.DefaultPurchaseDate) @AjaxHelpers.AjaxLoader() - } - else - { + } + else + { @CommonHelpers.FriendlyDate(Model.DeviceModel.DefaultPurchaseDate, "Unknown") - } -
Default Warranty Provider: - @if (canConfig) - { - if (Model.WarrantyProviders.Count > 0) - { + } +
+ Default Warranty Provider: + + @if (canConfig) + { + if (Model.WarrantyProviders.Count > 0) + { @Html.DropDownListFor(model => model.DeviceModel.DefaultWarrantyProvider, Model.WarrantyProviders.ToSelectListItems(Model.DeviceModel.DefaultWarrantyProvider, true, "None")) @AjaxHelpers.AjaxLoader() - } - else - { + } + else + { No warranty provider plugins installed - } - if (canViewPlugins) - { + } + if (canViewPlugins) + {

View the Plugin Catalogue to discover and install warranty provider plugins.

- } + } + } + else + { + if (Model.DeviceModel.DefaultWarrantyProvider == null) + { + <None Specified> + } + else + { + var provider = Model.WarrantyProviders.FirstOrDefault(wp => wp.Id == Model.DeviceModel.DefaultWarrantyProvider); + if (provider == null) + { + <None Specified> } else { - if (Model.DeviceModel.DefaultWarrantyProvider == null) - { - <None Specified> - } - else - { - var provider = Model.WarrantyProviders.FirstOrDefault(wp => wp.Id == Model.DeviceModel.DefaultWarrantyProvider); - if (provider == null) - { - <None Specified> - } - else - { - @provider.Name - } - } + @provider.Name } -
Default Repair Provider: - @if (canConfig) - { - if (Model.RepairProviders.Count > 0) - { + } + } +
+ Default Repair Provider: + + @if (canConfig) + { + if (Model.RepairProviders.Count > 0) + { @Html.DropDownListFor(model => model.DeviceModel.DefaultRepairProvider, Model.RepairProviders.ToSelectListItems(Model.DeviceModel.DefaultRepairProvider, true, "None")) @AjaxHelpers.AjaxLoader() - } - else - { + } + else + {
No repair provider plugins installed
- } - if (canViewPlugins) - { + } + if (canViewPlugins) + {

View the Plugin Catalogue to discover and install repair provider plugins.

- } - } - else - { - if (Model.DeviceModel.DefaultRepairProvider == null) - { - <None Specified> - } - else - { - var provider = Model.RepairProviders.FirstOrDefault(wp => wp.Id == Model.DeviceModel.DefaultRepairProvider); - if (provider == null) - { + } + } + else + { + if (Model.DeviceModel.DefaultRepairProvider == null) + { <None Specified> - } - else - { - @provider.Name - } - } + } + else + { + var provider = Model.RepairProviders.FirstOrDefault(wp => wp.Id == Model.DeviceModel.DefaultRepairProvider); + if (provider == null) + { + <None Specified> } -
Type: - - @Html.DisplayFor(model => model.DeviceModel.ModelType) -
Image: - - Model Image - @if (canConfig) + else { -
- using (Html.BeginForm(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" })) - { - - - } + @provider.Name } -
+ } + } + + + + + Type: + + + @Html.DisplayFor(model => model.DeviceModel.ModelType) + + + + + Image: + + + Model Image + @if (canConfig) + { +
+ using (Html.BeginForm(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" })) + { + + + } + } + + +

Components

@Html.Partial(MVC.Config.DeviceModel.Views._DeviceComponentsTable, Model.DeviceComponentsModel) +@Html.Partial(MVC.Config.Shared.Views._DeviceGroupDocumentBulkGenerate, Model);
@if (Model.CanDelete) - { + { @Html.ActionLinkButton("Delete", MVC.API.DeviceModel.Delete(Model.DeviceModel.Id, true), "buttonDelete") } @if (Model.DeviceCount > 0) { if (Authorization.Has(Claims.Device.Actions.Export)) { - @Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.Exporting.DeviceExportTypes.Model, Model.DeviceModel.Id)) + @Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.Exporting.DeviceExportTypes.Model, Model.DeviceModel.Id)) } if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0) { - @Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceModel.Id.ToString(), "DeviceModel")) + @Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceModel.Id.ToString(), "DeviceModel")) } }
diff --git a/Disco.Web/Areas/Config/Views/DeviceModel/Show.generated.cs b/Disco.Web/Areas/Config/Views/DeviceModel/Show.generated.cs index f66158ad..e72b44da 100644 --- a/Disco.Web/Areas/Config/Views/DeviceModel/Show.generated.cs +++ b/Disco.Web/Areas/Config/Views/DeviceModel/Show.generated.cs @@ -2,7 +2,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34014 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -27,7 +27,6 @@ namespace Disco.Web.Areas.Config.Views.DeviceModel using System.Web.UI; using System.Web.WebPages; using Disco; - using Disco.BI.Extensions; using Disco.Models.Repository; using Disco.Services; using Disco.Services.Authorization; @@ -72,71 +71,77 @@ public override void Execute() WriteLiteral(" style=\"width: 150px\""); -WriteLiteral(">Id:\r\n \r\n \r\n"); +WriteLiteral(">\r\n Id:\r\n \r\n \r\n"); WriteLiteral(" "); - #line 21 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 22 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" Write(Html.DisplayFor(model => model.DeviceModel.Id)); #line default #line hidden -WriteLiteral("\r\n \r\n \r\n \r\n Description:\r\n " + -" \r\n "); +WriteLiteral("\r\n \r\n \r\n \r\n \r\n " + +" Description:\r\n \r\n \r\n"); - #line 27 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 30 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + + + #line default + #line hidden + + #line 30 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" if (canConfig) { - + #line default #line hidden - #line 29 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - Write(Html.EditorFor(model => model.DeviceModel.Description)); + #line 32 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + Write(Html.EditorFor(model => model.DeviceModel.Description)); #line default #line hidden - #line 29 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - - + #line 32 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + + #line default #line hidden - #line 30 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - Write(AjaxHelpers.AjaxSave()); + #line 33 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + Write(AjaxHelpers.AjaxSave()); #line default #line hidden - #line 30 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - - + #line 33 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + + #line default #line hidden - #line 31 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - Write(AjaxHelpers.AjaxLoader()); + #line 34 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + Write(AjaxHelpers.AjaxLoader()); #line default #line hidden - #line 31 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - + #line 34 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line default #line hidden -WriteLiteral(@" \r\n"); +" });\r\n \r\n"); - #line 42 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 45 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" } else { - + #line default #line hidden - #line 45 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - Write(Html.DisplayFor(model => model.DeviceModel.Description)); + #line 48 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + Write(Html.DisplayFor(model => model.DeviceModel.Description)); #line default #line hidden - #line 45 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - + #line 48 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } #line default #line hidden -WriteLiteral(" \r\n \r\n \r\n Manufacturer:\r\n " + -" \r\n \r\n"); +WriteLiteral(" \r\n \r\n \r\n \r\n Manufacturer:\r\n " + +" \r\n \r\n"); -WriteLiteral(" "); +WriteLiteral(" "); - #line 53 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - Write(Html.DisplayFor(model => model.DeviceModel.Manufacturer)); + #line 57 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + Write(Html.DisplayFor(model => model.DeviceModel.Manufacturer)); #line default #line hidden -WriteLiteral("\r\n \r\n \r\n \r\n Model:\r\n " + -" \r\n \r\n"); +WriteLiteral("\r\n \r\n \r\n \r\n \r\n Model:\r\n <" + +"/th>\r\n \r\n"); -WriteLiteral(" "); +WriteLiteral(" "); - #line 60 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - Write(Html.DisplayFor(model => model.DeviceModel.Model)); + #line 65 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + Write(Html.DisplayFor(model => model.DeviceModel.Model)); #line default #line hidden -WriteLiteral("\r\n \r\n \r\n \r\n Statistics" + -"\r\n \r\n
"); +WriteLiteral("\r\n \r\n \r\n \r\n Statistics\r\n \r\n" + +"
"); - #line 66 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - Write(Model.DeviceCount.ToString("n0")); + #line 71 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + Write(Model.DeviceCount.ToString("n0")); #line default @@ -214,8 +219,8 @@ public override void Execute() WriteLiteral(" "); - #line 66 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - Write(Model.DeviceCount == 1 ? "devices is" : "devices are"); + #line 71 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + Write(Model.DeviceCount == 1 ? "devices is" : "devices are"); #line default @@ -223,28 +228,28 @@ public override void Execute() WriteLiteral(" of this model type.
\r\n"); - #line 67 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - + #line 72 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line default #line hidden - #line 67 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - if (Model.DeviceDecommissionedCount > 0) - { + #line 72 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + if (Model.DeviceDecommissionedCount > 0) + { #line default #line hidden -WriteLiteral(" "); - #line 69 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - Write(Model.DeviceDecommissionedCount.ToString("n0")); + #line 74 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + Write(Model.DeviceDecommissionedCount.ToString("n0")); #line default @@ -252,8 +257,8 @@ public override void Execute() WriteLiteral(" "); - #line 69 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - Write(Model.DeviceDecommissionedCount == 1 ? "device is" : "devices are"); + #line 74 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + Write(Model.DeviceDecommissionedCount == 1 ? "device is" : "devices are"); #line default @@ -261,46 +266,52 @@ public override void Execute() WriteLiteral(" decommissioned.
\r\n"); - #line 70 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - } + #line 75 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } #line default #line hidden -WriteLiteral(" \r\n \r\n \r\n Default Purchase " + -"Date:\r\n \r\n "); +WriteLiteral(" \r\n \r\n \r\n \r\n Default Purchase Da" + +"te:\r\n \r\n \r\n"); - #line 76 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - if (canConfig) - { + #line 83 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + + + #line default + #line hidden + + #line 83 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + if (canConfig) + { #line default #line hidden - #line 78 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 85 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" Write(Html.EditorFor(model => model.DeviceModel.DefaultPurchaseDate)); #line default #line hidden - #line 78 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 85 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" #line default #line hidden - #line 79 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 86 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden - #line 79 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 86 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" @@ -315,7 +326,7 @@ public override void Execute() '"); - #line 86 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 93 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultPurchaseDate(Model.DeviceModel.Id))); @@ -326,65 +337,71 @@ public override void Execute() "});\r\n \r\n"); - #line 93 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - } - else - { + #line 100 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } + else + { #line default #line hidden - #line 96 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 103 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.DeviceModel.DefaultPurchaseDate, "Unknown")); #line default #line hidden - #line 96 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 103 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - } + } #line default #line hidden -WriteLiteral(" \r\n \r\n \r\n Default Warranty " + -"Provider:\r\n \r\n "); +WriteLiteral(" \r\n\r\n\r\n \r\n Default Warranty Provider:\r\n \r\n" + +" \r\n"); - #line 103 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - if (canConfig) - { - if (Model.WarrantyProviders.Count > 0) - { + #line 112 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + + + #line default + #line hidden + + #line 112 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + if (canConfig) + { + if (Model.WarrantyProviders.Count > 0) + { #line default #line hidden - #line 107 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 116 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" Write(Html.DropDownListFor(model => model.DeviceModel.DefaultWarrantyProvider, Model.WarrantyProviders.ToSelectListItems(Model.DeviceModel.DefaultWarrantyProvider, true, "None"))); #line default #line hidden - #line 107 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 116 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" #line default #line hidden - #line 108 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 117 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden - #line 108 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 117 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" @@ -398,7 +415,7 @@ public override void Execute() '"); - #line 114 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 123 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultWarrantyProvider(Model.DeviceModel.Id))); @@ -408,10 +425,10 @@ public override void Execute() " );\r\n });\r\n \r\n"); - #line 119 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - } - else - { + #line 128 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } + else + { #line default @@ -423,10 +440,10 @@ public override void Execute() WriteLiteral(">No warranty provider plugins installed\r\n"); - #line 123 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - } - if (canViewPlugins) - { + #line 132 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } + if (canViewPlugins) + { #line default @@ -445,27 +462,27 @@ public override void Execute() WriteLiteral(">View the (Url.Action(MVC.Config.Plugins.Install()) + #line 137 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" +, Tuple.Create(Tuple.Create("", 4926), Tuple.Create(Url.Action(MVC.Config.Plugins.Install()) #line default #line hidden -, 5032), false) +, 4926), false) ); WriteLiteral(">Plugin Catalogue to discover and install warranty provider plugins.\r\n " + "

\r\n \r\n"); - #line 131 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - } - } - else - { - if (Model.DeviceModel.DefaultWarrantyProvider == null) - { + #line 140 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } + } + else + { + if (Model.DeviceModel.DefaultWarrantyProvider == null) + { #line default @@ -477,85 +494,91 @@ public override void Execute() WriteLiteral("><None Specified>\r\n"); - #line 138 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - } - else - { - var provider = Model.WarrantyProviders.FirstOrDefault(wp => wp.Id == Model.DeviceModel.DefaultWarrantyProvider); - if (provider == null) - { + #line 147 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } + else + { + var provider = Model.WarrantyProviders.FirstOrDefault(wp => wp.Id == Model.DeviceModel.DefaultWarrantyProvider); + if (provider == null) + { #line default #line hidden -WriteLiteral(" <None Specified>\r\n"); - #line 145 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - } - else - { - + #line 154 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } + else + { + #line default #line hidden - #line 148 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - Write(provider.Name); + #line 157 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + Write(provider.Name); #line default #line hidden - #line 148 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - - } - } + #line 157 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } + } + } #line default #line hidden -WriteLiteral(" \r\n \r\n \r\n Default Repair Pr" + -"ovider:\r\n \r\n "); +WriteLiteral("\r\n\r\n\r\n \r\n Default Repair Provider:\r\n \r\n \r\n"); - #line 157 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - if (canConfig) - { - if (Model.RepairProviders.Count > 0) - { + #line 168 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + + + #line default + #line hidden + + #line 168 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + if (canConfig) + { + if (Model.RepairProviders.Count > 0) + { #line default #line hidden - #line 161 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 172 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" Write(Html.DropDownListFor(model => model.DeviceModel.DefaultRepairProvider, Model.RepairProviders.ToSelectListItems(Model.DeviceModel.DefaultRepairProvider, true, "None"))); #line default #line hidden - #line 161 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 172 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" #line default #line hidden - #line 162 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 173 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden - #line 162 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 173 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" @@ -569,7 +592,7 @@ public override void Execute() '"); - #line 168 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 179 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultRepairProvider(Model.DeviceModel.Id))); @@ -579,10 +602,10 @@ public override void Execute() ");\r\n });\r\n \r\n"); - #line 173 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - } - else - { + #line 184 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } + else + { #line default @@ -590,10 +613,10 @@ public override void Execute() WriteLiteral("
No repair provider plugins installed
\r\n"); - #line 177 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - } - if (canViewPlugins) - { + #line 188 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } + if (canViewPlugins) + { #line default @@ -612,27 +635,27 @@ public override void Execute() WriteLiteral(">View the (Url.Action(MVC.Config.Plugins.Install()) + #line 193 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" +, Tuple.Create(Tuple.Create("", 6987), Tuple.Create(Url.Action(MVC.Config.Plugins.Install()) #line default #line hidden -, 7333), false) +, 6987), false) ); WriteLiteral(">Plugin Catalogue to discover and install repair provider plugins.\r\n " + "

\r\n \r\n"); - #line 185 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - } - } - else - { - if (Model.DeviceModel.DefaultRepairProvider == null) - { + #line 196 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } + } + else + { + if (Model.DeviceModel.DefaultRepairProvider == null) + { #line default @@ -644,103 +667,102 @@ public override void Execute() WriteLiteral("><None Specified>\r\n"); - #line 192 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - } - else - { - var provider = Model.RepairProviders.FirstOrDefault(wp => wp.Id == Model.DeviceModel.DefaultRepairProvider); - if (provider == null) - { + #line 203 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } + else + { + var provider = Model.RepairProviders.FirstOrDefault(wp => wp.Id == Model.DeviceModel.DefaultRepairProvider); + if (provider == null) + { #line default #line hidden -WriteLiteral(" <None Specified>\r\n"); - #line 199 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - } - else - { - + #line 210 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } + else + { + #line default #line hidden - #line 202 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - Write(provider.Name); + #line 213 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + Write(provider.Name); #line default #line hidden - #line 202 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - - } - } + #line 213 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } + } + } #line default #line hidden -WriteLiteral(" \r\n \r\n \r\n Type:\r\n " + -" \r\n \r\n"); +WriteLiteral("\r\n\r\n\r\n \r\n Type:\r\n \r\n \r\n"); -WriteLiteral(" "); +WriteLiteral(" "); - #line 212 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - Write(Html.DisplayFor(model => model.DeviceModel.ModelType)); + #line 224 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + Write(Html.DisplayFor(model => model.DeviceModel.ModelType)); #line default #line hidden -WriteLiteral("\r\n \r\n \r\n \r\n Image:\r\n " + -" \r\n \r\n \r\n\r\n\r\n \r\n Image:\r\n \r\n \r\n " + +"(Url.Action(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, Model.DeviceModel.ImageHash())) + #line 232 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" +, Tuple.Create(Tuple.Create("", 8047), Tuple.Create(Url.Action(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, Model.DeviceModel.ImageHash())) #line default #line hidden -, 8625), false) +, 8047), false) ); WriteLiteral(" />\r\n"); - #line 220 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - + #line 233 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line default #line hidden - #line 220 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - if (canConfig) - { + #line 233 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + if (canConfig) + { #line default #line hidden -WriteLiteral("
\r\n"); +WriteLiteral("
\r\n"); - #line 223 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - using (Html.BeginForm(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" })) - { + #line 236 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + using (Html.BeginForm(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" })) + { #line default #line hidden -WriteLiteral(" \r\n"); -WriteLiteral(" \r\n"); - #line 227 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" - } - } + #line 240 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + } + } #line default #line hidden -WriteLiteral(" \r\n \r\n \r\n\r\n

Components

\r\n"); +WriteLiteral(" \r\n\r\n\r\n\r\n

Components

\r\n"); - #line 234 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" + #line 247 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml" Write(Html.Partial(MVC.Config.DeviceModel.Views._DeviceComponentsTable, Model.DeviceComponentsModel)); #line default #line hidden -WriteLiteral("\r\n