#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.34014
//
//     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.BI.Extensions;
    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><span");

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

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

            
            #line 17 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (string.IsNullOrWhiteSpace(Model.Device.DeviceDomainId))
                                {

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

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

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

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

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

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

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

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

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

WriteLiteral(">");

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

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

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

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

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

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

            
            #line 30 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (string.IsNullOrWhiteSpace(Model.Device.DeviceDomainId))
                                {

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

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

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

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

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

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

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

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

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

WriteLiteral(">");

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

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

            
            #line 37 "..\..\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 43 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 43 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (Authorization.Has(Claims.Device.Properties.AssetNumber))
                                {
                                    
            
            #line default
            #line hidden
            
            #line 45 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                               Write(Html.TextBoxFor(m => m.Device.AssetNumber, new { @class = "small discreet" }));

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

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

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

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

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

WriteLiteral(">");

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

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

            
            #line 50 "..\..\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 56 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 56 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (Authorization.Has(Claims.Device.Properties.Location))
                                {
                                    
            
            #line default
            #line hidden
            
            #line 58 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                               Write(Html.TextBoxFor(m => m.Device.Location, new { @class = "small discreet" }));

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

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

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

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

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

WriteLiteral(">");

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

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

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

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

            
            #line 67 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 67 "..\..\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 71 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 71 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                 if (Authorization.Has(Claims.Device.Properties.AssetNumber))
                                {
            
            #line default
            #line hidden
WriteLiteral("document.DiscoFunctions.PropertyChangeHelper($(\'#Device_AssetNumber\'), \'Unknown\'," +
" \'");

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

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

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

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

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

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

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

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

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

            
            #line 77 "..\..\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>Created:\r\n      " +
"                      </td>\r\n                            <td><span");

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

WriteLiteral(">");

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

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

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

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

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

WriteLiteral(">");

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

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

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

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

            
            #line 99 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 99 "..\..\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 101 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                       Write(CommonHelpers.FriendlyDate(Model.Device.EnrolledDate));

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

            
            #line 102 "..\..\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 104 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                           Write(CommonHelpers.FriendlyDate(Model.Device.LastEnrolDate));

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

            
            #line 105 "..\..\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 110 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                }

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

            
            #line 111 "..\..\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 114 "..\..\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><span");

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

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

            
            #line 125 "..\..\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=\"", 8092), Tuple.Create("\"", 8114)
            
            #line 142 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
      , Tuple.Create(Tuple.Create("", 8100), Tuple.Create<System.Object, System.Int32>(lastSeenClass
            
            #line default
            #line hidden
, 8100), false)
);

WriteLiteral(">");

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

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

            
            #line 143 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 143 "..\..\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 151 "..\..\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 176 "..\..\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 181 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 181 "..\..\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>Assignment:\r\n   " +
"                         </td>\r\n                            <td>\r\n");

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

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

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

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

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

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

WriteLiteral(">\r\n");

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

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

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

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

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

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

WriteLiteral(">");

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

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

            
            #line 203 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                        
            
            #line default
            #line hidden
            
            #line 203 "..\..\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(">");

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

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

            
            #line 208 "..\..\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=\"", 12785), Tuple.Create("\"", 12840)
, Tuple.Create(Tuple.Create("", 12792), Tuple.Create("mailto:", 12792), true)
            
            #line 211 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                          , Tuple.Create(Tuple.Create("", 12799), Tuple.Create<System.Object, System.Int32>(Model.Device.AssignedUser.EmailAddress
            
            #line default
            #line hidden
, 12799), false)
);

WriteLiteral(">");

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

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

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

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

            
            #line 214 "..\..\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 217 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                
            
            #line default
            #line hidden
            
            #line 217 "..\..\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=\"", 13508), Tuple.Create("\"", 13578)
, Tuple.Create(Tuple.Create("", 13516), Tuple.Create("flag", 13516), true)
, Tuple.Create(Tuple.Create(" ", 13520), Tuple.Create("fa", 13521), true)
, Tuple.Create(Tuple.Create(" ", 13523), Tuple.Create("fa-", 13524), true)
            
            #line 219 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
, Tuple.Create(Tuple.Create("", 13527), Tuple.Create<System.Object, System.Int32>(flag.Item2.Icon
            
            #line default
            #line hidden
, 13527), false)
, Tuple.Create(Tuple.Create(" ", 13545), Tuple.Create("fa-fw", 13546), true)
, Tuple.Create(Tuple.Create(" ", 13551), Tuple.Create("d-", 13552), true)
            
            #line 219 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    , Tuple.Create(Tuple.Create("", 13554), Tuple.Create<System.Object, System.Int32>(flag.Item2.IconColour
            
            #line default
            #line hidden
, 13554), false)
);

WriteLiteral("><span");

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

WriteLiteral("><span");

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

WriteLiteral(">");

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

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

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

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

WriteLiteral(">");

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

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

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

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

WriteLiteral(">");

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

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

            
            #line 221 "..\..\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: \'User_FlagAssignment_Tooltip\',\r\n                      " +
"                                          position: {\r\n                         " +
"                                           my: \"right top\",\r\n                   " +
"                                                 at: \"right bottom\",\r\n          " +
"                                                          collision: \"flipfit fl" +
"ip\"\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 " +
"                                                                           $(thi" +
"s).stop(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                                              " +
"  </script>\r\n                                            </div>\r\n");

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

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

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

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

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

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

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

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

            
            #line 264 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                
            
            #line default
            #line hidden
            
            #line 264 "..\..\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 267 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                   Write(Html.DropDownList("Device_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems));

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

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

WriteLiteral(">\r\n                            $(function () {\r\n                                v" +
"ar generatePdfUrl = \'");

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

            
            #line default
            #line hidden
WriteLiteral("?DocumentTemplateId=\';\r\n                                var $documentTemplates = " +
"$(\'#Device_Show_GenerateDocument\');\r\n                                var $genera" +
"tionHost;\r\n\r\n                                $documentTemplates.change(function " +
"() {\r\n                                    var v = $documentTemplates.val();\r\n   " +
"                                 if (v) {\r\n                                     " +
"   var url = generatePdfUrl + v;\r\n\r\n                                        if (" +
"$.connection && $.connection.hub && $.connection.hub.transport &&\r\n             " +
"                                   $.connection.hub.transport.name == \'foreverFr" +
"ame\') {\r\n                                            // SignalR active with fore" +
"verFrame transport - use popup window\r\n                                         " +
"   window.open(url, \'_blank\', \'height=150,width=250,location=no,menubar=no,resiz" +
"able=no,scrollbars=no,status=no,toolbar=no\');\r\n                                 " +
"       } else {\r\n                                            // use iFrame\r\n    " +
"                                        if (!$generationHost) {\r\n               " +
"                                 $generationHost = $(\'<iframe>\')\r\n              " +
"                                      .attr({ \'src\': url, \'title\': \'Document Gen" +
"eration Host\' })\r\n                                                    .addClass(" +
"\'hidden\')\r\n                                                    .appendTo(\'body\')" +
"\r\n                                                    .contents();\r\n            " +
"                                } else {\r\n                                      " +
"          $generationHost[0].location.href = url;\r\n                             " +
"               }\r\n                                        }\r\n\r\n                 " +
"                       $documentTemplates.val(\'\').blur();\r\n                     " +
"               }\r\n                                });\r\n                         " +
"   });\r\n                        </script>\r\n                    </div>\r\n");

            
            #line 302 "..\..\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(">");

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

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

            
            #line default
            #line hidden
            
            #line 314 "..\..\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><span");

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

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

            
            #line 320 "..\..\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><span");

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

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

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

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

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

WriteLiteral(">");

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

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

            
            #line 330 "..\..\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 334 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                }
                            
            
            #line default
            #line hidden
WriteLiteral("\r\n                            </td>\r\n                        </tr>\r\n             " +
"           <tr>\r\n                            <td><span");

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

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

            
            #line 341 "..\..\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><span");

WriteLiteral(" title=\"Allocate Certificates\"");

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

            
            #line 347 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            Write(Model.DeviceProfileCertificateProvider != null ? Model.DeviceProfileCertificateProvider.Name : "No");

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

            
            #line 351 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 351 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     if (Model.Device.CanUpdateDeviceProfile())
                    {
                        
            
            #line default
            #line hidden
            
            #line 353 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                   Write(Html.ActionLinkSmallButton("Update Profile", MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber, redirect: true), "Device_Show_Policies_Profile_Actions_Update_Button"));

            
            #line default
            #line hidden
            
            #line 353 "..\..\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                            <div>\r\n                                <ul");

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

WriteLiteral(">\r\n");

            
            #line 358 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 358 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                     foreach (var dp in Model.DeviceProfiles.OrderBy(i => i.Name))
                                    {

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

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

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

            
            #line 361 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                 Write(dp.Id);

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

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

WriteAttribute("id", Tuple.Create(" id=\"", 23094), Tuple.Create("\"", 23121)
, Tuple.Create(Tuple.Create("", 23099), Tuple.Create("DeviceProfile_", 23099), true)
            
            #line 361 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                     , Tuple.Create(Tuple.Create("", 23113), Tuple.Create<System.Object, System.Int32>(dp.Id
            
            #line default
            #line hidden
, 23113), false)
);

WriteLiteral(" /><label");

WriteAttribute("for", Tuple.Create(" for=\"", 23131), Tuple.Create("\"", 23159)
, Tuple.Create(Tuple.Create("", 23137), Tuple.Create("DeviceProfile_", 23137), true)
            
            #line 361 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                           , Tuple.Create(Tuple.Create("", 23151), Tuple.Create<System.Object, System.Int32>(dp.Id
            
            #line default
            #line hidden
, 23151), false)
);

WriteAttribute("title", Tuple.Create(" title=\"", 23160), Tuple.Create("\"", 23204)
, Tuple.Create(Tuple.Create("", 23168), Tuple.Create("Distribution:", 23168), true)
            
            #line 361 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                         , Tuple.Create(Tuple.Create(" ", 23181), Tuple.Create<System.Object, System.Int32>(dp.DistributionType
            
            #line default
            #line hidden
, 23182), false)
);

WriteLiteral(">");

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

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

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

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

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

            
            #line 368 "..\..\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 () {\r\n\r\n                                    if (!buttonDial" +
"og) {\r\n                                        buttonDialog = $(\'#Device_Show_Po" +
"licies_Profile_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 Profile\": function () {\r\n                            " +
"                                            var deviceProfileId = dialogInputs.f" +
"ilter(\':checked\').attr(\'data-deviceprofileid\');\r\n\r\n                             " +
"                                           if (deviceProfileId) {\r\n             " +
"                                                               var $this = $(thi" +
"s);\r\n                                                                           " +
" $this.dialog(\"disable\");\r\n                                                     " +
"                       $this.dialog(\"option\", \"buttons\", null);\r\n               " +
"                                                             window.location.hre" +
"f = button.attr(\'href\') + \'&DeviceProfileId=\' + deviceProfileId;\r\n              " +
"                                                          } else {\r\n            " +
"                                                                alert(\'A device " +
"profile must be selected\');\r\n                                                   " +
"                     }\r\n                                                        " +
"            },\r\n                                                                " +
"    Cancel: function () {\r\n                                                     " +
"                   $(this).dialog(\"close\");\r\n                                   " +
"                                 }\r\n                                            " +
"                    }\r\n                                                         " +
"   });\r\n                                        dialogInputs = buttonDialog.find" +
"(\'input\');\r\n                                        dialogContainers = dialogInp" +
"uts.closest(\'li\');\r\n\r\n                                        dialogInputs.chang" +
"e(function () {\r\n                                            dialogContainers.re" +
"moveClass(\'selected\');\r\n                                            $(this).clos" +
"est(\'li\').addClass(\'selected\');\r\n                                        });\r\n  " +
"                                  }\r\n\r\n                                    dialo" +
"gInputs.filter(\'[data-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 418 "..\..\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 421 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 421 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     if (Model.Device.DeviceBatchId.HasValue)
                    {

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

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

WriteLiteral(">");

            
            #line 423 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                  if (Authorization.Has(Claims.Config.DeviceBatch.Show))
                                                 {
                            
            
            #line default
            #line hidden
            
            #line 425 "..\..\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 425 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                           
                                                 }
                                                 else
                                                 {
                            
            
            #line default
            #line hidden
            
            #line 429 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                       Write(Model.Device.DeviceBatch.Name);

            
            #line default
            #line hidden
            
            #line 429 "..\..\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><span");

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

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

            
            #line 435 "..\..\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><span");

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

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

            
            #line 441 "..\..\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><span");

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

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

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

WriteLiteral(">");

            
            #line 447 "..\..\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><span");

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

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

            
            #line 453 "..\..\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><span");

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

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

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

WriteLiteral(">");

            
            #line 459 "..\..\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 463 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    }
                    else
                    {

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

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

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

            
            #line 468 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     if (Model.Device.CanUpdateDeviceBatch())
                    {
                        
            
            #line default
            #line hidden
            
            #line 470 "..\..\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 470 "..\..\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 475 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 475 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                     foreach (var db in Model.DeviceBatches.OrderBy(i => i.Name))
                                    {

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

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

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

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

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

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

WriteAttribute("id", Tuple.Create(" id=\"", 30812), Tuple.Create("\"", 30837)
, Tuple.Create(Tuple.Create("", 30817), Tuple.Create("DeviceBatch_", 30817), true)
            
            #line 478 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                               , Tuple.Create(Tuple.Create("", 30829), Tuple.Create<System.Object, System.Int32>(db.Id
            
            #line default
            #line hidden
, 30829), false)
);

WriteLiteral(" /><label");

WriteAttribute("for", Tuple.Create(" for=\"", 30847), Tuple.Create("\"", 30873)
, Tuple.Create(Tuple.Create("", 30853), Tuple.Create("DeviceBatch_", 30853), true)
            
            #line 478 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                   , Tuple.Create(Tuple.Create("", 30865), Tuple.Create<System.Object, System.Int32>(db.Id
            
            #line default
            #line hidden
, 30865), false)
);

WriteAttribute("title", Tuple.Create(" title=\"", 30874), Tuple.Create("\"", 30930)
, Tuple.Create(Tuple.Create("", 30882), Tuple.Create("Purchased:", 30882), true)
            
            #line 478 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                              , Tuple.Create(Tuple.Create(" ", 30892), Tuple.Create<System.Object, System.Int32>(db.PurchaseDate.ToLongDateString()
            
            #line default
            #line hidden
, 30893), false)
);

WriteLiteral(">");

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

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

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

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

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

            
            #line 485 "..\..\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                    " +
"                }\r\n\r\n                                    if (!!currentBatch) {\r\n" +
"                                        dialogInputs.filter(\'[data-devicebatchid" +
"=\' + currentBatch + \']\').prop(\'checked\', true).change();\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 537 "..\..\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(">");

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

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

            
            #line default
            #line hidden
            
            #line 550 "..\..\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=\"", 35927), Tuple.Create("\"", 36037)
            
            #line 552 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
    , Tuple.Create(Tuple.Create("", 35933), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))
            
            #line default
            #line hidden
, 35933), 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 559 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            
            
            #line default
            #line hidden
            
            #line 559 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanCreateJob())
            {
                Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
                
            
            #line default
            #line hidden
            
            #line 562 "..\..\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 562 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                    
            }

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

            
            #line 564 "..\..\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 570 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 570 "..\..\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 573 "..\..\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 582 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                
            
            #line default
            #line hidden
            
            #line 582 "..\..\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 595 "..\..\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 626 "..\..\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 647 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

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

            
            #line 648 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanUpdateTrustEnrol())
            {
                
            
            #line default
            #line hidden
            
            #line 650 "..\..\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 650 "..\..\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 660 "..\..\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 700 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

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

            
            #line 701 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanUpdateUntrustEnrol())
            {
                
            
            #line default
            #line hidden
            
            #line 703 "..\..\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 703 "..\..\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 743 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

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

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

            
            #line default
            #line hidden
            
            #line 746 "..\..\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 was this Device Decommissioned?\r\n                    </div>\r\n     " +
"               <div>\r\n                        <ul");

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

WriteLiteral(">\r\n");

            
            #line 753 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 753 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                             foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)))
                            {

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

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

WriteAttribute("id", Tuple.Create(" id=\"", 47583), Tuple.Create("\"", 47661)
, Tuple.Create(Tuple.Create("", 47588), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 47588), true)
            
            #line 756 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                           , Tuple.Create(Tuple.Create("", 47635), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
            
            #line default
            #line hidden
, 47635), false)
);

WriteLiteral("\r\n                                        name=\"Device_Show_Device_Actions_Decomm" +
"ission_Reason\"");

WriteAttribute("value", Tuple.Create(" value=\"", 47757), Tuple.Create("\"", 47791)
            
            #line 757 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     , Tuple.Create(Tuple.Create("", 47765), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
            
            #line default
            #line hidden
, 47765), false)
);

WriteLiteral(" ");

            
            #line 757 "..\..\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=\"", 47934), Tuple.Create("\"", 48013)
, Tuple.Create(Tuple.Create("", 47940), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 47940), true)
            
            #line 758 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
               , Tuple.Create(Tuple.Create("", 47987), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
            
            #line default
            #line hidden
, 47987), false)
);

WriteLiteral(">");

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

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

            
            #line 760 "..\..\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 768 "..\..\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 804 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

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

            
            #line 805 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanRecommission())
            { 
                
            
            #line default
            #line hidden
            
            #line 807 "..\..\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 807 "..\..\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 842 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

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

            
            #line 843 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanDelete())
            { 
                
            
            #line default
            #line hidden
            
            #line 845 "..\..\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 845 "..\..\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 883 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

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

        }
    }
}
#pragma warning restore 1591
