#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;
    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 2 "..\..\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 16 "..\..\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 19 "..\..\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 22 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                         Write(Model.Device.ComputerName);

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

            
            #line 23 "..\..\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 29 "..\..\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 32 "..\..\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 35 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                             Write(Model.Device.ComputerDomainName);

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

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

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

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

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

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

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

WriteLiteral(">");

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

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

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

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

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

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

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

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

WriteLiteral(">");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            
            #line 110 "..\..\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 113 "..\..\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 124 "..\..\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=\"", 8052), Tuple.Create("\"", 8074)
            
            #line 141 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
      , Tuple.Create(Tuple.Create("", 8060), Tuple.Create<System.Object, System.Int32>(lastSeenClass
            
            #line default
            #line hidden
, 8060), false)
);

WriteLiteral(">");

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

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

            
            #line 142 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 142 "..\..\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 150 "..\..\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 175 "..\..\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 180 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 180 "..\..\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 188 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 188 "..\..\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 192 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                            
            
            #line default
            #line hidden
            
            #line 192 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                             if (Authorization.Has(Claims.User.Show))
                                            {
                                                
            
            #line default
            #line hidden
            
            #line 194 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                           Write(Html.ActionLink(assignedUser.DisplayName, MVC.User.Show(assignedUser.UserId)));

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

            
            #line default
            #line hidden
            
            #line 198 "..\..\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 201 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                            Write(assignedUser.FriendlyId());

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

            
            #line 202 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                        
            
            #line default
            #line hidden
            
            #line 202 "..\..\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 206 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                   Write(assignedUser.PhoneNumber);

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

            
            #line 207 "..\..\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=\"", 12745), Tuple.Create("\"", 12800)
, Tuple.Create(Tuple.Create("", 12752), Tuple.Create("mailto:", 12752), true)
            
            #line 210 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                          , Tuple.Create(Tuple.Create("", 12759), Tuple.Create<System.Object, System.Int32>(Model.Device.AssignedUser.EmailAddress
            
            #line default
            #line hidden
, 12759), false)
);

WriteLiteral(">");

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

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

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

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

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

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

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

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

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

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

            
            #line 223 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                
            
            #line default
            #line hidden
            
            #line 223 "..\..\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 226 "..\..\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 229 "..\..\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 261 "..\..\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 267 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                if (Authorization.Has(Claims.Config.DeviceProfile.Show))
                                               {
                        
            
            #line default
            #line hidden
            
            #line 269 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                   Write(Html.ActionLink(Model.Device.DeviceProfile.Name, MVC.Config.DeviceProfile.Index(Model.Device.DeviceProfileId)));

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

            
            #line default
            #line hidden
            
            #line 273 "..\..\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 279 "..\..\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 285 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                  
                                if (Model.DeviceProfileDefaultOrganisationAddress != null)
                                {

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

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

WriteLiteral(">");

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

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

            
            #line 289 "..\..\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 293 "..\..\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 300 "..\..\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 306 "..\..\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 310 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 310 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     if (Model.Device.CanUpdateDeviceProfile())
                    {
                        
            
            #line default
            #line hidden
            
            #line 312 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                   Write(Html.ActionLinkSmallButton("Update Profile", MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber, null, true), "Device_Show_Policies_Profile_Actions_Update_Button"));

            
            #line default
            #line hidden
            
            #line 312 "..\..\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 317 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 317 "..\..\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 320 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                 Write(dp.Id);

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

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

WriteAttribute("id", Tuple.Create(" id=\"", 19325), Tuple.Create("\"", 19352)
, Tuple.Create(Tuple.Create("", 19330), Tuple.Create("DeviceProfile_", 19330), true)
            
            #line 320 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                     , Tuple.Create(Tuple.Create("", 19344), Tuple.Create<System.Object, System.Int32>(dp.Id
            
            #line default
            #line hidden
, 19344), false)
);

WriteLiteral(" /><label");

WriteAttribute("for", Tuple.Create(" for=\"", 19362), Tuple.Create("\"", 19390)
, Tuple.Create(Tuple.Create("", 19368), Tuple.Create("DeviceProfile_", 19368), true)
            
            #line 320 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                           , Tuple.Create(Tuple.Create("", 19382), Tuple.Create<System.Object, System.Int32>(dp.Id
            
            #line default
            #line hidden
, 19382), false)
);

WriteAttribute("title", Tuple.Create(" title=\"", 19391), Tuple.Create("\"", 19435)
, Tuple.Create(Tuple.Create("", 19399), Tuple.Create("Distribution:", 19399), true)
            
            #line 320 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                         , Tuple.Create(Tuple.Create(" ", 19412), Tuple.Create<System.Object, System.Int32>(dp.DistributionType
            
            #line default
            #line hidden
, 19413), false)
);

WriteLiteral(">");

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

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

            
            #line 321 "..\..\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 327 "..\..\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 377 "..\..\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 380 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 380 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     if (Model.Device.DeviceBatchId.HasValue)
                    {

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

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

WriteLiteral(">");

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

            
            #line default
            #line hidden
            
            #line 388 "..\..\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 394 "..\..\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 400 "..\..\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=\"", 24907), Tuple.Create("\"", 25055)
            
            #line 406 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
, Tuple.Create(Tuple.Create("", 24915), Tuple.Create<System.Object, System.Int32>(Model.Device.DeviceBatch.WarrantyValidUntil.HasValue && Model.Device.DeviceBatch.WarrantyValidUntil.Value < DateTime.Now ? "alert" : null
            
            #line default
            #line hidden
, 24915), false)
);

WriteLiteral(">");

            
            #line 406 "..\..\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 412 "..\..\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=\"", 25757), Tuple.Create("\"", 25893)
            
            #line 418 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
, Tuple.Create(Tuple.Create("", 25765), Tuple.Create<System.Object, System.Int32>(Model.Device.DeviceBatch.InsuredUntil.HasValue && Model.Device.DeviceBatch.InsuredUntil.Value < DateTime.Now ? "alert" : null
            
            #line default
            #line hidden
, 25765), false)
);

WriteLiteral(">");

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

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

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

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

            
            #line 427 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     if (Model.Device.CanUpdateDeviceBatch())
                    {
                        
            
            #line default
            #line hidden
            
            #line 429 "..\..\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 429 "..\..\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 434 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 434 "..\..\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 437 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                               Write(db.Id);

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

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

WriteAttribute("id", Tuple.Create(" id=\"", 27043), Tuple.Create("\"", 27068)
, Tuple.Create(Tuple.Create("", 27048), Tuple.Create("DeviceBatch_", 27048), true)
            
            #line 437 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                               , Tuple.Create(Tuple.Create("", 27060), Tuple.Create<System.Object, System.Int32>(db.Id
            
            #line default
            #line hidden
, 27060), false)
);

WriteLiteral(" /><label");

WriteAttribute("for", Tuple.Create(" for=\"", 27078), Tuple.Create("\"", 27104)
, Tuple.Create(Tuple.Create("", 27084), Tuple.Create("DeviceBatch_", 27084), true)
            
            #line 437 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                   , Tuple.Create(Tuple.Create("", 27096), Tuple.Create<System.Object, System.Int32>(db.Id
            
            #line default
            #line hidden
, 27096), false)
);

WriteAttribute("title", Tuple.Create(" title=\"", 27105), Tuple.Create("\"", 27161)
, Tuple.Create(Tuple.Create("", 27113), Tuple.Create("Purchased:", 27113), true)
            
            #line 437 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                              , Tuple.Create(Tuple.Create(" ", 27123), Tuple.Create<System.Object, System.Int32>(db.PurchaseDate.ToLongDateString()
            
            #line default
            #line hidden
, 27124), false)
);

WriteLiteral(">");

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

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

            
            #line 438 "..\..\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 444 "..\..\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                                    dialogInputs.filter(\'[d" +
"ata-devicebatchid=\' + currentBatch + \']\').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 494 "..\..\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 501 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                              if (Authorization.Has(Claims.Config.DeviceModel.Show))
                                                                                             {
                        
            
            #line default
            #line hidden
            
            #line 503 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                   Write(Html.ActionLink(Model.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId)));

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

            
            #line default
            #line hidden
            
            #line 507 "..\..\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=\"", 32056), Tuple.Create("\"", 32166)
            
            #line 509 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
    , Tuple.Create(Tuple.Create("", 32062), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))
            
            #line default
            #line hidden
, 32062), 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 516 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            
            
            #line default
            #line hidden
            
            #line 516 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanCreateJob())
            {
                Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
                
            
            #line default
            #line hidden
            
            #line 519 "..\..\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 519 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                    
            }

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

            
            #line 521 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanUpdateAssignment())
            {
                
            
            #line default
            #line hidden
            
            #line 523 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
           Write(Html.ActionLinkSmallButton("Update Assignment", MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber, null, null, true), "Device_Show_User_Actions_Assign_Button"));

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

            
            #line default
            #line hidden
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                    " +
"<input");

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

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

WriteLiteral(" />\r\n                </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 536 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                
            
            #line default
            #line hidden
            
            #line 536 "..\..\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);
                                window.location.href = button.attr('href');
                            },
                                                ");

WriteLiteral("\r\n");

            
            #line 547 "..\..\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                                    wind" +
"ow.location.href = button.attr(\'href\') + \'&AssignedUserId=\' + userId;\r\n         " +
"                       } else {\r\n                                    alert(\'Ente" +
"r a user to assign this device\');\r\n                                }\r\n          " +
"                  },\r\n                            Cancel: function () {\r\n       " +
"                         $(this).dialog(\"close\");\r\n                            }" +
"\r\n                        }\r\n\r\n                        button.click(function () " +
"{\r\n                            if (!buttonDialog) {\r\n                           " +
"     buttonDialog = $(\'#Device_Show_User_Actions_Assign_Dialog\')\r\n              " +
"                                      .dialog({\r\n                               " +
"                         resizable: false,\r\n                                    " +
"                    height: 180,\r\n                                              " +
"          modal: true,\r\n                                                        " +
"autoOpen: false,\r\n                                                        button" +
"s: dialogButtons\r\n                                                    });\r\n     " +
"                           inputUserId = $(\'#Device_Show_User_Actions_Assign_Use" +
"rId\');\r\n                                inputUserId.focus(function () { inputUse" +
"rId.select() })\r\n                                    .autocomplete({\r\n          " +
"                              source: \'");

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

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

            
            #line 600 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanUpdateTrustEnrol())
            {
                
            
            #line default
            #line hidden
            
            #line 602 "..\..\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 602 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                                                                                                                                                                                                            

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

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

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

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

WriteLiteral(" class=\"ui-widget\"");

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

WriteLiteral(" class=\"ui-state-highlight ui-corner-all\"");

WriteLiteral(" style=\"padding: 6px;\"");

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

WriteLiteral(" style=\"padding-bottom: 6px;\"");

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

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

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

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

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

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

WriteLiteral(" style=\"margin-top: 10px; font-size: 1em;\"");

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

WriteLiteral("                <script");

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

WriteLiteral(@">
                    $(function () {
                        var button = $('#Device_Show_Device_Actions_TrustEnrol_Button');
                        var buttonDialog = $('#Device_Show_Device_Actions_TrustEnrol_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: {
                                ""Trust"": function () {
                                    var $this = $(this);
                                    $this.dialog(""disable"");
                                    $this.dialog(""option"", ""buttons"", null);
                                    window.location.href = buttonLink;
                                },
                                Cancel: function () {
                                    $(this).dialog(""close"");
                                }
                            }
                        });
                    });
                </script>
");

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

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

            
            #line 648 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
             if (Model.Device.CanUpdateUntrustEnrol())
            {
                
            
            #line default
            #line hidden
            
            #line 650 "..\..\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 650 "..\..\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(" style=\"padding-bottom: 6px;\"");

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

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

WriteLiteral(@"></i>&nbsp;This action will require the device to enrol with authentication (for example: domain joined).
                    </div>
                    <strong>Are you sure you want to require an authenticated enrolment?</strong>
                </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 686 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

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

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

            
            #line default
            #line hidden
            
            #line 689 "..\..\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 696 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 696 "..\..\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=\"", 43281), Tuple.Create("\"", 43359)
, Tuple.Create(Tuple.Create("", 43286), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 43286), true)
            
            #line 699 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                           , Tuple.Create(Tuple.Create("", 43333), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
            
            #line default
            #line hidden
, 43333), false)
);

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

WriteAttribute("value", Tuple.Create(" value=\"", 43455), Tuple.Create("\"", 43489)
            
            #line 700 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
                     , Tuple.Create(Tuple.Create("", 43463), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
            
            #line default
            #line hidden
, 43463), false)
);

WriteLiteral(" ");

            
            #line 700 "..\..\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=\"", 43632), Tuple.Create("\"", 43711)
, Tuple.Create(Tuple.Create("", 43638), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 43638), true)
            
            #line 701 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
               , Tuple.Create(Tuple.Create("", 43685), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
            
            #line default
            #line hidden
, 43685), false)
);

WriteLiteral(">");

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

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

            
            #line 703 "..\..\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 711 "..\..\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 747 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
            }

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

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

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

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

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

        }
    }
}
#pragma warning restore 1591
