#pragma warning disable 1591 //------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.18033 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace Disco.Web.Views.Device { 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.BI.Extensions; using Disco.Models.Repository; using Disco.Web; using Disco.Web.Extensions; [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] [System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/Show.cshtml")] public partial class Show : System.Web.Mvc.WebViewPage { public Show() { } public override void Execute() { #line 2 "..\..\Views\Device\Show.cshtml" ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), string.Format("{0} ({1})", Model.Device.ComputerName, Model.Device.SerialNumber)); Html.BundleDeferred("~/ClientScripts/Modules/Silverlight"); #line default #line hidden WriteLiteral("\r\n\r\n \r\n \r\n \r\n \r\n \r\n Computer Name:\r\n \r\n " + " \r\n"); #line 15 "..\..\Views\Device\Show.cshtml" #line default #line hidden #line 15 "..\..\Views\Device\Show.cshtml" if (string.IsNullOrWhiteSpace(Model.Device.ComputerName)) { #line default #line hidden WriteLiteral(" <Unknown/Not Allocated>\r\n"); #line 18 "..\..\Views\Device\Show.cshtml" } else { #line default #line hidden #line 21 "..\..\Views\Device\Show.cshtml" Write(Model.Device.ComputerName); #line default #line hidden #line 21 "..\..\Views\Device\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n " + " \r\n Asset Number:\r\n \r\n " + " \r\n"); WriteLiteral(" "); #line 30 "..\..\Views\Device\Show.cshtml" Write(Html.TextBoxFor(m => m.Device.AssetNumber)); #line default #line hidden WriteLiteral("\r\n"); WriteLiteral(" "); #line 31 "..\..\Views\Device\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden WriteLiteral("\r\n"); WriteLiteral(" "); #line 32 "..\..\Views\Device\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden WriteLiteral("\r\n $(function () { var $ajaxSave = $('#Device_AssetNumber').next('.ajaxSave'); $('#Device_AssetNumber').watermark('Asset Number').keydown(function (e) { $ajaxSave.show(); if (e.which == 13) { $(this).blur(); } }).change(function () { var $this = $(this); $ajaxSave.hide(); var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show(); var data = { AssetNumber: $this.val() }; $.getJSON('"); #line 46 "..\..\Views\Device\Show.cshtml" Write(Url.Action(@MVC.API.Device.UpdateAssetNumber(Model.Device.SerialNumber))); #line default #line hidden WriteLiteral(@"', data, function (response, result) { if (result != 'success' || response != 'OK') { alert('Unable to change Asset Number:\n' + response); $ajaxLoading.hide(); } else { $ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow'); } }); }).blur(function () { $ajaxSave.hide(); }).focus(function () { $(this).select(); }); }); \r\n Location:\r\n \r\n " + " \r\n"); WriteLiteral(" "); #line 68 "..\..\Views\Device\Show.cshtml" Write(Html.TextBoxFor(m => m.Device.Location)); #line default #line hidden WriteLiteral("\r\n"); WriteLiteral(" "); #line 69 "..\..\Views\Device\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden WriteLiteral("\r\n"); WriteLiteral(" "); #line 70 "..\..\Views\Device\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden WriteLiteral("\r\n $(function () { var $ajaxSave = $('#Device_Location').next('.ajaxSave'); $('#Device_Location').watermark('Location').keydown(function (e) { $ajaxSave.show(); if (e.which == 13) { $(this).blur(); } }).change(function () { var $this = $(this); $ajaxSave.hide(); var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show(); var data = { Location: $this.val() }; $.getJSON('"); #line 84 "..\..\Views\Device\Show.cshtml" Write(Url.Action(@MVC.API.Device.UpdateLocation(Model.Device.SerialNumber))); #line default #line hidden WriteLiteral(@"', data, function (response, result) { if (result != 'success' || response != 'OK') { alert('Unable to change Location:\n' + response); $ajaxLoading.hide(); } else { $ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow'); } }); }).blur(function () { $ajaxSave.hide(); }).focus(function () { $(this).select(); }); }); \r\n Batch:\r\n \r\n " + " \r\n"); WriteLiteral(" "); #line 106 "..\..\Views\Device\Show.cshtml" Write(Html.DropDownListFor(m => m.Device.DeviceBatchId, Model.DeviceBatches.ToSelectListItems(Model.Device.DeviceBatchId))); #line default #line hidden WriteLiteral("\r\n"); WriteLiteral(" "); #line 107 "..\..\Views\Device\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden WriteLiteral(" \r\n $(function () { var $DeviceBatchId = $('#Device_DeviceBatchId'); var $DeviceBatchDetails = $('#deviceBatchDetails'); var $DeviceBatchSummary = $('#deviceBatchSummary'); var initUpdate = false; var jsonDate = function (json, unknownValue) { if (json && json.indexOf('') == 0) { return $.datepicker.formatDate('yy-mm-dd', new Date(parseInt(json.substr(6, json.length - 8)))); } else return unknownValue; } var updateDetails = function (deviceBatchId) { $.getJSON('"); #line 121 "..\..\Views\Device\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.Index())); #line default #line hidden WriteLiteral("/\' + deviceBatchId, function (response, result) {\r\n " + " if (result == \'success\') {\r\n " + " if (response.Supplier)\r\n $Devic" + "eBatchSummary.find(\'.supplier\').text(response.Supplier);\r\n " + " else\r\n $Dev" + "iceBatchSummary.find(\'.supplier\').text(\'Unknown\');\r\n\r\n " + " $DeviceBatchSummary.find(\'.purchaseDate\').text(jsonDate(respon" + "se.PurchaseDate, \'Unknown\'));\r\n $Devi" + "ceBatchSummary.find(\'.warrantyValidUntil\').text(jsonDate(response.WarrantyValidU" + "ntil, \'Unknown\'));\r\n\r\n if (response.I" + "nsuranceSupplier)\r\n $DeviceBatchS" + "ummary.find(\'.insuranceSupplier\').text(response.InsuranceSupplier);\r\n " + " else\r\n " + " $DeviceBatchSummary.find(\'.insuranceSupplier\').text(\'Unknown\');\r\n\r\n " + " $DeviceBatchSummary.find(\'.insuredUntil\')." + "text(jsonDate(response.InsuredUntil, \'Unknown\'));\r\n\r\n " + " if (initUpdate){\r\n " + " $DeviceBatchSummary.show();\r\n " + "$DeviceBatchDetails.show();\r\n ini" + "tUpdate = false;\r\n }else{\r\n " + " $DeviceBatchSummary.slideDown(\'fast\');\r\n " + " $DeviceBatchDetails.fadeIn();\r\n " + " }\r\n " + " } else {\r\n alert(\'Unable to load " + "Device Batch details:\\n\' + response);\r\n }" + "\r\n });\r\n };\r\n " + " $DeviceBatchDetails.click(function () {\r\n " + " window.location.href = \'"); #line 152 "..\..\Views\Device\Show.cshtml" Write(Url.Action(MVC.Config.DeviceBatch.Index(null))); #line default #line hidden WriteLiteral(@"/' + $DeviceBatchId.val(); }); $DeviceBatchId.change(function () { var $this = $(this); var $ajaxLoading = $this.next('.ajaxLoading').show(); $DeviceBatchSummary.hide(); $DeviceBatchDetails.hide(); var data = { DeviceBatchId: $this.val() }; $.getJSON('"); #line 160 "..\..\Views\Device\Show.cshtml" Write(Url.Action(MVC.API.Device.UpdateDeviceBatchId(Model.Device.SerialNumber))); #line default #line hidden WriteLiteral(@"', data, function (response, result) { if (result != 'success' || response != 'OK') { alert('Unable to change Device Batch:\n' + response); $ajaxLoading.hide(); } else { $ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow'); if ($DeviceBatchId.val()) updateDetails($DeviceBatchId.val()); } }); }); $DeviceBatchSummary.hide(); if ($DeviceBatchId.val()){ initUpdate = true; updateDetails($DeviceBatchId.val()); } }); \r\n \r\n \r\n \r\n Purchased:\r\n " + " \r\n \r\n " + " \r\n Warranty:\r\n " + " \r\n \r\n " + " \r\n Insurance:\r\n " + " \r\n
\r\n " + " Supplier: \r\n
\r\n " + " On: \r\n
\r\n " + " Valid Until: \r\n \r\n " + " Supplier: \r\n
\r\n " + " Until:
\r\n Profile:\r\n \r\n " + " \r\n"); #line 213 "..\..\Views\Device\Show.cshtml" #line default #line hidden #line 213 "..\..\Views\Device\Show.cshtml" if (Model.Device.DecommissionedDate.HasValue) { #line default #line hidden #line 215 "..\..\Views\Device\Show.cshtml" Write(Model.Device.DeviceProfile.ToString()); #line default #line hidden #line 215 "..\..\Views\Device\Show.cshtml" } else { #line default #line hidden #line 219 "..\..\Views\Device\Show.cshtml" Write(Html.DropDownListFor(m => m.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.Device.DeviceProfile))); #line default #line hidden #line 219 "..\..\Views\Device\Show.cshtml" #line default #line hidden #line 220 "..\..\Views\Device\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden WriteLiteral("\r\n"); WriteLiteral(" $(function () { $('#Device_DeviceProfileId').change(function () { var $this = $(this); var $ajaxLoading = $this.next('.ajaxLoading').show(); var data = { DeviceProfileId: $this.val() }; $.getJSON('"); #line 227 "..\..\Views\Device\Show.cshtml" Write(Url.Action(MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber))); #line default #line hidden WriteLiteral(@"', data, function (response, result) { if (result != 'success' || response != 'OK') { alert('Unable to change Device Profile:\n' + response); $ajaxLoading.hide(); } else { $ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow'); } }); }); $('#deviceProfileDetails').click(function(){ window.location.href = '"); #line 237 "..\..\Views\Device\Show.cshtml" Write(Url.Action(MVC.Config.DeviceProfile.Index(null))); #line default #line hidden WriteLiteral("/\' + $(\'#Device_DeviceProfileId\').val();\r\n });" + "\r\n });\r\n \r\n"); #line 241 "..\..\Views\Device\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n " + " \r\n Created:\r\n \r\n " + " \r\n"); WriteLiteral(" "); #line 249 "..\..\Views\Device\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.Device.CreatedDate)); #line default #line hidden WriteLiteral("\r\n \r\n \r\n \r\n " + " \r\n Enrolment:\r\n \r\n " + " \r\n First:\r\n"); WriteLiteral(" "); #line 258 "..\..\Views\Device\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.Device.EnrolledDate)); #line default #line hidden WriteLiteral("\r\n"); #line 259 "..\..\Views\Device\Show.cshtml" #line default #line hidden #line 259 "..\..\Views\Device\Show.cshtml" if (Model.Device.AllowUnauthenticatedEnrol) { #line default #line hidden WriteLiteral(" (Url.Action(MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, "false", true)) #line default #line hidden , 15441), false) ); WriteLiteral(" title=\"Unauthenticated Enrolment is Allowed\""); WriteLiteral(">\r\n  \r\n"); #line 263 "..\..\Views\Device\Show.cshtml" } else { #line default #line hidden WriteLiteral(" (Url.Action(MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, "true", true)) #line default #line hidden , 15774), false) ); WriteLiteral(" title=\"Unauthenticated Enrolment is Blocked\""); WriteLiteral(">\r\n  \r\n"); #line 268 "..\..\Views\Device\Show.cshtml" } #line default #line hidden WriteLiteral("
\r\n Last:\r\n"); WriteLiteral(" "); #line 271 "..\..\Views\Device\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.Device.LastEnrolDate)); #line default #line hidden WriteLiteral("\r\n \r\n \r\n \r\n " + " \r\n Decommissioned:\r\n \r\n " + " \r\n"); WriteLiteral(" "); #line 279 "..\..\Views\Device\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.Device.DecommissionedDate)); #line default #line hidden WriteLiteral("\r\n \r\n \r\n \r\n " + " \r\n Last Network Logon:\r\n \r\n " + " \r\n "); #line 287 "..\..\Views\Device\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.Device.LastNetworkLogonDate)); #line default #line hidden WriteLiteral("\r\n"); #line 288 "..\..\Views\Device\Show.cshtml" #line default #line hidden #line 288 "..\..\Views\Device\Show.cshtml" if (!string.IsNullOrEmpty(Model.Device.ComputerName)) { #line default #line hidden WriteLiteral(" $(function () { var span = $('#lastNetworkLogonDate'); $('').addClass('ajaxHelperIcon ajaxLoading ajaxShowInitially').attr('title', 'Loading...').appendTo(span); $.getJSON('"); #line 295 "..\..\Views\Device\Show.cshtml" Write(Url.Action(MVC.API.Device.LastNetworkLogonDate(Model.Device.SerialNumber))); #line default #line hidden WriteLiteral(@"', function (response, result) { if (result != 'success') { alert('Unable to retrieve latest network logon date:\n' + response); $('').addClass('smallMessage').text('[may not be current]').appendTo(span); } else { span.find('.ajaxLoading').hide(); span.attr('title', response.Formatted).text(response.Friendly); } }); }); "); #line 306 "..\..\Views\Device\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n"); #line 309 "..\..\Views\Device\Show.cshtml" #line default #line hidden #line 309 "..\..\Views\Device\Show.cshtml" if (!Model.Device.DecommissionedDate.HasValue) { #line default #line hidden WriteLiteral(" \r\n \r\n Assigned User:\r\n \r\n " + " \r\n"); WriteLiteral(" "); #line 316 "..\..\Views\Device\Show.cshtml" Write(Html.TextBoxFor(m => m.Device.AssignedUser, new { userId = Model.Device.AssignedUserId })); #line default #line hidden WriteLiteral("\r\n"); WriteLiteral(" "); #line 317 "..\..\Views\Device\Show.cshtml" Write(AjaxHelpers.AjaxRemove()); #line default #line hidden WriteLiteral("\r\n"); WriteLiteral(" "); #line 318 "..\..\Views\Device\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden WriteLiteral("\r\n
\r\n Show Assignment\r\n History (
) No Assignment History Available
\r\n \r\n

\r\n \r\n Are you sure?

\r\n " + " \r\n $(function () { // Common Objects var $assignedUser = $('#Device_AssignedUser'); var $ajaxLoading = $assignedUser.nextAll('.ajaxLoading').first(); var $ajaxRemove = $assignedUser.nextAll('.ajaxRemove').first(); // Assign User $assignedUser .watermark('No Assigned User') .focus(function () { $assignedUser.select() }) .autocomplete({ source: '"); #line 340 "..\..\Views\Device\Show.cshtml" Write(Url.Action(MVC.API.User.UpstreamUsers())); #line default #line hidden WriteLiteral("\',\r\n minLength: 2,\r\n " + " focus: function (e, ui) {\r\n " + " $assignedUser.val(ui.item.DisplayName + \' (\' + ui.item.Id + \')\');\r\n " + " return false;\r\n " + " },\r\n select: function (e, " + "ui) {\r\n updateAssignedUser(ui.item.Id" + ");\r\n $assignedUser.val(ui.item.Displa" + "yName + \' (\' + ui.item.Id + \')\');\r\n r" + "eturn false;\r\n }\r\n " + " })\r\n .data(\'ui-autocomplete\')._r" + "enderItem = function (ul, item) {\r\n retur" + "n $(\"
  • \")\r\n .data(\"item.autoco" + "mplete\", item)\r\n .append(\"" + "\" + item.DisplayName + \"
    \" + item.Id + \" (\" + item.Type + \")
    \")\r\n" + " .appendTo(ul);\r\n " + " };\r\n\r\n var $dialogRemoveAssig" + "nedUser = $(\'#dialogRemoveAssignedUser\');\r\n $dial" + "ogRemoveAssignedUser.dialog({\r\n resizable: fa" + "lse,\r\n height: 140,\r\n " + " modal: true,\r\n autoOpen: false,\r\n" + " buttons: {\r\n " + " \"Remove\": function () {\r\n upd" + "ateAssignedUser(\'\');\r\n $assignedUser." + "val(\'\');\r\n $dialogRemoveAssignedUser." + "dialog(\"close\");\r\n },\r\n " + " \"Cancel\": function () {\r\n " + " $dialogRemoveAssignedUser.dialog(\"close\");\r\n " + " }\r\n }\r\n " + " });\r\n\r\n // Un-Assign User\r\n " + " if ($assignedUser.val() != \'\')\r\n " + " $ajaxRemove.show();\r\n $ajaxRemove.click(fu" + "nction () {\r\n $dialogRemoveAssignedUser.dialo" + "g(\'open\');\r\n return false;\r\n " + " });\r\n\r\n // History\r\n " + " var deviceUserAssignmentCount = "); #line 386 "..\..\Views\Device\Show.cshtml" Write(Model.Device.DeviceUserAssignments.Count); #line default #line hidden WriteLiteral(@"; if (deviceUserAssignmentCount > 0) { $('#Device_AssignedUser_History_Trigger').click(function () { $(this).hide(); $('#Device_AssignedUser_History_Host').show(); $('#Device_AssignedUser_History').slideDown('slow'); return false; }); var recordCountText = deviceUserAssignmentCount + ' record'; if (deviceUserAssignmentCount != 1) recordCountText += 's'; $('#Device_AssignedUser_History_RecordCount').text(recordCountText) } else { $('#Device_AssignedUser_History_Trigger').hide(); $('#Device_AssignedUser_History_None').show(); }; function updateAssignedUser(userId) { $ajaxLoading.show(); $ajaxRemove.hide(); var data = { AssignedUserId: userId }; $.getJSON('"); #line 408 "..\..\Views\Device\Show.cshtml" Write(Url.Action(MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber))); #line default #line hidden WriteLiteral(@"', data, function (response, result) { if (result != 'success' || response != 'OK') { alert('Unable to change Assigned User:\n' + response); $ajaxLoading.hide(); } else { $ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow'); if (userId != '') $ajaxRemove.fadeIn('fast'); } }); } }); "); #line 423 "..\..\Views\Device\Show.cshtml" } #line default #line hidden WriteLiteral(" (Model.Device.DecommissionedDate.HasValue ? "" : "display: none" #line default #line hidden , 25569), false) ); WriteLiteral(">\r\n \r\n (Model.Device.DecommissionedDate.HasValue ? "" : "display: none" #line default #line hidden , 25746), false) ); WriteLiteral(">\r\n

    \r\n Assigned Use" + "r History

    \r\n"); WriteLiteral(" "); #line 429 "..\..\Views\Device\Show.cshtml" Write(Html.Partial(MVC.Device.Views._DeviceUserAssignmentHistoryTable, Model.Device)); #line default #line hidden WriteLiteral("\r\n \r\n \r\n \r\n \r\n \r\n Generate Documents:\r\n \r\n " + " \r\n"); WriteLiteral(" "); #line 438 "..\..\Views\Device\Show.cshtml" Write(Html.DropDownList("DocumentTemplates", Model.DocumentTemplatesSelectListItems)); #line default #line hidden WriteLiteral("\r\n \r\n $(function () {\r\n v" + "ar generatePdfUrl = \'"); #line 441 "..\..\Views\Device\Show.cshtml" Write(Url.Action(MVC.API.Device.GeneratePdf(Model.Device.SerialNumber, null))); #line default #line hidden WriteLiteral(@"?DocumentTemplateId='; var $documentTemplates = $('#DocumentTemplates'); $documentTemplates.change(function () { var v = $documentTemplates.val(); if (v) { window.location.href = generatePdfUrl + v; $documentTemplates.val(''); } }); }); \r\n \r\n \r\n \r\n (Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash())) #line default #line hidden , 27473), false) ); WriteLiteral(" />\r\n

    \r\n (Url.Action(MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId)) #line default #line hidden , 27650), false) ); WriteLiteral(">"); #line 462 "..\..\Views\Device\Show.cshtml" Write(Model.Device.DeviceModel.ToString()); #line default #line hidden WriteLiteral("

    \r\n \r\n
    \r\n
    " + "\r\n \r\n \r\n\r\n

    \r\n Certificates

    \r\n"); #line 471 "..\..\Views\Device\Show.cshtml" Write(Html.Partial(MVC.Device.Views._CertificateTable, Model.Certificates)); #line default #line hidden WriteLiteral("\r\n

    \r\n Attachments

    \r\n"); #line 474 "..\..\Views\Device\Show.cshtml" Write(Html.Partial(MVC.Device.Views.DeviceParts.Resources, Model)); #line default #line hidden WriteLiteral("\r\n

    \r\n Jobs

    \r\n"); #line 477 "..\..\Views\Device\Show.cshtml" Write(Html.Partial(MVC.Shared.Views._JobTable, Model.Jobs)); #line default #line hidden WriteLiteral("\r\n"); #line 478 "..\..\Views\Device\Show.cshtml" Write(Html.Partial(MVC.Device.Views._DeviceActions, Model.Device)); #line default #line hidden WriteLiteral("\r\n"); } } } #pragma warning restore 1591