#pragma warning disable 1591 //------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.34003 // // 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.BI.Extensions; using Disco.Models.Repository; using Disco.Services.Authorization; using Disco.Services.Web; using Disco.Web; 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 2 "..\..\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); if (canConfig) { Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers"); Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons"); Html.BundleDeferred("~/ClientScripts/Modules/tinymce"); } #line default #line hidden 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 \r\n \r\n \r\n \r\n " + " "); #line 98 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 98 "..\..\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 112 "..\..\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 118 "..\..\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 23 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.DisplayFor(model => model.DeviceBatch.Id)); #line default #line hidden WriteLiteral("\r\n
Name:\r\n " + " \r\n"); #line 30 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 30 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 32 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.Name)); #line default #line hidden #line 32 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 33 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 33 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 34 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 34 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_Name'), 'Invalid Name', '"); #line 40 "..\..\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 45 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 48 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.Name); #line default #line hidden #line 48 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral("
Default Device Mo" + "del:\r\n "); #line 55 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 57 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.DropDownListFor(model => model.DeviceBatch.DefaultDeviceModelId, Model.DeviceModels.ToSelectListItems(null, true))); #line default #line hidden #line 57 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 58 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 58 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 59 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 59 "..\..\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 65 "..\..\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 70 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (Model.DefaultDeviceModel == null) { #line default #line hidden WriteLiteral("<None Specified>"); #line 74 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 76 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DefaultDeviceModel.ToString()); #line default #line hidden #line 76 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" ; } } #line default #line hidden WriteLiteral("
\r\n Devices added offline will default to this Device Model.\r\n On" + "ce a device enrols the Device Model will be accurately represented.\r\n " + "
Devices\r\n"); #line 87 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 87 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.DeviceModelMembers.Count > 0) { #line default #line hidden WriteLiteral("
Model Device Count Decommissioned
\r\n"); #line 102 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 102 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canDeviceModelShow) { #line default #line hidden #line 104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLink(membership.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(membership.DeviceModel.Id))); #line default #line hidden #line 104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 108 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(membership.DeviceModel.ToString()); #line default #line hidden #line 108 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); WriteLiteral(" "); #line 115 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(membership.DeviceDecommissionedCount.ToString("n0")); #line default #line hidden WriteLiteral("\r\n
Total Models: "); #line 122 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceModelMembers.Count.ToString("n0")); #line default #line hidden WriteLiteral(""); #line 123 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceCount.ToString("n0")); #line default #line hidden WriteLiteral(""); #line 124 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceDecommissionedCount.ToString("n0")); #line default #line hidden WriteLiteral("
\r\n"); #line 128 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden WriteLiteral(" No device models are referenced in this batch.\r\n"); #line 132 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" "); #line 133 "..\..\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"); WriteLiteral(" "); #line 138 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceCount.ToString("n0")); #line default #line hidden WriteLiteral(" of "); #line 138 "..\..\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 138 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(missingCount.ToString("n0")); #line default #line hidden WriteLiteral(" "); #line 138 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(missingCount == 1 ? "is" : "are"); #line default #line hidden WriteLiteral(" not managed.\r\n \r\n"); #line 140 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n Purchase:\r\n " + " \r\n \r\n \r\n \r\n Purchase Date:\r\n \r\n \r\n"); #line 152 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 152 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 154 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.PurchaseDate)); #line default #line hidden #line 154 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 155 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 155 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(@" "); #line 169 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 172 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.PurchaseDate)); #line default #line hidden #line 172 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n Supplier:\r\n \r\n " + " "); #line 179 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 181 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.Supplier)); #line default #line hidden #line 181 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 182 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 182 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 183 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 183 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_Supplier'), 'Batch Supplier', '"); #line 189 "..\..\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 194 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.Supplier)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 198 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 200 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.Supplier); #line default #line hidden #line 200 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n Unit Cost:\r\n \r\n " + " "); #line 207 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 209 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.UnitCost)); #line default #line hidden #line 209 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 210 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 210 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 211 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 211 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_UnitCost'), 'Unit Cost', '"); #line 217 "..\..\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 222 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (!Model.DeviceBatch.UnitCost.HasValue) { #line default #line hidden WriteLiteral("<None Specified>"); #line 226 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 228 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.UnitCost.Value.ToString("C")); #line default #line hidden #line 228 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n Quantity:\r\n \r\n " + " "); #line 235 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 237 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.UnitQuantity)); #line default #line hidden #line 237 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 238 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 238 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 239 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 239 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_UnitQuantity'), 'Quantity', '"); #line 245 "..\..\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 250 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (!Model.DeviceBatch.UnitQuantity.HasValue) { #line default #line hidden WriteLiteral("<None Specified>"); #line 254 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 256 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.UnitQuantity.Value.ToString("n0")); #line default #line hidden #line 256 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n
\r\n Details "); #line 263 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxPurchaseDetails")); #line default #line hidden WriteLiteral("\r\n
\r\n"); #line 265 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 265 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 267 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.PurchaseDetails)); #line default #line hidden #line 267 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { var model = { $field: $('#DeviceBatch_PurchaseDetails'), fieldName: 'PurchaseDetails', $ajax_loading: null, $ajax_ok: null, updated: function () { if (!model.$ajax_loading) model.$ajax_loading = $('#ajax' + model.fieldName + '_loading'); if (!model.$ajax_ok) model.$ajax_ok = $('#ajax' + model.fieldName + '_ok'); model.$ajax_loading.show(); var data = {}; data[model.fieldName] = model.$field.tinymce().getContent(); $.ajax({ url: '"); #line 284 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdatePurchaseDetails(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n dataType: \'json\',\r\n " + " data: data,\r\n " + " traditional: true,\r\n type: \'PO" + "ST\',\r\n success: function (d) {\r\n " + " if (d == \'OK\') {\r\n " + " model.$ajax_loading.hide();\r\n " + " model.$ajax_ok.show().delay(\'fast\').fadeOut(\'s" + "low\');\r\n } else {\r\n " + " model.$ajax_loading.hide();\r\n " + " alert(\'Unable to update purchase details:" + " \' + d);\r\n }\r\n " + " },\r\n error: " + "function (jqXHR, textStatus, errorThrown) {\r\n " + " alert(\'Unable to update purchase details: \' + errorThrown);\r\n " + " model.$ajax_loading.hide();\r\n " + " }\r\n })" + "\r\n }\r\n };\r\n\r\n " + " model.$field.tinymce({\r\n " + " theme: \'simple\',\r\n add_unload_trig" + "ger: false,\r\n schema: \"html5\",\r\n " + " statusbar: false,\r\n se" + "tup: function (ed) {\r\n ed.on(\'init\', func" + "tion () {\r\n $(ed.getWin()).blur(model" + ".updated);\r\n });\r\n " + " }\r\n });\r\n " + " });\r\n \r\n"); #line 319 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.PurchaseDetails)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 323 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 325 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.PurchaseDetails)); #line default #line hidden #line 325 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n " + " Warranty:\r\n \r\n \r\n \r\n \r\n Valid Until:\r\n \r\n \r\n"); #line 339 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 339 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 341 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.WarrantyValidUntil)); #line default #line hidden #line 341 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 342 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 342 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(@" "); #line 356 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 359 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.WarrantyValidUntil, "Unknown")); #line default #line hidden #line 359 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n
\r\n Details "); #line 366 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxWarrantyDetails")); #line default #line hidden WriteLiteral("\r\n
\r\n"); #line 368 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 368 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 370 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.WarrantyDetails)); #line default #line hidden #line 370 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { var model = { $field: $('#DeviceBatch_WarrantyDetails'), fieldName: 'WarrantyDetails', $ajax_loading: null, $ajax_ok: null, updated: function () { if (!model.$ajax_loading) model.$ajax_loading = $('#ajax' + model.fieldName + '_loading'); if (!model.$ajax_ok) model.$ajax_ok = $('#ajax' + model.fieldName + '_ok'); model.$ajax_loading.show(); var data = {}; data[model.fieldName] = model.$field.tinymce().getContent(); $.ajax({ url: '"); #line 387 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateWarrantyDetails(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n dataType: \'json\',\r\n " + " data: data,\r\n " + " traditional: true,\r\n type: \'PO" + "ST\',\r\n success: function (d) {\r\n " + " if (d == \'OK\') {\r\n " + " model.$ajax_loading.hide();\r\n " + " model.$ajax_ok.show().delay(\'fast\').fadeOut(\'s" + "low\');\r\n } else {\r\n " + " model.$ajax_loading.hide();\r\n " + " alert(\'Unable to update warranty details:" + " \' + d);\r\n }\r\n " + " },\r\n error: " + "function (jqXHR, textStatus, errorThrown) {\r\n " + " alert(\'Unable to update warranty details: \' + errorThrown);\r\n " + " model.$ajax_loading.hide();\r\n " + " }\r\n })" + "\r\n }\r\n };\r\n\r\n " + " model.$field.tinymce({\r\n " + " theme: \'simple\',\r\n add_unload_trig" + "ger: false,\r\n schema: \"html5\",\r\n " + " statusbar: false,\r\n se" + "tup: function (ed) {\r\n ed.on(\'init\', func" + "tion () {\r\n $(ed.getWin()).blur(model" + ".updated);\r\n });\r\n " + " }\r\n });\r\n " + " });\r\n \r\n"); #line 422 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.WarrantyDetails)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 426 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 428 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.WarrantyDetails)); #line default #line hidden #line 428 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n " + " Insurance:\r\n \r\n \r\n \r\n \r\n Supplier:\r\n \r\n "); #line 441 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 443 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.InsuranceSupplier)); #line default #line hidden #line 443 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 444 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 444 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 445 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 445 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_InsuranceSupplier'), 'Insurance Supplier', '"); #line 451 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateInsuranceSupplier(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n \'InsuranceSupplier\'\r\n " + " );\r\n });\r\n " + " \r\n"); #line 456 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.InsuranceSupplier)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 460 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 462 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.InsuranceSupplier); #line default #line hidden #line 462 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" ; } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n Insured Date:\r\n \r\n "); #line 470 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 472 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.InsuredDate)); #line default #line hidden #line 472 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 473 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 473 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(@" "); #line 487 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 490 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredDate, "Unknown")); #line default #line hidden #line 490 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n Insured Until:\r\n \r\n "); #line 497 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 499 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.InsuredUntil)); #line default #line hidden #line 499 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 500 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 500 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(@" "); #line 514 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 517 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredUntil, "Unknown")); #line default #line hidden #line 517 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n
\r\n Details "); #line 524 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxInsuranceDetails")); #line default #line hidden WriteLiteral("\r\n
\r\n"); #line 526 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 526 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 528 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.InsuranceDetails)); #line default #line hidden #line 528 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { var model = { $field: $('#DeviceBatch_InsuranceDetails'), $ajax_loading: null, $ajax_ok: null, updated: function () { if (!model.$ajax_loading) model.$ajax_loading = $('#ajaxInsuranceDetails_loading'); if (!model.$ajax_ok) model.$ajax_ok = $('#ajaxInsuranceDetails_ok'); model.$ajax_loading.show(); var data = { InsuranceDetails: model.$field.tinymce().getContent() }; $.ajax({ url: '"); #line 543 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateInsuranceDetails(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n dataType: \'json\',\r\n " + " data: data,\r\n " + " traditional: true,\r\n type: \'PO" + "ST\',\r\n success: function (d) {\r\n " + " if (d == \'OK\') {\r\n " + " model.$ajax_loading.hide();\r\n " + " model.$ajax_ok.show().delay(\'fast\').fadeOut(\'s" + "low\');\r\n } else {\r\n " + " model.$ajax_loading.hide();\r\n " + " alert(\'Unable to update insurance details" + ": \' + d);\r\n }\r\n " + " },\r\n error:" + " function (jqXHR, textStatus, errorThrown) {\r\n " + " alert(\'Unable to update insurance details: \' + errorThrown);\r\n " + " model.$ajax_loading.hide();\r\n " + " }\r\n " + "})\r\n }\r\n };\r\n\r" + "\n model.$field.tinymce({\r\n " + " theme: \'simple\',\r\n add_unload_tr" + "igger: false,\r\n schema: \"html5\",\r\n " + " statusbar: false,\r\n " + "setup: function (ed) {\r\n ed.on(\'init\', fu" + "nction () {\r\n $(ed.getWin()).blur(mod" + "el.updated);\r\n });\r\n " + " }\r\n });\r\n " + " });\r\n \r\n"); #line 578 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.InsuranceDetails)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 582 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 584 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.InsuranceDetails)); #line default #line hidden #line 584 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n " + " Comments:
\r\n"); WriteLiteral(" "); #line 591 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxComments")); #line default #line hidden WriteLiteral("\r\n \r\n "); #line 593 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 595 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.Comments)); #line default #line hidden #line 595 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { var model = { $field: $('#DeviceBatch_Comments'), $ajax_loading: null, $ajax_ok: null, updated: function () { if (!model.$ajax_loading) model.$ajax_loading = $('#ajaxComments_loading'); if (!model.$ajax_ok) model.$ajax_ok = $('#ajaxComments_ok'); model.$ajax_loading.show(); var data = { Comments: model.$field.tinymce().getContent() }; $.ajax({ url: '"); #line 610 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateComments(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n dataType: \'json\',\r\n " + " data: data,\r\n traditional: true" + ",\r\n type: \'POST\',\r\n " + " success: function (d) {\r\n if (d" + " == \'OK\') {\r\n model.$ajax_loading.hid" + "e();\r\n model.$ajax_ok.show().delay(\'f" + "ast\').fadeOut(\'slow\');\r\n } else {\r\n " + " model.$ajax_loading.hide();\r\n " + " alert(\'Unable to update comments: \' + d);\r\n " + " }\r\n },\r\n " + " error: function (jqXHR, textStatus, errorThrown" + ") {\r\n alert(\'Unable to update comments: \'" + " + errorThrown);\r\n model.$ajax_loading.hi" + "de();\r\n }\r\n })" + "\r\n }\r\n };\r\n\r\n " + " model.$field.tinymce({\r\n theme: \'simple\',\r\n " + " add_unload_trigger: false,\r\n " + " schema: \"html5\",\r\n statusbar: false,\r\n " + " setup: function (ed) {\r\n ed.on(\'ini" + "t\', function () {\r\n $(ed.getWin()).blur(model" + ".updated);\r\n });\r\n }\r\n" + " });\r\n });\r\n \r" + "\n"); #line 645 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.Comments)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 649 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 651 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.Comments)); #line default #line hidden #line 651 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n\r\n\r\n"); #line 658 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 658 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.CanDelete) { #line default #line hidden #line 660 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLinkButton("Delete", MVC.API.DeviceBatch.Delete(Model.DeviceBatch.Id, true), "buttonDelete")); #line default #line hidden #line 660 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" "); #line 662 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.DeviceCount > 0) { if (Authorization.Has(Claims.Device.Actions.Export)) { #line default #line hidden #line 666 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLinkButton("Export Devices", MVC.API.DeviceBatch.ExportDevices(Model.DeviceBatch.Id))); #line default #line hidden #line 666 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } if (Authorization.Has(Claims.Device.Search)) { #line default #line hidden #line 670 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch"))); #line default #line hidden #line 670 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral("\r\n"); } } } #pragma warning restore 1591