#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     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.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Disco.Web.Views.Device.DeviceParts
{
    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 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
    using Disco.Services.Users.UserFlags;
    
    #line default
    #line hidden
    using Disco.Services.Web;
    using Disco.Web;
    using Disco.Web.Extensions;
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
    [System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/DeviceParts/_Subject.cshtml")]
    public partial class _Subject : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.ShowModel>
    {
        public _Subject()
        {
        }
        public override void Execute()
        {
            
            #line 3 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
  
    Authorization.Require(Claims.Device.Show);

    Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");

            
            #line default
            #line hidden
WriteLiteral("\r\n<table");

WriteLiteral(" id=\"Device_Show_Subjects\"");

WriteLiteral(">\r\n    <tr>\r\n        <td");

WriteLiteral(" id=\"Device_Show_Details\"");

WriteLiteral(">\r\n            <div>\r\n                <div");

WriteLiteral(" id=\"Device_Show_Details_Asset\"");

WriteLiteral(">\r\n                    <table");

WriteLiteral(" class=\"none verticalHeadings\"");

WriteLiteral(">\r\n                        <tr>\r\n                            <td>\r\n              " +
"                  <span");

WriteLiteral(" title=\"Computer Name\"");

WriteLiteral(">Name:</span>\r\n                            </td>\r\n                            <td" +
">\r\n");

            
            #line 19 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 19 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (string.IsNullOrWhiteSpace(Model.Device.ComputerName))
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span");

WriteLiteral(" id=\"Device_Show_Details_Asset_NameUnknown\"");

WriteLiteral(" title=\"Computer Name\"");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">&lt;Unknown/None&gt;</span>\r\n");

            
            #line 22 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                }
                                else
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <h4");

WriteLiteral(" id=\"Device_Show_Details_Asset_Name\"");

WriteLiteral(" title=\"Computer Name\"");

WriteLiteral("><span data-clipboard>");

            
            #line 25 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                  Write(Model.Device.ComputerName);

            
            #line default
            #line hidden
WriteLiteral("</span></h4>\r\n");

            
            #line 26 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                        </tr>\r\n               " +
"         <tr>\r\n                            <td>\r\n                               " +
" <span");

WriteLiteral(" title=\"Domain Name\"");

WriteLiteral(">Domain:</span>\r\n                            </td>\r\n                            <" +
"td>\r\n");

            
            #line 34 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 34 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (string.IsNullOrWhiteSpace(Model.Device.ComputerDomainName))
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span");

WriteLiteral(" id=\"Device_Show_Details_Asset_DomainUnknown\"");

WriteLiteral(" title=\"Computer Domain\"");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">&lt;None&gt;</span>\r\n");

            
            #line 37 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                }
                                else
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <h4");

WriteLiteral(" id=\"Device_Show_Details_Asset_Domain\"");

WriteLiteral(" title=\"Computer Domain\"");

WriteLiteral("><span data-clipboard>");

            
            #line 40 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                      Write(Model.Device.ComputerDomainName);

            
            #line default
            #line hidden
WriteLiteral("</span></h4>\r\n");

            
            #line 41 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                        </tr>\r\n               " +
"         <tr>\r\n                            <td>Asset:</td>\r\n                    " +
"        <td>\r\n");

            
            #line 47 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 47 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (Authorization.Has(Claims.Device.Properties.AssetNumber))
                                {
                                    
            
            #line default
            #line hidden
            
            #line 49 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                               Write(Html.TextBoxFor(m => m.Device.AssetNumber, new { @class = "small discreet" }));

            
            #line default
            #line hidden
            
            #line 49 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                   
            
            #line default
            #line hidden
            
            #line 49 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                              Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 49 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                           
            
            #line default
            #line hidden
            
            #line 49 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                      Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 49 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                                    
                                }
                                else
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span");

WriteLiteral(" class=\"small discreet\"");

WriteLiteral(" data-clipboard>");

            
            #line 53 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                            Write(Model.Device.AssetNumber ?? "Unknown");

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n");

            
            #line 54 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                        </tr>\r\n               " +
"         <tr>\r\n                            <td>Location:</td>\r\n                 " +
"           <td>\r\n");

            
            #line 60 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 60 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (Authorization.Has(Claims.Device.Properties.Location))
                                {
                                    
            
            #line default
            #line hidden
            
            #line 62 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                               Write(Html.TextBoxFor(m => m.Device.Location, new { @class = "small discreet" }));

            
            #line default
            #line hidden
            
            #line 62 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                
            
            #line default
            #line hidden
            
            #line 62 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                           Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 62 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                        
            
            #line default
            #line hidden
            
            #line 62 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                   Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 62 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                                 
                                }
                                else
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span");

WriteLiteral(" class=\"small discreet\"");

WriteLiteral(" data-clipboard>");

            
            #line 66 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                            Write(Model.Device.Location ?? "Unknown");

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n");

            
            #line 67 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                        </tr>\r\n               " +
"     </table>\r\n");

            
            #line 71 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 71 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     if (Authorization.HasAny(Claims.Device.Properties.AssetNumber, Claims.Device.Properties.Location))
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <script>\r\n                            $(function () {\r\n");

            
            #line 75 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 75 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (Authorization.Has(Claims.Device.Properties.AssetNumber))
                                {
            
            #line default
            #line hidden
WriteLiteral("document.DiscoFunctions.PropertyChangeHelper($(\'#Device_AssetNumber\'), \'Unknown\'," +
" \'");

            
            #line 76 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                     Write(Url.Action(MVC.API.Device.UpdateAssetNumber(Model.Device.SerialNumber, null)));

            
            #line default
            #line hidden
WriteLiteral("\', \'AssetNumber\');");

            
            #line 76 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                                                                                                 }

            
            #line default
            #line hidden
WriteLiteral("                                ");

            
            #line 77 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (Authorization.Has(Claims.Device.Properties.Location))
                                {
            
            #line default
            #line hidden
WriteLiteral("document.DiscoFunctions.PropertyChangeHelper($(\'#Device_Location\'), \'Unknown\', \'");

            
            #line 78 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                  Write(Url.Action(MVC.API.Device.UpdateLocation(Model.Device.SerialNumber, null)));

            
            #line default
            #line hidden
WriteLiteral("\', \'Location\');");

            
            #line 78 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                                                                                        }

            
            #line default
            #line hidden
WriteLiteral("                            });\r\n                        </script>\r\n");

            
            #line 81 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </div>\r\n                <div");

WriteLiteral(" id=\"Device_Show_Details_Dates\"");

WriteLiteral(" class=\"status\"");

WriteLiteral(">\r\n                    <table");

WriteLiteral(" class=\"none verticalHeadings\"");

WriteLiteral(">\r\n                        <tr>\r\n                            <td>\r\n              " +
"                  Created:\r\n                            </td>\r\n                 " +
"           <td><span");

WriteLiteral(" id=\"Device_Show_Details_Dates_Created\"");

WriteLiteral(">");

            
            #line 89 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                        Write(CommonHelpers.FriendlyDate(Model.Device.CreatedDate));

            
            #line default
            #line hidden
WriteLiteral("</span></td>\r\n                        </tr>\r\n");

            
            #line 91 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 91 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                         if (Model.Device.DecommissionedDate.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <tr>\r\n                                <td>\r\n         " +
"                           Decommissioned:\r\n                                </td" +
">\r\n                                <td><span");

WriteLiteral(" id=\"Device_Show_Details_Dates_Decommissioned\"");

WriteLiteral(">");

            
            #line 97 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                   Write(CommonHelpers.FriendlyDate(Model.Device.DecommissionedDate));

            
            #line default
            #line hidden
WriteLiteral("</span></td>\r\n                            </tr>\r\n");

            
            #line 99 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("\r\n                        <tr>\r\n                            <td>\r\n               " +
"                 Enrolled:\r\n                            </td>\r\n                 " +
"           <td>\r\n");

            
            #line 106 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 106 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (Model.Device.EnrolledDate.HasValue)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    ");

WriteLiteral("First: ");

WriteLiteral("<span");

WriteLiteral(" id=\"Device_Show_Details_Asset_Enrolled_First\"");

WriteLiteral(">");

            
            #line 108 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                       Write(CommonHelpers.FriendlyDate(Model.Device.EnrolledDate));

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n");

            
            #line 109 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                    if (Model.Device.LastEnrolDate.HasValue && Model.Device.EnrolledDate.Value != Model.Device.LastEnrolDate.Value)
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <br />");

WriteLiteral("Last: ");

WriteLiteral("<span");

WriteLiteral(" id=\"Device_Show_Details_Asset_Enrolled_Last\"");

WriteLiteral(">");

            
            #line 111 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                               Write(CommonHelpers.FriendlyDate(Model.Device.LastEnrolDate));

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n");

            
            #line 112 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                    }
                                }
                                else
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span");

WriteLiteral(" id=\"Device_Show_Details_Asset_Enrolled_Never\"");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">Never</span>\r\n");

            
            #line 117 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                                ");

            
            #line 118 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (Model.Device.AllowUnauthenticatedEnrol)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span");

WriteLiteral(" id=\"Device_Show_Details_Asset_Enrolled_Trusted\"");

WriteLiteral(" title=\"Trusted Unauthenticated Enrolment is Allowed\"");

WriteLiteral("></span>\r\n");

            
            #line 121 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                        </tr>\r\n\r\n             " +
"       </table>\r\n                </div>\r\n                <div");

WriteLiteral(" id=\"Device_Show_Details_Status\"");

WriteLiteral(" class=\"status\"");

WriteLiteral(">\r\n                    <table");

WriteLiteral(" class=\"none verticalHeadings\"");

WriteLiteral(">\r\n                        <tr>\r\n                            <td>\r\n              " +
"                  <span");

WriteLiteral(" title=\"Last Network Logon Date\"");

WriteLiteral(">Last Seen:</span>\r\n                            </td>\r\n                          " +
"  <td>\r\n");

            
            #line 134 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 134 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                  
                                    string lastSeenClass = null;
                                    if (Model.Device.LastNetworkLogonDate.HasValue)
                                    {
                                        if (Model.Device.LastNetworkLogonDate.Value < DateTime.Now.AddDays(-30))
                                        {
                                            lastSeenClass = "error";
                                        }
                                        else
                                        {
                                            if (Model.Device.LastNetworkLogonDate.Value < DateTime.Now.AddDays(-7))
                                            {
                                                lastSeenClass = "alert";
                                            }
                                        }
                                    }
                                
            
            #line default
            #line hidden
WriteLiteral("\r\n                                <span");

WriteLiteral(" id=\"Device_Show_Details_Status_LastSeen\"");

WriteAttribute("class", Tuple.Create(" class=\"", 8548), Tuple.Create("\"", 8570)
            
            #line 151 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
      , Tuple.Create(Tuple.Create("", 8556), Tuple.Create<System.Object, System.Int32>(lastSeenClass
            
            #line default
            #line hidden
, 8556), false)
);

WriteLiteral(">");

            
            #line 151 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                 Write(CommonHelpers.FriendlyDate(Model.Device.LastNetworkLogonDate));

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n                            </td>\r\n");

            
            #line 153 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 153 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                             if (!string.IsNullOrEmpty(Model.Device.ComputerName))
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                                    $(function () {
                                        var updated = false;
                                        var span = $('#Device_Show_Details_Status_LastSeen');
                                        var spanProgress = null;

                                        $.getJSON('");

            
            #line 161 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                               Write(Url.Action(MVC.API.Device.LastNetworkLogonDate(Model.Device.SerialNumber)));

            
            #line default
            #line hidden
WriteLiteral("\', function (response, result) {\r\n                                            upd" +
"ated = true;\r\n                                            if (spanProgress)\r\n   " +
"                                             spanProgress.remove();\r\n\r\n         " +
"                                   if (result != \'success\') {\r\n                 " +
"                               alert(\'Unable to retrieve latest network logon da" +
"te:\\n\' + response);\r\n                                                $(\'<span>\')" +
".addClass(\'smallMessage\').text(\'[may not be current]\').appendTo(span);\r\n        " +
"                                    } else {\r\n                                  " +
"              var spanClasses = \'\',\r\n                                           " +
"         diff = moment().valueOf() - response.UnixEpoc;\r\n                       " +
"                         if (diff > 2592000000) // 30 Days\r\n                    " +
"                                spanClasses = \'error\';\r\n                        " +
"                        else if (diff > 604800000) // 7 Days\r\n                  " +
"                                  spanClasses = \'alert\';\r\n                      " +
"                          span.removeClass(\'alert error\').addClass(spanClasses)." +
"attr(\'title\', response.Formatted).text(response.Formatted).livestamp(response.Un" +
"ixEpoc);\r\n                                            }\r\n                       " +
"                 });\r\n                                        window.setTimeout(" +
"function () {\r\n                                            if (!updated) {\r\n    " +
"                                            spanProgress = $(\'<i>\').addClass(\'aj" +
"axLoading showInitially\').attr(\'title\', \'Loading...\').appendTo(span);\r\n         " +
"                                   }\r\n                                        }," +
" 250);\r\n                                    });\r\n                               " +
" </script>\r\n");

            
            #line 186 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </tr>\r\n                    </table>\r\n                </di" +
"v>\r\n                <div");

WriteLiteral(" class=\"status\"");

WriteLiteral(">\r\n");

            
            #line 191 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 191 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                      
                        var assignedUser = Model.Device.AssignedUser;
                    
            
            #line default
            #line hidden
WriteLiteral("\r\n                    <table");

WriteLiteral(" class=\"none verticalHeadings\"");

WriteLiteral(">\r\n                        <tr>\r\n                            <td>\r\n              " +
"                  Assignment:\r\n                            </td>\r\n              " +
"              <td>\r\n");

            
            #line 200 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 200 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (assignedUser != null)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <div");

WriteLiteral(" id=\"Device_Show_User\"");

WriteAttribute("class", Tuple.Create(" class=\"", 11783), Tuple.Create("\"", 11854)
, Tuple.Create(Tuple.Create("", 11791), Tuple.Create("clearfix", 11791), true)
            
            #line 202 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
, Tuple.Create(Tuple.Create(" ", 11799), Tuple.Create<System.Object, System.Int32>(Model.HasAssignedUserPhoto ? "hasPhoto" : "noPhoto"
            
            #line default
            #line hidden
, 11800), false)
);

WriteLiteral(">\r\n");

            
            #line 203 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                        
            
            #line default
            #line hidden
            
            #line 203 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                         if (Model.HasAssignedUserPhoto)
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            <div");

WriteLiteral(" id=\"Device_Show_User_Photo_Container\"");

WriteLiteral(">\r\n                                                <img");

WriteLiteral(" id=\"Device_Show_User_Photo\"");

WriteAttribute("src", Tuple.Create(" src=\"", 12144), Tuple.Create("\"", 12202)
            
            #line 206 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
     , Tuple.Create(Tuple.Create("", 12150), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.Photo(assignedUser.UserId))
            
            #line default
            #line hidden
, 12150), false)
);

WriteLiteral(" />\r\n                                            </div>\r\n");

            
            #line 208 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                        }

            
            #line default
            #line hidden
WriteLiteral("                                        <div");

WriteLiteral(" id=\"Device_Show_User_DisplayName\"");

WriteLiteral(" title=\"Display Name\"");

WriteLiteral(">\r\n                                            <span data-clipboard>\r\n");

            
            #line 211 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                
            
            #line default
            #line hidden
            
            #line 211 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                 if (Authorization.Has(Claims.User.Show))
                                                {
                                                    
            
            #line default
            #line hidden
            
            #line 213 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                               Write(Html.ActionLink(assignedUser.DisplayName, MVC.User.Show(assignedUser.UserId)));

            
            #line default
            #line hidden
            
            #line 213 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                  
                                                }
                                                else
                                                {
                                                    
            
            #line default
            #line hidden
            
            #line 217 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                               Write(assignedUser.DisplayName);

            
            #line default
            #line hidden
            
            #line 217 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                             
                                                }

            
            #line default
            #line hidden
WriteLiteral("                                            </span>\r\n                            " +
"            </div>\r\n                                        <div");

WriteLiteral(" id=\"Device_Show_User_Id\"");

WriteLiteral(" title=\"Id\"");

WriteLiteral("><span data-clipboard>");

            
            #line 221 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                 Write(assignedUser.FriendlyId());

            
            #line default
            #line hidden
WriteLiteral("</span></div>\r\n");

            
            #line 222 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                        
            
            #line default
            #line hidden
            
            #line 222 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                         if (Authorization.Has(Claims.User.ShowDetails))
                                        {
                                            if (!string.IsNullOrWhiteSpace(assignedUser.PhoneNumber))
                                            {

            
            #line default
            #line hidden
WriteLiteral("                                                <div");

WriteLiteral(" id=\"Device_Show_User_PhoneNumber\"");

WriteLiteral(" title=\"Phone Number\"");

WriteLiteral("><a");

WriteAttribute("href", Tuple.Create(" href=\"", 13669), Tuple.Create("\"", 13705)
, Tuple.Create(Tuple.Create("", 13676), Tuple.Create("tel:", 13676), true)
            
            #line 226 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                        , Tuple.Create(Tuple.Create("", 13680), Tuple.Create<System.Object, System.Int32>(assignedUser.PhoneNumber
            
            #line default
            #line hidden
, 13680), false)
);

WriteLiteral("  data-clipboard>");

            
            #line 226 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                               Write(assignedUser.PhoneNumber);

            
            #line default
            #line hidden
WriteLiteral("</a></div>\r\n");

            
            #line 227 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                            }
                                            if (!string.IsNullOrWhiteSpace(assignedUser.EmailAddress))
                                            {

            
            #line default
            #line hidden
WriteLiteral("                                                <div");

WriteLiteral(" id=\"Device_Show_User_EmailAddress\"");

WriteLiteral(" title=\"Email Address\"");

WriteLiteral("><a");

WriteAttribute("href", Tuple.Create(" href=\"", 14070), Tuple.Create("\"", 14125)
, Tuple.Create(Tuple.Create("", 14077), Tuple.Create("mailto:", 14077), true)
            
            #line 230 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                              , Tuple.Create(Tuple.Create("", 14084), Tuple.Create<System.Object, System.Int32>(Model.Device.AssignedUser.EmailAddress
            
            #line default
            #line hidden
, 14084), false)
);

WriteLiteral("  data-clipboard=\"");

            
            #line 230 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                                                     Write(assignedUser.DisplayName);

            
            #line default
            #line hidden
WriteLiteral(" &lt;");

            
            #line 230 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                                                                                   Write(assignedUser.EmailAddress);

            
            #line default
            #line hidden
WriteLiteral("&gt;\"");

WriteLiteral(">");

            
            #line 230 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                                                                                                                   Write(assignedUser.EmailAddress);

            
            #line default
            #line hidden
WriteLiteral("</a></div>\r\n");

            
            #line 231 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                            }
                                        }

            
            #line default
            #line hidden
WriteLiteral("                                        ");

            
            #line 233 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                         if (Authorization.Has(Claims.User.ShowFlagAssignments))
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            <div");

WriteLiteral(" id=\"Device_Show_User_Flags\"");

WriteLiteral(">\r\n");

            
            #line 236 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                
            
            #line default
            #line hidden
            
            #line 236 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                 foreach (var flag in assignedUser.UserFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, UserFlagService.GetUserFlag(f.UserFlagId))))
                                                {

            
            #line default
            #line hidden
WriteLiteral("                                                    <i");

WriteAttribute("class", Tuple.Create(" class=\"", 14872), Tuple.Create("\"", 14942)
, Tuple.Create(Tuple.Create("", 14880), Tuple.Create("flag", 14880), true)
, Tuple.Create(Tuple.Create(" ", 14884), Tuple.Create("fa", 14885), true)
, Tuple.Create(Tuple.Create(" ", 14887), Tuple.Create("fa-", 14888), true)
            
            #line 238 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
, Tuple.Create(Tuple.Create("", 14891), Tuple.Create<System.Object, System.Int32>(flag.Item2.Icon
            
            #line default
            #line hidden
, 14891), false)
, Tuple.Create(Tuple.Create(" ", 14909), Tuple.Create("fa-fw", 14910), true)
, Tuple.Create(Tuple.Create(" ", 14915), Tuple.Create("d-", 14916), true)
            
            #line 238 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    , Tuple.Create(Tuple.Create("", 14918), Tuple.Create<System.Object, System.Int32>(flag.Item2.IconColour
            
            #line default
            #line hidden
, 14918), false)
);

WriteLiteral(">\r\n                                                        <span");

WriteLiteral(" class=\"details\"");

WriteLiteral(">\r\n                                                            <span");

WriteLiteral(" class=\"name\"");

WriteLiteral(">");

            
            #line 240 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                          Write(flag.Item2.Name);

            
            #line default
            #line hidden
WriteLiteral("</span>");

            
            #line 240 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                       if (flag.Item1.Comments != null)
                                                            {
            
            #line default
            #line hidden
WriteLiteral("<span");

WriteLiteral(" class=\"comments\"");

WriteLiteral(">");

            
            #line 241 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                               Write(flag.Item1.Comments.ToHtmlComment());

            
            #line default
            #line hidden
WriteLiteral("</span>");

            
            #line 241 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                               }
            
            #line default
            #line hidden
WriteLiteral("<span");

WriteLiteral(" class=\"added\"");

WriteLiteral(">");

            
            #line 241 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                               Write(CommonHelpers.FriendlyDateAndUser(flag.Item1.AddedDate, flag.Item1.AddedUserId));

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n                                                        </span>\r\n       " +
"                                             </i>\r\n");

            
            #line 244 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                }

            
            #line default
            #line hidden
WriteLiteral("                                                <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(">\r\n                                                    $(function () {\r\n         " +
"                                               $(\'#Device_Show_User_Flags\')\r\n   " +
"                                                         .tooltip({\r\n           " +
"                                                     items: \'i.flag\',\r\n         " +
"                                                       content: function () {\r\n " +
"                                                                   var $this = $" +
"(this);\r\n                                                                    ret" +
"urn $this.children(\'.details\').html();\r\n                                        " +
"                        },\r\n                                                    " +
"            tooltipClass: \'FlagAssignment_Tooltip\',\r\n                           " +
"                                     position: {\r\n                              " +
"                                      my: \"right top\",\r\n                        " +
"                                            at: \"right bottom\",\r\n               " +
"                                                     collision: \"flipfit flip\"\r\n" +
"                                                                },\r\n            " +
"                                                    hade: {\r\n                   " +
"                                                 effect: \'\'\r\n                   " +
"                                             },\r\n                               " +
"                                 close: function (e, ui) {\r\n                    " +
"                                                ui.tooltip.hover(\r\n             " +
"                                                           function () {\r\n      " +
"                                                                      $(this).st" +
"op(true).fadeTo(100, 1);\r\n                                                      " +
"                  },\r\n                                                          " +
"              function () {\r\n                                                   " +
"                         $(this).fadeOut(100, function () { $(this).remove(); })" +
";\r\n                                                                        });\r\n" +
"                                                                }\r\n             " +
"                                               });\r\n                            " +
"                        });\r\n                                                </s" +
"cript>\r\n                                            </div>\r\n");

            
            #line 276 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                        }

            
            #line default
            #line hidden
WriteLiteral("                                        ");

            
            #line 277 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                         if (Model.AssignedUserDetails != null && Model.AssignedUserDetails.Count(d => !d.Key.EndsWith("&")) > 0)
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            <div");

WriteLiteral(" id=\"Device_Show_User_CustomDetails\"");

WriteLiteral(" class=\"status clearfix\"");

WriteLiteral(">\r\n");

            
            #line 280 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                
            
            #line default
            #line hidden
            
            #line 280 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                 foreach (var detail in Model.AssignedUserDetails.Where(d => !d.Key.EndsWith("&")))
                                                {

            
            #line default
            #line hidden
WriteLiteral("                                                    <div>\r\n                      " +
"                                  <strong>");

            
            #line 283 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                           Write(detail.Key.TrimEnd('*'));

            
            #line default
            #line hidden
WriteLiteral(":</strong>\r\n");

            
            #line 284 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                        
            
            #line default
            #line hidden
            
            #line 284 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                         if (detail.Key.EndsWith("*"))
                                                        {

            
            #line default
            #line hidden
WriteLiteral("                                                            <a");

WriteLiteral(" href=\"\"");

WriteLiteral(" class=\"reveal smallMessage\"");

WriteLiteral(">[reveal]</a>\r\n");

WriteLiteral("                                                            <span");

WriteLiteral(" class=\"reveal hidden\"");

WriteLiteral(">");

            
            #line 287 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                   Write(Html.Partial(MVC.Shared.Views._CustomDetailValueRender, detail));

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n");

            
            #line 288 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                        }
                                                        else
                                                        {
                                                            
            
            #line default
            #line hidden
            
            #line 291 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                       Write(Html.Partial(MVC.Shared.Views._CustomDetailValueRender, detail));

            
            #line default
            #line hidden
            
            #line 291 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                            
                                                        }

            
            #line default
            #line hidden
WriteLiteral("                                                    </div>\r\n");

            
            #line 294 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                }

            
            #line default
            #line hidden
WriteLiteral("                                                <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                                                    $(() => {
                                                        $('#Device_Show_User_CustomDetails').on('click', 'a.reveal', e => {
                                                            e.preventDefault();
                                                            const t = $(e.currentTarget);
                                                            t.next('span.reveal').removeClass('hidden');
                                                            t.remove();
                                                            return false;
                                                        })
                                                    });
                                                </script>
                                            </div>
");

            
            #line 307 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                        }

            
            #line default
            #line hidden
WriteLiteral("                                    </div>\r\n");

            
            #line 309 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                }
                                else
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">Not Assigned</span>\r\n");

            
            #line 313 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n                        </tr>\r\n               " +
"     </table>\r\n                </div>\r\n");

            
            #line 318 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                
            
            #line default
            #line hidden
            
            #line 318 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                 if (Authorization.Has(Claims.Device.Actions.GenerateDocuments))
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div");

WriteLiteral(" id=\"Device_Show_GenerateDocument_Container\"");

WriteLiteral(" class=\"status\"");

WriteLiteral(">\r\n");

WriteLiteral("                        ");

            
            #line 321 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                   Write(Html.Partial(MVC.Shared.Views._GenerateDocumentControl, Model.GenerateDocumentControlModel));

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </div>\r\n");

            
            #line 323 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </div>\r\n        </td>\r\n        <td");

WriteLiteral(" id=\"Device_Show_Policies\"");

WriteLiteral(" rowspan=\"2\"");

WriteLiteral(">\r\n            <div>\r\n                <div");

WriteLiteral(" id=\"Device_Show_Policies_Profile\"");

WriteLiteral(">\r\n                    <h2");

WriteLiteral(" title=\"Device Profile\"");

WriteLiteral(">\r\n");

            
            #line 330 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 330 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                         if (Authorization.Has(Claims.Config.DeviceProfile.Show))
                        {
                            
            
            #line default
            #line hidden
            
            #line 332 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                       Write(Html.ActionLink(Model.Device.DeviceProfile.Name, MVC.Config.DeviceProfile.Index(Model.Device.DeviceProfileId)));

            
            #line default
            #line hidden
            
            #line 332 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                           
                        }
                        else
                        {
                            
            
            #line default
            #line hidden
            
            #line 336 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                       Write(Model.Device.DeviceProfile.Name);

            
            #line default
            #line hidden
            
            #line 336 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                            
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </h2>\r\n                    <table");

WriteLiteral(" class=\"none verticalHeadings\"");

WriteLiteral(">\r\n                        <tr>\r\n                            <td>\r\n              " +
"                  <span");

WriteLiteral(" title=\"Distribution Type\"");

WriteLiteral(">Distribution:</span>\r\n                            </td>\r\n                       " +
"     <td>\r\n");

WriteLiteral("                                ");

            
            #line 345 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                           Write(Model.Device.DeviceProfile.DistributionType.ToString());

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </td>\r\n                        </tr>\r\n             " +
"           <tr>\r\n                            <td>\r\n                             " +
"   <span");

WriteLiteral(" title=\"Address\"");

WriteLiteral(">Address:</span>\r\n                            </td>\r\n                            " +
"<td>\r\n");

            
            #line 353 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 353 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                  
                                    if (Model.DeviceProfileDefaultOrganisationAddress != null)
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <span");

WriteLiteral(" id=\"Device_Show_Policies_Profile_Address\"");

WriteLiteral(">");

            
            #line 356 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                   Write(Model.DeviceProfileDefaultOrganisationAddress.Name);

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n");

            
            #line 357 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                    }
                                    else
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <span");

WriteLiteral(" id=\"Device_Show_Policies_Profile_Address_None\"");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">None</span>\r\n");

            
            #line 361 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                    }
                                
            
            #line default
            #line hidden
WriteLiteral("\r\n                            </td>\r\n                        </tr>\r\n             " +
"           <tr>\r\n                            <td>\r\n                             " +
"   <span");

WriteLiteral(" title=\"Provision Active Directory Account\"");

WriteLiteral(">Provision Account:</span>\r\n                            </td>\r\n                  " +
"          <td>\r\n");

WriteLiteral("                                ");

            
            #line 370 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            Write(Model.Device.DeviceProfile.ProvisionADAccount ? "Active Directory" : "No");

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </td>\r\n                        </tr>\r\n             " +
"           <tr>\r\n                            <td>\r\n                             " +
"   <span");

WriteLiteral(" title=\"Provisioned Personal Certificates\"");

WriteLiteral(">Certificates:</span>\r\n                            </td>\r\n                       " +
"     <td>\r\n");

WriteLiteral("                                ");

            
            #line 378 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            Write(Model.DeviceProfileCertificateProviders != null ? string.Join(", ", Model.DeviceProfileCertificateProviders.Select(c => c.Name)) : "None Provisioned");

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </td>\r\n                        <tr>\r\n              " +
"              <td>\r\n                                <span");

WriteLiteral(" title=\"Provisioned Wireless Profiles\"");

WriteLiteral(">Wireless Profiles:</span>\r\n                            </td>\r\n                  " +
"          <td>\r\n");

WriteLiteral("                                ");

            
            #line 385 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            Write(Model.DeviceProfileWirelessProfileProviders != null ? string.Join(", ", Model.DeviceProfileWirelessProfileProviders.Select(c => c.Name)) : "None Provisioned");

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </td>\r\n                        </tr>\r\n             " +
"       </table>\r\n");

            
            #line 389 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 389 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     if (Model.Device.CanUpdateDeviceProfile())
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <button");

WriteLiteral(" id=\"Device_Show_Policies_Profile_Actions_Update_Button\"");

WriteLiteral(" class=\"button small\"");

WriteLiteral(">Update Profile</button>\r\n");

            
            #line 392 "..\..\Views\Device\DeviceParts\_Subject.cshtml"


            
            #line default
            #line hidden
WriteLiteral("                        <div");

WriteLiteral(" id=\"Device_Show_Policies_Profile_Actions_Update_Dialog\"");

WriteLiteral(" class=\"dialog\"");

WriteLiteral(" title=\"Assign to Device Profile\"");

WriteLiteral(">\r\n");

            
            #line 394 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 394 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                             using (Html.BeginForm(MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber, redirect: true)))
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <div");

WriteLiteral(" class=\"profile-list\"");

WriteLiteral(">\r\n");

WriteLiteral("                                    ");

            
            #line 397 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                               Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
WriteLiteral("\r\n                                    <ul");

WriteLiteral(" class=\"none\"");

WriteLiteral(">\r\n");

            
            #line 399 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                        
            
            #line default
            #line hidden
            
            #line 399 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                         foreach (var dp in Model.DeviceProfiles.OrderBy(i => i.Name))
                                        {
                                            var isDecommissioned = Model.DecommissionedDeviceProfileIds.Contains(dp.Id);

            
            #line default
            #line hidden
WriteLiteral("                                            <li");

WriteAttribute("class", Tuple.Create(" class=\"", 25828), Tuple.Create("\"", 25873)
            
            #line 402 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
, Tuple.Create(Tuple.Create("", 25836), Tuple.Create<System.Object, System.Int32>(isDecommissioned ? "hidden" : null
            
            #line default
            #line hidden
, 25836), false)
);

WriteLiteral(">\r\n                                                <label");

WriteAttribute("title", Tuple.Create(" title=\"", 25931), Tuple.Create("\"", 25975)
, Tuple.Create(Tuple.Create("", 25939), Tuple.Create("Distribution:", 25939), true)
            
            #line 403 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
, Tuple.Create(Tuple.Create(" ", 25952), Tuple.Create<System.Object, System.Int32>(dp.DistributionType
            
            #line default
            #line hidden
, 25953), false)
);

WriteLiteral(">\r\n                                                    <input");

WriteLiteral(" type=\"radio\"");

WriteLiteral(" name=\"DeviceProfileId\"");

WriteAttribute("value", Tuple.Create(" value=\"", 26073), Tuple.Create("\"", 26087)
            
            #line 404 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     , Tuple.Create(Tuple.Create("", 26081), Tuple.Create<System.Object, System.Int32>(dp.Id
            
            #line default
            #line hidden
, 26081), false)
);

WriteLiteral(" data-ouenforced=\"");

            
            #line 404 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                          Write(dp.EnforceOrganisationalUnit);

            
            #line default
            #line hidden
WriteLiteral("\"");

WriteLiteral(" ");

            
            #line 404 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                          Write(Model.Device.DeviceProfileId == dp.Id ? "checked " : null);

            
            #line default
            #line hidden
WriteLiteral(" />\r\n");

WriteLiteral("                                                    ");

            
            #line 405 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                               Write(dp.Name);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                                </label>\r\n                     " +
"                       </li>\r\n");

            
            #line 408 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                            if (isDecommissioned)
                                            {

            
            #line default
            #line hidden
WriteLiteral("                                                <li");

WriteLiteral(" class=\"hidden decommissioned-padding\"");

WriteLiteral("></li>\r\n");

            
            #line 411 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                            }
                                        }

            
            #line default
            #line hidden
WriteLiteral("                                    </ul>\r\n");

            
            #line 414 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 414 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                     if (Model.DecommissionedDeviceProfileIds.Count > 0)
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <a");

WriteLiteral(" class=\"button small show-decommissioned\"");

WriteLiteral(" href=\"#\"");

WriteLiteral(">Show Decommissioned</a>\r\n");

            
            #line 417 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                </div>\r\n");

WriteLiteral("                                <div");

WriteLiteral(" class=\"enforce-ou\"");

WriteLiteral(">\r\n                                    <input");

WriteLiteral(" id=\"deviceProfileMoveOrganisationalUnit\"");

WriteLiteral(" type=\"checkbox\"");

WriteLiteral(" name=\"enforceOrganisationalUnit\"");

WriteLiteral(" value=\"true\"");

WriteLiteral(" /><label");

WriteLiteral(" for=\"deviceProfileMoveOrganisationalUnit\"");

WriteLiteral(">Move to Profiles Organisational Unit</label>\r\n                                </" +
"div>\r\n");

            
            #line 422 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </div>\r\n");

WriteLiteral("                        <script>\r\n                            $(function () {\r\n  " +
"                              var currentProfile = \'");

            
            #line 426 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                  Write(Model.Device.DeviceProfileId);

            
            #line default
            #line hidden
WriteLiteral("\';\r\n                                var button = $(\'#Device_Show_Policies_Profile" +
"_Actions_Update_Button\');\r\n                                var buttonDialog = nu" +
"ll;\r\n                                var dialogInputs = null;\r\n                 " +
"               var dialogContainers = null;\r\n\r\n                                b" +
"utton.click(function (e) {\r\n                                    e.preventDefault" +
"();\r\n\r\n                                    if (!buttonDialog) {\r\n               " +
"                         buttonDialog = $(\'#Device_Show_Policies_Profile_Actions" +
"_Update_Dialog\')\r\n                                                            .d" +
"ialog({\r\n                                                                resizab" +
"le: false,\r\n                                                                moda" +
"l: true,\r\n                                                                maxHei" +
"ght: 450,\r\n                                                                autoO" +
"pen: false,\r\n                                                                but" +
"tons: {\r\n                                                                    \"Up" +
"date Profile\": function () {\r\n                                                  " +
"                      var deviceProfileId = dialogInputs.filter(\':checked\').val(" +
");\r\n                                                                        if (" +
"deviceProfileId) {\r\n                                                            " +
"                var $this = $(this);\r\n                                          " +
"                                  $this.dialog(\"disable\");\r\n                    " +
"                                                        $this.dialog(\"option\", \"" +
"buttons\", null);\r\n                                                              " +
"              $this.find(\'form\').submit();\r\n                                    " +
"                                    } else {\r\n                                  " +
"                                          alert(\'A device profile must be select" +
"ed\');\r\n                                                                        }" +
"\r\n                                                                    },\r\n      " +
"                                                              Cancel: function (" +
") {\r\n                                                                        $(t" +
"his).dialog(\"close\");\r\n                                                         " +
"           }\r\n                                                                }\r" +
"\n                                                            });\r\n              " +
"                          dialogInputs = buttonDialog.find(\'input[type=\"radio\"]\'" +
");\r\n                                        dialogContainers = dialogInputs.clos" +
"est(\'li\');\r\n\r\n                                        dialogInputs.change(functi" +
"on () {\r\n                                            const $this = $(this);\r\n   " +
"                                         dialogContainers.removeClass(\'selected\'" +
");\r\n\r\n                                            $this.closest(\'li\').addClass(\'" +
"selected\');\r\n                                            $(\'#deviceProfileMoveOr" +
"ganisationalUnit\').prop(\'checked\', $this.attr(\'data-ouenforced\') === \'True\');\r\n " +
"                                       });\r\n                                    " +
"    buttonDialog.find(\'.show-decommissioned\')\r\n                                 " +
"           .click(function (e) {\r\n                                              " +
"  e.preventDefault();\r\n                                                var $this" +
" = $(this);\r\n                                                buttonDialog.find(\'" +
"ul.none\')\r\n                                                    .find(\'li.hidden\'" +
").removeClass(\'hidden\')\r\n                                                    .fi" +
"lter(\'.decommissioned-padding\').remove();\r\n                                     " +
"           $this.remove();\r\n                                                retu" +
"rn false;\r\n                                            })\r\n                     " +
"               }\r\n\r\n                                    dialogInputs.filter(\'[da" +
"ta-deviceprofileid=\' + currentProfile + \']\').prop(\'checked\', true).change();\r\n\r\n" +
"                                    buttonDialog.dialog(\'open\');\r\n              " +
"                      return false;\r\n                                });\r\n\r\n    " +
"                        });\r\n                        </script>\r\n");

            
            #line 489 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </div>\r\n                <div");

WriteLiteral(" id=\"Device_Show_Policies_Batch\"");

WriteLiteral(" class=\"status\"");

WriteLiteral(">\r\n");

            
            #line 492 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 492 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     if (Model.Device.DeviceBatchId.HasValue)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <h2");

WriteLiteral(" title=\"Device Batch\"");

WriteLiteral(">\r\n");

            
            #line 495 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 495 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                             if (Authorization.Has(Claims.Config.DeviceBatch.Show))
                            {
                                
            
            #line default
            #line hidden
            
            #line 497 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                           Write(Html.ActionLink(Model.Device.DeviceBatch.Name, MVC.Config.DeviceBatch.Index(Model.Device.DeviceBatchId.Value)));

            
            #line default
            #line hidden
            
            #line 497 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                               
                            }
                            else
                            {
                                
            
            #line default
            #line hidden
            
            #line 501 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                           Write(Model.Device.DeviceBatch.Name);

            
            #line default
            #line hidden
            
            #line 501 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                              
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </h2>\r\n");

WriteLiteral("                        <table");

WriteLiteral(" class=\"none verticalHeadings\"");

WriteLiteral(">\r\n                            <tr>\r\n                                <td>\r\n      " +
"                              <span");

WriteLiteral(" title=\"Purchased Date\"");

WriteLiteral(">Purchased:</span>\r\n                                </td>\r\n                      " +
"          <td>\r\n");

WriteLiteral("                                    ");

            
            #line 510 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                               Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.PurchaseDate));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </td>\r\n                            </tr>\r\n     " +
"                       <tr>\r\n                                <td>\r\n             " +
"                       <span");

WriteLiteral(" title=\"Supplier\"");

WriteLiteral(">Supplier:</span>\r\n                                </td>\r\n                       " +
"         <td>\r\n");

WriteLiteral("                                    ");

            
            #line 518 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                Write(Model.Device.DeviceBatch.Supplier ?? "Unknown");

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </td>\r\n                            </tr>\r\n     " +
"                       <tr>\r\n                                <td>\r\n             " +
"                       <span");

WriteLiteral(" title=\"Warranty Valid Until\"");

WriteLiteral(">Warranty Until:</span>\r\n                                </td>\r\n                 " +
"               <td");

WriteAttribute("class", Tuple.Create(" class=\"", 33835), Tuple.Create("\"", 33983)
            
            #line 525 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
, Tuple.Create(Tuple.Create("", 33843), Tuple.Create<System.Object, System.Int32>(Model.Device.DeviceBatch.WarrantyValidUntil.HasValue && Model.Device.DeviceBatch.WarrantyValidUntil.Value < DateTime.Now ? "alert" : null
            
            #line default
            #line hidden
, 33843), false)
);

WriteLiteral(">\r\n");

WriteLiteral("                                    ");

            
            #line 526 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                               Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.WarrantyValidUntil, "Unknown", null));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </td>\r\n                            </tr>\r\n     " +
"                       <tr>\r\n                                <td>\r\n             " +
"                       <span");

WriteLiteral(" title=\"Insurance Supplier\"");

WriteLiteral(">Insurance Supplier:</span>\r\n                                </td>\r\n             " +
"                   <td>\r\n");

WriteLiteral("                                    ");

            
            #line 534 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                Write(Model.Device.DeviceBatch.InsuranceSupplier ?? "Unknown");

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </td>\r\n                            </tr>\r\n     " +
"                       <tr>\r\n                                <td>\r\n             " +
"                       <span");

WriteLiteral(" title=\"Insured Until\"");

WriteLiteral(">Insured Until:</span>\r\n                                </td>\r\n                  " +
"              <td");

WriteAttribute("class", Tuple.Create(" class=\"", 34837), Tuple.Create("\"", 34973)
            
            #line 541 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
, Tuple.Create(Tuple.Create("", 34845), Tuple.Create<System.Object, System.Int32>(Model.Device.DeviceBatch.InsuredUntil.HasValue && Model.Device.DeviceBatch.InsuredUntil.Value < DateTime.Now ? "alert" : null
            
            #line default
            #line hidden
, 34845), false)
);

WriteLiteral(">\r\n");

WriteLiteral("                                    ");

            
            #line 542 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                               Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.InsuredUntil, "Unknown", null));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </td>\r\n                            </tr>\r\n     " +
"                   </table>\r\n");

            
            #line 546 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <h2>Batch: <em>Not Associated</em></h2>\r\n");

            
            #line 550 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                    ");

            
            #line 551 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     if (Model.Device.CanUpdateDeviceBatch())
                    {
                        
            
            #line default
            #line hidden
            
            #line 553 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                   Write(Html.ActionLinkSmallButton("Update Batch", MVC.API.Device.UpdateDeviceBatchId(Model.Device.SerialNumber, null, true), "Device_Show_Policies_Batch_Actions_Update_Button"));

            
            #line default
            #line hidden
            
            #line 553 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                                                                  


            
            #line default
            #line hidden
WriteLiteral("                        <div");

WriteLiteral(" id=\"Device_Show_Policies_Batch_Actions_Update_Dialog\"");

WriteLiteral(" class=\"dialog\"");

WriteLiteral(" title=\"Assign to Device Batch\"");

WriteLiteral(">\r\n                            <div>\r\n                                <ul");

WriteLiteral(" class=\"none\"");

WriteLiteral(">\r\n");

            
            #line 558 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 558 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                     foreach (var db in Model.DeviceBatches.OrderBy(i => i.Name))
                                    {
                                        var isDecommissioned = Model.DecommissionedDeviceBatchIds.Contains(db.Id);

            
            #line default
            #line hidden
WriteLiteral("                                        <li");

WriteAttribute("class", Tuple.Create(" class=\"", 36164), Tuple.Create("\"", 36209)
            
            #line 561 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
, Tuple.Create(Tuple.Create("", 36172), Tuple.Create<System.Object, System.Int32>(isDecommissioned ? "hidden" : null
            
            #line default
            #line hidden
, 36172), false)
);

WriteLiteral(">\r\n                                            <label");

WriteAttribute("title", Tuple.Create(" title=\"", 36263), Tuple.Create("\"", 36319)
, Tuple.Create(Tuple.Create("", 36271), Tuple.Create("Purchased:", 36271), true)
            
            #line 562 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
, Tuple.Create(Tuple.Create(" ", 36281), Tuple.Create<System.Object, System.Int32>(db.PurchaseDate.ToLongDateString()
            
            #line default
            #line hidden
, 36282), false)
);

WriteLiteral(">\r\n                                                <input");

WriteLiteral(" type=\"radio\"");

WriteLiteral(" data-devicebatchid=\"");

            
            #line 563 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                   Write(db.Id);

            
            #line default
            #line hidden
WriteLiteral("\"");

WriteLiteral(" name=\"DeviceBatch\"");

WriteLiteral(" />\r\n");

WriteLiteral("                                                ");

            
            #line 564 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                           Write(db.Name);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                            </label>\r\n                         " +
"               </li>\r\n");

            
            #line 567 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                        if (isDecommissioned)
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            <li");

WriteLiteral(" class=\"hidden decommissioned-padding\"");

WriteLiteral("></li>\r\n");

            
            #line 570 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                        }
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                </ul>\r\n");

            
            #line 573 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 573 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (Model.DecommissionedDeviceBatchIds.Count > 0)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <a");

WriteLiteral(" class=\"button small show-decommissioned\"");

WriteLiteral(" href=\"#\"");

WriteLiteral(">Show Decommissioned</a>\r\n");

            
            #line 576 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </div>\r\n                        </div>\r\n");

WriteLiteral("                        <script>\r\n                            $(function () {\r\n  " +
"                              var currentBatch = \'");

            
            #line 581 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                Write(Model.Device.DeviceBatchId);

            
            #line default
            #line hidden
WriteLiteral("\';\r\n                                var button = $(\'#Device_Show_Policies_Batch_A" +
"ctions_Update_Button\');\r\n                                var buttonDialog = null" +
";\r\n                                var dialogInputs = null;\r\n                   " +
"             var dialogContainers = null;\r\n\r\n                                but" +
"ton.click(function () {\r\n\r\n                                    if (!buttonDialog" +
") {\r\n                                        buttonDialog = $(\'#Device_Show_Poli" +
"cies_Batch_Actions_Update_Dialog\')\r\n                                            " +
"                .dialog({\r\n                                                     " +
"           resizable: false,\r\n                                                  " +
"              modal: true,\r\n                                                    " +
"            maxHeight: 450,\r\n                                                   " +
"             autoOpen: false,\r\n                                                 " +
"               buttons: {\r\n                                                     " +
"               \"Update Batch\": function () {\r\n                                  " +
"                                      var deviceBatchId = dialogInputs.filter(\':" +
"checked\').attr(\'data-devicebatchid\');\r\n\r\n                                       " +
"                                 if (deviceBatchId) {\r\n                         " +
"                                                   var $this = $(this);\r\n       " +
"                                                                     $this.dialo" +
"g(\"disable\");\r\n                                                                 " +
"           $this.dialog(\"option\", \"buttons\", null);\r\n                           " +
"                                                 window.location.href = button.a" +
"ttr(\'href\') + \'&DeviceBatchId=\' + deviceBatchId;\r\n                              " +
"                                          } else {\r\n                            " +
"                                                alert(\'A device batch must be se" +
"lected\');\r\n                                                                     " +
"   }\r\n                                                                    },\r\n  " +
"                                                                  Cancel: functi" +
"on () {\r\n                                                                       " +
" $(this).dialog(\"close\");\r\n                                                     " +
"               }\r\n                                                              " +
"  }\r\n                                                            });\r\n          " +
"                              dialogInputs = buttonDialog.find(\'input\');\r\n      " +
"                                  dialogContainers = dialogInputs.closest(\'li\');" +
"\r\n\r\n                                        dialogInputs.change(function () {\r\n " +
"                                           dialogContainers.removeClass(\'selecte" +
"d\');\r\n                                            $(this).closest(\'li\').addClass" +
"(\'selected\');\r\n                                        });\r\n                    " +
"                    buttonDialog.find(\'.show-decommissioned\')\r\n                 " +
"                           .click(function (e) {\r\n                              " +
"                  e.preventDefault();\r\n                                         " +
"       var $this = $(this);\r\n                                                but" +
"tonDialog.find(\'ul.none\')\r\n                                                    ." +
"find(\'li.hidden\').removeClass(\'hidden\')\r\n                                       " +
"             .filter(\'.decommissioned-padding\').remove();\r\n                     " +
"                           $this.remove();\r\n                                    " +
"            return false;\r\n                                            })\r\n     " +
"                               }\r\n\r\n                                    if (!!cu" +
"rrentBatch) {\r\n                                        dialogInputs.filter(\'[dat" +
"a-devicebatchid=\' + currentBatch + \']\').prop(\'checked\', true).change();\r\n       " +
"                             }\r\n\r\n                                    buttonDial" +
"og.dialog(\'open\');\r\n                                    return false;\r\n         " +
"                       });\r\n\r\n                            });\r\n                 " +
"       </script>\r\n");

            
            #line 643 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </div>\r\n            </div>\r\n        </td>\r\n        <td");

WriteLiteral(" id=\"Device_Show_Aspects\"");

WriteLiteral(" rowspan=\"2\"");

WriteLiteral(">\r\n            <div>\r\n                <div");

WriteLiteral(" id=\"Device_Show_Aspects_Model\"");

WriteLiteral(" class=\"clearfix\"");

WriteLiteral(">\r\n                    <h2");

WriteLiteral(" id=\"Device_Show_Aspects_Model_Description\"");

WriteLiteral(" title=\"Model Description\"");

WriteLiteral(">\r\n");

            
            #line 651 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 651 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                         if (Authorization.Has(Claims.Config.DeviceModel.Show))
                        {
                            
            
            #line default
            #line hidden
            
            #line 653 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                       Write(Html.ActionLink(Model.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId)));

            
            #line default
            #line hidden
            
            #line 653 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                           
                        }
                        else
                        {
                            
            
            #line default
            #line hidden
            
            #line 657 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                       Write(Model.Device.DeviceModel.ToString());

            
            #line default
            #line hidden
            
            #line 657 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </h2>\r\n                    <img");

WriteLiteral(" id=\"Device_Show_Aspects_Model_Image\"");

WriteLiteral(" alt=\"Model Image\"");

WriteAttribute("src", Tuple.Create(" src=\"", 42526), Tuple.Create("\"", 42636)
            
            #line 660 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
    , Tuple.Create(Tuple.Create("", 42532), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))
            
            #line default
            #line hidden
, 42532), false)
);

WriteLiteral(" />\r\n                </div>\r\n            </div>\r\n        </td>\r\n    </tr>\r\n    <t" +
"r");

WriteLiteral(" id=\"Device_Show_Subjects_Actions\"");

WriteLiteral(">\r\n        <td");

WriteLiteral(" id=\"Device_Show_Device_Actions\"");

WriteLiteral(">\r\n");

            
            #line 667 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            
            
            #line default
            #line hidden
            
            #line 667 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanCreateJob())
            {
                Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
                
            
            #line default
            #line hidden
            
            #line 670 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
           Write(Html.ActionLinkSmallButton("Create Job", MVC.Job.Create(Model.Device.SerialNumber, Model.Device.AssignedUserId), "buttonCreateJob"));

            
            #line default
            #line hidden
            
            #line 670 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                    
            }

            
            #line default
            #line hidden
WriteLiteral("            ");

            
            #line 672 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanUpdateAssignment())
            {

            
            #line default
            #line hidden
WriteLiteral("                <a");

WriteLiteral(" id=\"Device_Show_User_Actions_Assign_Button\"");

WriteLiteral(" href=\"#\"");

WriteLiteral(" class=\"button small\"");

WriteLiteral(">Update Assignment</a>\r\n");

WriteLiteral("                <div");

WriteLiteral(" id=\"Device_Show_User_Actions_Assign_Dialog\"");

WriteLiteral(" class=\"dialog\"");

WriteLiteral(" title=\"Assign this Device?\"");

WriteLiteral(">\r\n                    <h4><i");

WriteLiteral(" class=\"fa fa-info-circle information\"");

WriteLiteral("></i>&nbsp;Assign to User:</h4>\r\n                    <br />\r\n");

            
            #line 678 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 678 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     using (Html.BeginForm(MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber, redirect: true)))
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <input");

WriteLiteral(" id=\"Device_Show_User_Actions_Assign_UserId\"");

WriteLiteral(" name=\"AssignedUserId\"");

WriteLiteral(" type=\"text\"");

WriteLiteral(" />\r\n");

            
            #line 681 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </div>\r\n");

WriteLiteral("                <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                    $(function () {
                        var button = $('#Device_Show_User_Actions_Assign_Button');
                        var buttonDialog = null;
                        var inputUserId = null;

                        var dialogButtons = {
");

            
            #line 690 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 690 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                              
                    if (assignedUser != null)
                    {

            
            #line default
            #line hidden
WriteLiteral("                                                        ");

WriteLiteral(@"
                            ""Unassign"": function () {
                                var $this = $(this);
                                $this.dialog(""disable"");
                                $this.dialog(""option"", ""buttons"", null);

                                inputUserId.val('');
                                inputUserId.closest('form').submit()
                            },
                            ");

WriteLiteral("\r\n");

            
            #line 703 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    }
                                                
            
            #line default
            #line hidden
WriteLiteral("\r\n                            \"Assign\": function () {\r\n                          " +
"      var $this = $(this);\r\n                                var userId = inputUs" +
"erId.val();\r\n                                if (userId) {\r\n                    " +
"                $this.dialog(\"disable\");\r\n                                    $t" +
"his.dialog(\"option\", \"buttons\", null);\r\n                                    inpu" +
"tUserId.closest(\'form\').submit()\r\n                                } else {\r\n    " +
"                                alert(\'Enter a user to assign this device\');\r\n  " +
"                              }\r\n                            },\r\n               " +
"             Cancel: function () {\r\n                                $(this).dial" +
"og(\"close\");\r\n                            }\r\n                        }\r\n\r\n      " +
"                  button.click(function () {\r\n                            if (!b" +
"uttonDialog) {\r\n                                buttonDialog = $(\'#Device_Show_U" +
"ser_Actions_Assign_Dialog\')\r\n                                                   " +
" .dialog({\r\n                                                        resizable: f" +
"alse,\r\n                                                        height: 180,\r\n   " +
"                                                     modal: true,\r\n             " +
"                                           autoOpen: false,\r\n                   " +
"                                     buttons: dialogButtons\r\n                   " +
"                                 });\r\n                                inputUserI" +
"d = $(\'#Device_Show_User_Actions_Assign_UserId\');\r\n                             " +
"   inputUserId.focus(function () { inputUserId.select() })\r\n                    " +
"                .autocomplete({\r\n                                        source:" +
" \'");

            
            #line 734 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                             Write(Url.Action(MVC.API.Search.UsersUpstream()));

            
            #line default
            #line hidden
WriteLiteral(@"',
                                        minLength: 2,
                                        select: function (e, ui) {
                                            inputUserId.val(ui.item.Id);
                                            return false;
                                        }
                                    });
                                inputUserId.data('ui-autocomplete')._renderItem = function (ul, item) {
                                    return $(""<li>"")
                                        .data(""item.autocomplete"", item)
                                        .append(""<a><strong>"" + item.DisplayName + ""</strong><br>"" + item.Id + "" ("" + item.Type + "")</a>"")
                                        .appendTo(ul);
                                };
                            }
                            buttonDialog.dialog('open');
                            inputUserId.focus();
                            return false;
                        });

                    });
                </script>
");

            
            #line 755 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("            ");

            
            #line 756 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanAddDeviceFlags() && Model.AvailableDeviceFlags != null && Model.AvailableDeviceFlags.Count > 0)
            {
                
            
            #line default
            #line hidden
            
            #line 758 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
           Write(Html.ActionLinkSmallButton("Add Flag", MVC.API.DeviceFlagAssignment.AddDevice(), "Device_Show_Details_Actions_AddFlag_Button"));

            
            #line default
            #line hidden
            
            #line 758 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                               

            
            #line default
            #line hidden
WriteLiteral("                <div");

WriteLiteral(" id=\"Device_Show_Details_Actions_AddFlag_Dialog\"");

WriteLiteral(" class=\"dialog\"");

WriteLiteral(" title=\"Add Device Flag\"");

WriteLiteral(">\r\n");

            
            #line 760 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 760 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     using (Html.BeginForm(MVC.API.DeviceFlagAssignment.AddDevice()))
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <input");

WriteLiteral(" id=\"Device_Show_Details_Actions_AddFlag_Dialog_Id\"");

WriteLiteral(" type=\"hidden\"");

WriteLiteral(" name=\"id\"");

WriteLiteral(" />\r\n");

WriteLiteral("                        <input");

WriteLiteral(" id=\"Device_Show_Details_Actions_AddFlag_Dialog_DeviceSerialNumber\"");

WriteLiteral(" type=\"hidden\"");

WriteLiteral(" name=\"DeviceSerialNumber\"");

WriteAttribute("value", Tuple.Create(" value=\"", 48484), Tuple.Create("\"", 48518)
            
            #line 763 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                , Tuple.Create(Tuple.Create("", 48492), Tuple.Create<System.Object, System.Int32>(Model.Device.SerialNumber
            
            #line default
            #line hidden
, 48492), false)
);

WriteLiteral(" />\r\n");

WriteLiteral("                        <div");

WriteLiteral(" class=\"flagPicker\"");

WriteLiteral(">\r\n");

            
            #line 765 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 765 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                             foreach (var flag in Model.AvailableDeviceFlags.OrderBy(jq => jq.Name))
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <div");

WriteLiteral(" class=\"flag\"");

WriteLiteral(" data-flagid=\"");

            
            #line 767 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                           Write(flag.Id);

            
            #line default
            #line hidden
WriteLiteral("\"");

WriteLiteral(">\r\n                                    <i");

WriteAttribute("class", Tuple.Create(" class=\"", 48822), Tuple.Create("\"", 48881)
, Tuple.Create(Tuple.Create("", 48830), Tuple.Create("fa", 48830), true)
, Tuple.Create(Tuple.Create(" ", 48832), Tuple.Create("fa-", 48833), true)
            
            #line 768 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
, Tuple.Create(Tuple.Create("", 48836), Tuple.Create<System.Object, System.Int32>(flag.Icon
            
            #line default
            #line hidden
, 48836), false)
, Tuple.Create(Tuple.Create(" ", 48848), Tuple.Create("fa-fw", 48849), true)
, Tuple.Create(Tuple.Create(" ", 48854), Tuple.Create("fa-lg", 48855), true)
, Tuple.Create(Tuple.Create(" ", 48860), Tuple.Create("d-", 48861), true)
            
            #line 768 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
, Tuple.Create(Tuple.Create("", 48863), Tuple.Create<System.Object, System.Int32>(flag.IconColour
            
            #line default
            #line hidden
, 48863), false)
);

WriteLiteral("></i>");

            
            #line 768 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                  Write(flag.Name);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </div>\r\n");

            
            #line 770 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </div>\r\n");

WriteLiteral("                        <div");

WriteLiteral(" class=\"details\"");

WriteLiteral(">\r\n                            <div>\r\n                                <h4>Comment" +
"s</h4>\r\n                                <textarea");

WriteLiteral(" name=\"Comments\"");

WriteLiteral(" id=\"Device_Show_Details_Actions_AddFlag_Dialog_Comments\"");

WriteLiteral("></textarea>\r\n                            </div>\r\n                        </div>\r" +
"\n");

            
            #line 778 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </div>\r\n");

WriteLiteral("                <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(">\r\n                    $(function () {\r\n                        var button = $(\'#" +
"Device_Show_Details_Actions_AddFlag_Button\');\r\n                        var butto" +
"nDialog = null;\r\n                        var buttonLink = button.attr(\'href\');\r\n" +
"\r\n                        var flagPicker = null;\r\n                        var fl" +
"agAddId = null;\r\n                        var flagAddComments = null;\r\n          " +
"              var details = null;\r\n\r\n                        function flagSelect" +
"ed() {\r\n                            var flag = $(this);\r\n\r\n                     " +
"       flagPicker.children().removeClass(\'selected\');\r\n                         " +
"   flag.addClass(\'selected\');\r\n\r\n                            flagAddId.val(flag." +
"attr(\'data-flagid\'));\r\n\r\n                            details.show();\r\n\r\n        " +
"                    flagAddComments.focus().select();\r\n                        }" +
"\r\n\r\n                        button.attr(\'href\', \'#\').click(function (e) {\r\n     " +
"                       e.preventDefault();\r\n\r\n                            if (!b" +
"uttonDialog) {\r\n                                buttonDialog = $(\'#Device_Show_D" +
"etails_Actions_AddFlag_Dialog\');\r\n                                buttonDialog.d" +
"ialog({\r\n                                    width: 600,\r\n                      " +
"              height: 410,\r\n                                    resizable: false" +
",\r\n                                    modal: true,\r\n                           " +
"         autoOpen: false,\r\n                                    buttons: {\r\n     " +
"                                   Cancel: function () {\r\n                      " +
"                      $(this).dialog(\"close\");\r\n                                " +
"        },\r\n                                        \"Add Flag\": function () {\r\n " +
"                                           if (!!flagAddId.val()) {\r\n           " +
"                                     var $this = $(this);\r\n                     " +
"                           $this.dialog(\"disable\");\r\n                           " +
"                     $this.dialog(\"option\", \"buttons\", null);\r\n                 " +
"                               buttonDialog.find(\'form\').submit();\r\n            " +
"                                } else {\r\n                                      " +
"          alert(\'Select a Device Flag\');\r\n                                      " +
"      }\r\n                                        }\r\n                            " +
"        }\r\n                                });\r\n\r\n                              " +
"  flagAddId = $(\'#Device_Show_Details_Actions_AddFlag_Dialog_Id\');\r\n            " +
"                    flagAddComments = buttonDialog.find(\'#Device_Show_Details_Ac" +
"tions_AddFlag_Dialog_Comments\');\r\n                                flagPicker = b" +
"uttonDialog.find(\'.flagPicker\');\r\n                                details = butt" +
"onDialog.find(\'.details\');\r\n\r\n                                flagPicker.on(\'cli" +
"ck\', \'div.flag\', flagSelected);\r\n                            }\r\n\r\n              " +
"              buttonDialog.dialog(\'open\');\r\n                            return f" +
"alse;\r\n                        });\r\n                    });\r\n                </s" +
"cript>\r\n");

            
            #line 845 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("            ");

            
            #line 846 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanUpdateTrustEnrol())
            {
                
            
            #line default
            #line hidden
            
            #line 848 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
           Write(Html.ActionLinkSmallButton("Trust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, true.ToString(), true), "Device_Show_Device_Actions_TrustEnrol_Button"));

            
            #line default
            #line hidden
            
            #line 848 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                                                                            

            
            #line default
            #line hidden
WriteLiteral("                <div");

WriteLiteral(" id=\"Device_Show_Device_Actions_TrustEnrol_Dialog\"");

WriteLiteral(" class=\"dialog\"");

WriteLiteral(" title=\"Trust this Device?\"");

WriteLiteral(@">
                    <p>
                        Devices flagged as 'trusted' are allowed a single-use device enrolment without providing authentication (for example: Active Directory Computer Account).
                    </p>
                    <p>
                        Once a device enrols, its trust setting is reset and additional enrolments need to be authenticated (domain joined) or manually trusted again.
                    </p>
                    <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(" style=\"margin-top: 1em;\"");

WriteLiteral(">\r\n                        <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(" style=\"margin-bottom: 1em;\"");

WriteLiteral(">\r\n                            <i");

WriteLiteral(" class=\"fa fa-exclamation-triangle\"");

WriteLiteral("></i>This action will allow a device <em>claiming</em> to have the Serial Number " +
"\'");

            
            #line 858 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                               Write(Model.Device.SerialNumber);

            
            #line default
            #line hidden
WriteLiteral(@"' to be enrolled without authentication.
                        </p>
                        <div>
                            <strong>Are you sure you want to allow an unauthenticated enrolment?</strong>
                        </div>
                    </div>
                </div>
");

WriteLiteral("                <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(">\r\n                    $(function () {\r\n                        var button = $(\'#" +
"Device_Show_Device_Actions_TrustEnrol_Button\');\r\n                        var but" +
"tonDialog;\r\n                        button.click(function () {\r\n                " +
"            if (!buttonDialog) {\r\n                                var buttonLink" +
" = button.attr(\'href\');\r\n                                button.attr(\'href\', \'#\'" +
");\r\n                                buttonDialog = $(\'#Device_Show_Device_Action" +
"s_TrustEnrol_Dialog\').dialog({\r\n                                    resizable: f" +
"alse,\r\n                                    width: 400,\r\n                        " +
"            modal: true,\r\n                                    autoOpen: false,\r\n" +
"                                    buttons: {\r\n                                " +
"        \"Trust\": function () {\r\n                                            var " +
"$this = $(this);\r\n                                            $this.dialog(\"disa" +
"ble\");\r\n                                            $this.dialog(\"option\", \"butt" +
"ons\", null);\r\n                                            window.location.href =" +
" buttonLink;\r\n                                        },\r\n                      " +
"                  Cancel: function () {\r\n                                       " +
"     $(this).dialog(\"close\");\r\n                                        }\r\n      " +
"                              }\r\n                                });\r\n          " +
"                  }\r\n\r\n                            buttonDialog.dialog(\'open\');\r" +
"\n\r\n                            return false;\r\n                        });\r\n     " +
"               });\r\n                </script>\r\n");

            
            #line 898 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("            ");

            
            #line 899 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanUpdateUntrustEnrol())
            {
                
            
            #line default
            #line hidden
            
            #line 901 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
           Write(Html.ActionLinkSmallButton("Untrust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, false.ToString(), true), "Device_Show_Device_Actions_UntrustEnrol_Button"));

            
            #line default
            #line hidden
            
            #line 901 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                                                                                 

            
            #line default
            #line hidden
WriteLiteral("                <div");

WriteLiteral(" id=\"Device_Show_Device_Actions_UntrustEnrol_Dialog\"");

WriteLiteral(" title=\"Untrust this Device?\"");

WriteLiteral(">\r\n                    <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                        <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(" style=\"margin-bottom: 1em;\"");

WriteLiteral(">\r\n                            <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral(@"></i>This action will require the device to enrol with authentication (for example: domain joined).
                        </p>
                        <div>
                            <strong>Are you sure you want to require an authenticated enrolment?</strong>
                        </div>
                    </div>
                </div>
");

WriteLiteral("                <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                    $(function () {
                        var button = $('#Device_Show_Device_Actions_UntrustEnrol_Button');
                        var buttonDialog = $('#Device_Show_Device_Actions_UntrustEnrol_Dialog');
                        var buttonLink = button.attr('href');
                        button.attr('href', '#');
                        button.click(function () {
                            buttonDialog.dialog('open');
                            return false;
                        });
                        buttonDialog.dialog({
                            resizable: false,
                            width: 400,
                            modal: true,
                            autoOpen: false,
                            buttons: {
                                ""Untrust"": function () {
                                    var $this = $(this);
                                    $this.dialog(""disable"");
                                    $this.dialog(""option"", ""buttons"", null);
                                    window.location.href = buttonLink;
                                },
                                Cancel: function () {
                                    $(this).dialog(""close"");
                                }
                            }
                        });
                    });
                </script>
");

            
            #line 941 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("            ");

            
            #line 942 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanDecommission())
            {
                
            
            #line default
            #line hidden
            
            #line 944 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
           Write(Html.ActionLinkSmallButton("Decommission", MVC.API.Device.Decommission(), "Device_Show_Device_Actions_Decommission_Button"));

            
            #line default
            #line hidden
            
            #line 944 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                            

            
            #line default
            #line hidden
WriteLiteral("                <div");

WriteLiteral(" id=\"Device_Show_Device_Actions_Decommission_Dialog\"");

WriteLiteral(" class=\"dialog\"");

WriteLiteral(" title=\"Device Decommissioning\"");

WriteLiteral(">\r\n                    <div");

WriteLiteral(" class=\"clearfix\"");

WriteLiteral(" style=\"margin-bottom: 10px;\"");

WriteLiteral(">\r\n                        <i");

WriteLiteral(" class=\"fa fa-question-circle fa-lg information\"");

WriteLiteral("></i>&nbsp;Why is this device to be decommissioned?\r\n                    </div>\r\n" +
"                    <div>\r\n                        <ul");

WriteLiteral(" class=\"none\"");

WriteLiteral(">\r\n");

            
            #line 951 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 951 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                             foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)).Cast<DecommissionReasons>().OrderBy(r => r.ToString()))
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <li>\r\n                                    <input");

WriteLiteral(" type=\"radio\"");

WriteAttribute("id", Tuple.Create(" id=\"", 59042), Tuple.Create("\"", 59120)
, Tuple.Create(Tuple.Create("", 59047), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 59047), true)
            
            #line 954 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                           , Tuple.Create(Tuple.Create("", 59094), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
            
            #line default
            #line hidden
, 59094), false)
);

WriteLiteral("\r\n                                           name=\"Device_Show_Device_Actions_Dec" +
"ommission_Reason\"");

WriteAttribute("value", Tuple.Create(" value=\"", 59219), Tuple.Create("\"", 59253)
            
            #line 955 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                        , Tuple.Create(Tuple.Create("", 59227), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
            
            #line default
            #line hidden
, 59227), false)
);

WriteLiteral(" ");

            
            #line 955 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                Write((decommissionReason == DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty);

            
            #line default
            #line hidden
WriteLiteral(" />\r\n                                    <label");

WriteAttribute("for", Tuple.Create(" for=\"", 59397), Tuple.Create("\"", 59476)
, Tuple.Create(Tuple.Create("", 59403), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 59403), true)
            
            #line 956 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
               , Tuple.Create(Tuple.Create("", 59450), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
            
            #line default
            #line hidden
, 59450), false)
);

WriteLiteral(">");

            
            #line 956 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                       Write(decommissionReason.ReasonMessage());

            
            #line default
            #line hidden
WriteLiteral("</label>\r\n                                </li>\r\n");

            
            #line 958 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </ul>\r\n                    </div>\r\n                </div>" +
"\r\n");

WriteLiteral("                <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(">\r\n                    $(function () {\r\n                        var button = $(\'#" +
"Device_Show_Device_Actions_Decommission_Button\');\r\n                        var b" +
"uttonDialog = null;\r\n                        var deviceSerialNumber = \'");

            
            #line 966 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                              Write(Model.Device.SerialNumber);

            
            #line default
            #line hidden
WriteLiteral("\';\r\n\r\n                        button.click(function () {\r\n\r\n                     " +
"       if (!buttonDialog) {\r\n                                buttonDialog = $(\'#" +
"Device_Show_Device_Actions_Decommission_Dialog\')\r\n                              " +
"                      .dialog({\r\n                                               " +
"         resizable: false,\r\n                                                    " +
"    modal: true,\r\n                                                        autoOp" +
"en: false,\r\n                                                        buttons: {\r\n" +
"                                                            \"Decommission\": func" +
"tion () {\r\n\r\n                                                                var" +
" reasonId = buttonDialog.find(\'input:checked\').val();\r\n\r\n                       " +
"                                         var $this = $(this);\r\n                 " +
"                                               $this.dialog(\"disable\");\r\n       " +
"                                                         $this.dialog(\"option\", " +
"\"buttons\", null);\r\n\r\n                                                           " +
"     var url = button.attr(\'href\') + \'/\' + deviceSerialNumber + \'?Reason=\' + rea" +
"sonId + \'&redirect=True\';\r\n\r\n                                                   " +
"             window.location.href = url;\r\n                                      " +
"                      },\r\n                                                      " +
"      Cancel: function () {\r\n                                                   " +
"             $(this).dialog(\"close\");\r\n                                         " +
"                   }\r\n                                                        }\r" +
"\n                                                    });\r\n                      " +
"      }\r\n\r\n                            buttonDialog.dialog(\'open\');\r\n           " +
"                 return false;\r\n                        });\r\n\r\n                 " +
"   });\r\n                </script>\r\n");

            
            #line 1002 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("            ");

            
            #line 1003 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanRecommission())
            {
                
            
            #line default
            #line hidden
            
            #line 1005 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
           Write(Html.ActionLinkSmallButton("Recommission", MVC.API.Device.Recommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Recommission_Button"));

            
            #line default
            #line hidden
            
            #line 1005 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                                           

            
            #line default
            #line hidden
WriteLiteral("                <div");

WriteLiteral(" id=\"Device_Show_Device_Actions_Recommission_Dialog\"");

WriteLiteral(" title=\"Recommission this Device?\"");

WriteLiteral(">\r\n                    <p>\r\n                        <i");

WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");

WriteLiteral("></i>&nbsp;Are you sure?\r\n                    </p>\r\n                </div>\r\n");

WriteLiteral("                <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                    $(function () {
                        var button = $('#Device_Show_Device_Actions_Recommission_Button');
                        var buttonDialog = $('#Device_Show_Device_Actions_Recommission_Dialog');
                        var buttonLink = button.attr('href');
                        button.attr('href', '#');
                        button.click(function () {
                            buttonDialog.dialog('open');
                            return false;
                        });
                        buttonDialog.dialog({
                            resizable: false,
                            height: 140,
                            modal: true,
                            autoOpen: false,
                            buttons: {
                                ""Recommission"": function () {
                                    var $this = $(this);
                                    $this.dialog(""disable"");
                                    $this.dialog(""option"", ""buttons"", null);
                                    window.location.href = buttonLink;
                                },
                                Cancel: function () {
                                    $(this).dialog(""close"");
                                }
                            }
                        });
                    });
                </script>
");

            
            #line 1040 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("            ");

            
            #line 1041 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanDelete())
            {
                
            
            #line default
            #line hidden
            
            #line 1043 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
           Write(Html.ActionLinkSmallButton("Delete Device", MVC.API.Device.Delete(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Delete_Button"));

            
            #line default
            #line hidden
            
            #line 1043 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                                

            
            #line default
            #line hidden
WriteLiteral("                <div");

WriteLiteral(" id=\"Device_Show_Device_Actions_Delete_Dialog\"");

WriteLiteral(" title=\"Delete this Device?\"");

WriteLiteral(">\r\n                    <p>\r\n                        <i");

WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");

WriteLiteral(@"></i>&nbsp;
                        This item will be permanently deleted and cannot be recovered.<br />
                        Jobs linked to this Device (but not to a User) will be deleted also.<br />
                        Are you sure?
                    </p>
                </div>
");

WriteLiteral("                <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                    $(function () {
                        var button = $('#Device_Show_Device_Actions_Delete_Button');
                        var buttonDialog = $('#Device_Show_Device_Actions_Delete_Dialog');
                        var buttonLink = button.attr('href');
                        button.attr('href', '#');
                        button.click(function () {
                            buttonDialog.dialog('open');
                            return false;
                        });
                        buttonDialog.dialog({
                            resizable: false,
                            height: 200,
                            modal: true,
                            autoOpen: false,
                            buttons: {
                                ""Delete"": function () {
                                    var $this = $(this);
                                    $this.dialog(""disable"");
                                    $this.dialog(""option"", ""buttons"", null);
                                    window.location.href = buttonLink;
                                },
                                Cancel: function () {
                                    $(this).dialog(""close"");
                                }
                            }
                        });
                    });
                </script>
");

            
            #line 1081 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </td>\r\n    </tr>\r\n</table>\r\n");

        }
    }
}
#pragma warning restore 1591
