#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Disco.Web.Areas.Config.Views.DeviceModel
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Text;
    using System.Web;
    using System.Web.Helpers;
    using System.Web.Mvc;
    using System.Web.Mvc.Ajax;
    using System.Web.Mvc.Html;
    using System.Web.Routing;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.WebPages;
    using Disco;
    using Disco.Models.Repository;
    using Disco.Services;
    using Disco.Services.Authorization;
    using Disco.Services.Web;
    using Disco.Web;
    using Disco.Web.Extensions;
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
    [System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceModel/Index.cshtml")]
    public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.IndexModel>
    {
        public Index()
        {
        }
        public override void Execute()
        {
            
            #line 2 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
  
    Authorization.Require(Claims.Config.DeviceModel.Show);

    ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models");

    var hasDecommissionedModels = Model.DeviceModels.Any(db => db.DeviceCount > 0 && db.DeviceDecommissionedCount >= db.DeviceCount);

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

            
            #line 9 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
 if (hasDecommissionedModels)
{

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

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

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

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

WriteLiteral(">Show Decommissioned (");

            
            #line 11 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
                                                                                                  Write(Model.DeviceModels.Count(db => db.DeviceCount > 0 && db.DeviceDecommissionedCount >= db.DeviceCount));

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

WriteLiteral(@"    <script>
        $(function () {
            $('#Config_DeviceModels_ShowDecommissioned').click(function () {
                $(this).remove();
                $('#Config_DeviceModels_List').find('tr.hidden').show();
                return false;
            }).detach().appendTo('#layout_PageHeading');
        })
    </script>
");

            
            #line 21 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
}

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

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

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

WriteLiteral(">\r\n    <tr>\r\n        <th>Name/Description</th>\r\n        <th>Manufacturer</th>\r\n  " +
"      <th>Model</th>\r\n        <th>Type</th>\r\n        <th>Device Count</th>\r\n    " +
"</tr>\r\n");

            
            #line 30 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
    
            
            #line default
            #line hidden
            
            #line 30 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
     foreach (var item in Model.DeviceModels)
    {
        var isDecommissioned = item.DeviceCount > 0 && item.DeviceDecommissionedCount >= item.DeviceCount;

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

WriteAttribute("class", Tuple.Create(" class=\"", 1354), Tuple.Create("\"", 1399)
            
            #line 33 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
, Tuple.Create(Tuple.Create("", 1362), Tuple.Create<System.Object, System.Int32>(isDecommissioned ? "hidden" : null
            
            #line default
            #line hidden
, 1362), false)
);

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

WriteLiteral("                ");

            
            #line 35 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
           Write(Html.ActionLink(item.ToString(), MVC.Config.DeviceModel.Index(item.Id)));

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

WriteLiteral("                ");

            
            #line 38 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
           Write(Html.DisplayFor(modelItem => item.Manufacturer));

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

WriteLiteral("                ");

            
            #line 41 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
           Write(Html.DisplayFor(modelItem => item.Model));

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

WriteLiteral("                ");

            
            #line 44 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
           Write(Html.DisplayFor(modelItem => item.ModelType));

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

            
            #line 47 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 47 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
                 if (item.DeviceCount > 0 && Authorization.Has(Claims.Device.Search))
                {

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

            
            #line 49 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
                     Write(Html.ActionLink(string.Format("View {0}", item.DeviceCount), MVC.Search.Query(item.Id.ToString(), "DeviceModel")));

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

            
            #line 50 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
                }
                else
                {

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

            
            #line 53 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
                     Write(item.DeviceCount.ToString("n0"));

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

            
            #line 54 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
                }

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

            
            #line 55 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
                 if (item.DeviceDecommissionedCount > 0)
                {

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

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

WriteAttribute("title", Tuple.Create(" title=\"", 2371), Tuple.Create("\"", 2442)
            
            #line 57 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
, Tuple.Create(Tuple.Create("", 2379), Tuple.Create<System.Object, System.Int32>(item.DeviceDecommissionedCount.ToString("n0")
            
            #line default
            #line hidden
, 2379), false)
, Tuple.Create(Tuple.Create(" ", 2427), Tuple.Create("Decommissioned", 2428), true)
);

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

            
            #line 58 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
                     Write(item.DeviceDecommissionedCount.ToString("n0"));

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

            
            #line 60 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
                }

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

            
            #line 63 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
    }

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

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

WriteLiteral(">\r\n");

WriteLiteral("    ");

            
            #line 66 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
Write(Html.ActionLinkButton("Generic Components", MVC.Config.DeviceModel.GenericComponents()));

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

        }
    }
}
#pragma warning restore 1591
