﻿#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.User.UserParts
{
    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/User/UserParts/_AssignmentHistory.cshtml")]
    public partial class AssignmentHistory : Disco.Services.Web.WebViewPage<Disco.Web.Models.User.ShowModel>
    {
        public AssignmentHistory()
        {
        }
        public override void Execute()
        {
            
            #line 2 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
  
    Authorization.Require(Claims.User.ShowAssignmentHistory);

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

WriteLiteral(" id=\"UserDetailTab-AssignmentHistory\"");

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

WriteLiteral(">\r\n");

            
            #line 6 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
    
            
            #line default
            #line hidden
            
            #line 6 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
     if (Model.User.DeviceUserAssignments.Count > 0)
    { 

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

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

WriteLiteral(@">
            <tr>
                <th>Device Serial #
                </th>
                <th>Device Asset #
                </th>
                <th>Device Model
                </th>
                <th>Device Profile
                </th>
                <th>Device Batch
                </th>
                <th>Assigned
                </th>
                <th>Unassigned
                </th>
            </tr>
");

            
            #line 25 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
            
            
            #line default
            #line hidden
            
            #line 25 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
             foreach (var dua in Model.User.DeviceUserAssignments.OrderByDescending(m => m.AssignedDate))
            {

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

            
            #line 29 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 29 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                         if (Authorization.Has(Claims.Device.Show))
                        {
                            
            
            #line default
            #line hidden
            
            #line 31 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                       Write(Html.ActionLink(dua.Device.SerialNumber, MVC.Device.Show(dua.DeviceSerialNumber)));

            
            #line default
            #line hidden
            
            #line 31 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                                                                                                              
                        }
                        else
                        {
                            
            
            #line default
            #line hidden
            
            #line 35 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                       Write(dua.Device.SerialNumber);

            
            #line default
            #line hidden
            
            #line 35 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                                                    
                        }

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

            
            #line 39 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 39 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                         if (!string.IsNullOrWhiteSpace(dua.Device.AssetNumber))
                        {
                            
            
            #line default
            #line hidden
            
            #line 41 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                       Write(dua.Device.AssetNumber);

            
            #line default
            #line hidden
            
            #line 41 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                                                   
                        }
                        else
                        {

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

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

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

            
            #line 46 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                        }

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

            
            #line 49 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 49 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                         if (dua.Device.DeviceModelId.HasValue)
                        {
                            if (Authorization.Has(Claims.Config.DeviceModel.Show))
                            {
                            
            
            #line default
            #line hidden
            
            #line 53 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                       Write(Html.ActionLink(dua.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(dua.Device.DeviceModelId)));

            
            #line default
            #line hidden
            
            #line 53 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                                                                                                                                       
                            }
                            else
                            {
                            
            
            #line default
            #line hidden
            
            #line 57 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                       Write(dua.Device.DeviceModel.ToString());

            
            #line default
            #line hidden
            
            #line 57 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                                                              
                            }
                        }
                        else
                        {

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

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

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

            
            #line 63 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                        }

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

            
            #line 66 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 66 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                         if (Authorization.Has(Claims.Config.DeviceProfile.Show))
                        {
                            
            
            #line default
            #line hidden
            
            #line 68 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                       Write(Html.ActionLink(dua.Device.DeviceProfile.ToString(), MVC.Config.DeviceProfile.Index(dua.Device.DeviceProfileId)));

            
            #line default
            #line hidden
            
            #line 68 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                                                                                                                                             
                        }
                        else
                        {
                            
            
            #line default
            #line hidden
            
            #line 72 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                       Write(dua.Device.DeviceProfile.ToString());

            
            #line default
            #line hidden
            
            #line 72 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                                                                
                        }

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

            
            #line 76 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 76 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                         if (dua.Device.DeviceBatchId.HasValue)
                        {
                            if (Authorization.Has(Claims.Config.DeviceBatch.Show))
                            {
                            
            
            #line default
            #line hidden
            
            #line 80 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                       Write(Html.ActionLink(dua.Device.DeviceBatch.ToString(), MVC.Config.DeviceBatch.Index(dua.Device.DeviceBatchId)));

            
            #line default
            #line hidden
            
            #line 80 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                                                                                                                                       
                            }
                            else
                            {
                            
            
            #line default
            #line hidden
            
            #line 84 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                       Write(dua.Device.DeviceModel.ToString());

            
            #line default
            #line hidden
            
            #line 84 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                                                              
                            }
                        }
                        else
                        {

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

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

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

            
            #line 90 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                        }

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

WriteLiteral("                        ");

            
            #line 93 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                   Write(CommonHelpers.FriendlyDate(dua.AssignedDate));

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

WriteLiteral("                        ");

            
            #line 96 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                   Write(CommonHelpers.FriendlyDate(dua.UnassignedDate, "Current"));

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

            
            #line 99 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
            }

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

            
            #line 101 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
    }
    else
    { 

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

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

WriteLiteral(">No Assignment History Available</span>\r\n");

            
            #line 105 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
    }

            
            #line default
            #line hidden
WriteLiteral("    <script>\r\n        $(\'#UserDetailTabItems\').append(\'<li><a href=\"#UserDetailTa" +
"b-AssignmentHistory\">Assignment History [");

            
            #line 107 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
                                                                                                        Write(Model.User.DeviceUserAssignments.Count);

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

        }
    }
}
#pragma warning restore 1591
