#pragma warning disable 1591 //------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace Disco.Web.Areas.Config.Views.DeviceBatch { using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Text; using System.Web; using System.Web.Helpers; using System.Web.Mvc; using System.Web.Mvc.Ajax; using System.Web.Mvc.Html; using System.Web.Routing; using System.Web.Security; using System.Web.UI; using System.Web.WebPages; using Disco; using Disco.Models.Repository; using Disco.Services; using Disco.Services.Authorization; #line 2 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" using Disco.Services.Devices.ManagedGroups; #line default #line hidden using Disco.Services.Web; using Disco.Web; #line 3 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" using Disco.Web.Areas.Config.Models.Shared; #line default #line hidden using Disco.Web.Extensions; [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] [System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceBatch/Show.cshtml")] public partial class Show : Disco.Services.Web.WebViewPage { public Show() { } public override void Execute() { #line 4 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Authorization.Require(Claims.Config.DeviceBatch.Show); ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches", MVC.Config.DeviceBatch.Index(null), Model.DeviceBatch.ToString()); var canConfig = Authorization.Has(Claims.Config.DeviceBatch.Configure); var canDeviceModelShow = Authorization.Has(Claims.Config.DeviceModel.Show); var hideAdvanced = Model.DeviceBatch.AssignedUsersLinkedGroup == null && Model.DeviceBatch.DevicesLinkedGroup == null; Html.BundleDeferred("~/Style/Shadowbox"); Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox"); Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR"); if (canConfig) { Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers"); Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons"); Html.BundleDeferred("~/ClientScripts/Modules/tinymce"); Html.BundleDeferred("~/ClientScripts/Modules/Disco-AttachmentUploader"); } #line default #line hidden WriteLiteral("\r\n(hideAdvanced ? " Config_HideAdvanced" : null #line default #line hidden , 1250), false) ); WriteLiteral(" style=\"width: 730px\""); WriteLiteral(">\r\n \r\n \r\n \r\n Id:\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n "); #line 115 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 115 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" foreach (var membership in Model.DeviceModelMembers.OrderByDescending(dmm => dmm.DeviceCount)) { #line default #line hidden WriteLiteral(" \r\n \r\n \r\n"); WriteLiteral(" "); #line 129 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(membership.DeviceCount.ToString("n0")); #line default #line hidden WriteLiteral("\r\n \r\n " + "\r\n \r\n"); #line 135 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n " + " \r\n \r\n \r\n \r\n \r\n \r\n " + "
\r\n"); WriteLiteral(" "); #line 35 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.DisplayFor(model => model.DeviceBatch.Id)); #line default #line hidden WriteLiteral("\r\n
\r\n " + " Name:\r\n \r\n"); #line 43 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 43 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 45 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.Name)); #line default #line hidden #line 45 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 46 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 46 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 47 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 47 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_Name'), 'Invalid Name', '"); #line 53 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateName(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n \'BatchName\'\r\n );\r\n " + " });\r\n \r\n"); #line 58 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 61 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.Name); #line default #line hidden #line 61 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral("
\r\n " + " Default Device Model:\r\n \r\n"); #line 70 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 70 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 72 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.DropDownListFor(model => model.DeviceBatch.DefaultDeviceModelId, Model.DeviceModels.ToSelectListItems(null, true))); #line default #line hidden #line 72 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 73 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 73 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 74 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 74 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" \r\n $(function () {\r\n document.DiscoFun" + "ctions.PropertyChangeHelper(\r\n $(\'#DeviceBatch_Defaul" + "tDeviceModelId\'),\r\n null,\r\n " + " \'"); #line 80 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateDefaultDeviceModelId(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n \'DefaultDeviceModelId\'\r\n )" + ";\r\n });\r\n \r\n"); #line 85 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (Model.DefaultDeviceModel == null) { #line default #line hidden WriteLiteral("<None Specified>"); #line 89 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 91 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DefaultDeviceModel.ToString()); #line default #line hidden #line 91 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" ; } } #line default #line hidden WriteLiteral("
\r\n Devices added offline will default to this Device Model. Once a device enrols the Device Model will be accurately represented.
Devices "); #line 104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.DeviceModelMembers.Count > 0) { #line default #line hidden WriteLiteral("
Model Device Count Decommissioned
\r\n"); #line 119 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 119 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canDeviceModelShow) { #line default #line hidden #line 121 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLink(membership.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(membership.DeviceModel.Id))); #line default #line hidden #line 121 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 125 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(membership.DeviceModel.ToString()); #line default #line hidden #line 125 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); WriteLiteral(" "); #line 132 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(membership.DeviceDecommissionedCount.ToString("n0")); #line default #line hidden WriteLiteral("\r\n
Total Models: "); #line 139 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceModelMembers.Count.ToString("n0")); #line default #line hidden WriteLiteral(""); #line 140 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceCount.ToString("n0")); #line default #line hidden WriteLiteral(""); #line 141 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceDecommissionedCount.ToString("n0")); #line default #line hidden WriteLiteral("
\r\n"); #line 145 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden WriteLiteral(" No device models are referenced in this batch.\r\n"); #line 149 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" "); #line 150 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.DeviceBatch.UnitQuantity.HasValue && Model.DeviceBatch.UnitQuantity.Value > Model.DeviceCount) { var missingCount = Model.DeviceBatch.UnitQuantity.Value - Model.DeviceCount; #line default #line hidden WriteLiteral(" \r\n \r\n \r\n"); WriteLiteral(" "); #line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceCount.ToString("n0")); #line default #line hidden WriteLiteral(" of "); #line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.UnitQuantity.Value.ToString("n0")); #line default #line hidden WriteLiteral(" purchased devices are managed by Disco. "); #line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(missingCount.ToString("n0")); #line default #line hidden WriteLiteral(" "); #line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(missingCount == 1 ? "is" : "are"); #line default #line hidden WriteLiteral(" not managed.\r\n

\r\n \r" + "\n"); #line 159 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n " + " Purchase:\r\n \r\n \r\n \r\n \r\n \r\n Purchase Date:\r\n \r\n " + " \r\n"); #line 173 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 173 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 175 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.PurchaseDate)); #line default #line hidden #line 175 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 176 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 176 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(@" "); #line 190 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 193 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.PurchaseDate)); #line default #line hidden #line 193 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n Supplier:\r\n " + " \r\n \r\n"); #line 202 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 202 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 204 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.Supplier)); #line default #line hidden #line 204 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 205 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 205 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 206 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 206 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_Supplier'), 'Batch Supplier', '"); #line 212 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateSupplier(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n \'Supplier\'\r\n " + " );\r\n });\r\n " + " \r\n"); #line 217 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.Supplier)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 221 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 223 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.Supplier); #line default #line hidden #line 223 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n Unit Cost:\r\n " + " \r\n \r\n"); #line 232 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 232 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 234 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.UnitCost)); #line default #line hidden #line 234 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 235 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 235 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 236 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 236 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_UnitCost'), 'Unit Cost', '"); #line 242 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateUnitCost(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n \'UnitCost\'\r\n " + " );\r\n });\r\n " + " \r\n"); #line 247 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (!Model.DeviceBatch.UnitCost.HasValue) { #line default #line hidden WriteLiteral("<None Specified>"); #line 251 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 253 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.UnitCost.Value.ToString("C")); #line default #line hidden #line 253 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n Quantity:\r\n " + " \r\n \r\n"); #line 262 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 262 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 264 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.UnitQuantity)); #line default #line hidden #line 264 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 265 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 265 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 266 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 266 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_UnitQuantity'), 'Quantity', '"); #line 272 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateUnitQuantity(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n \'UnitQuantity\'\r\n " + " );\r\n });\r\n " + " \r\n"); #line 277 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (!Model.DeviceBatch.UnitQuantity.HasValue) { #line default #line hidden WriteLiteral("<None Specified>"); #line 281 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 283 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.UnitQuantity.Value.ToString("n0")); #line default #line hidden #line 283 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n