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

namespace Disco.Web.Views.Device
{
    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("~/Views/Device/AddOffline.cshtml")]
    public partial class AddOffline : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.AddOfflineModel>
    {
        public AddOffline()
        {
        }
        public override void Execute()
        {
            
            #line 2 "..\..\Views\Device\AddOffline.cshtml"
  
    Authorization.Require(Claims.Device.Actions.EnrolDevices);

    ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Add Offline");

    var hasAssetNumber = Authorization.Has(Claims.Device.Properties.AssetNumber);
    var hasLocation = Authorization.Has(Claims.Device.Properties.Location);
    var hasDeviceBatch = Authorization.Has(Claims.Device.Properties.DeviceBatch);
    var hasDeviceProfile = Authorization.Has(Claims.Device.Properties.DeviceProfile);
    var hasAssignUser = Authorization.Has(Claims.Device.Actions.AssignUser);


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

            
            #line 14 "..\..\Views\Device\AddOffline.cshtml"
 using (Html.BeginForm())
{
    
            
            #line default
            #line hidden
            
            #line 16 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationSummary(true));

            
            #line default
            #line hidden
            
            #line 16 "..\..\Views\Device\AddOffline.cshtml"
                                 

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

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

WriteLiteral(" style=\"width: 450px\"");

WriteLiteral(">\r\n        <table>\r\n            <tr>\r\n                <th>\r\n                    S" +
"erial Number (required):\r\n                </th>\r\n                <td>\r\n");

WriteLiteral("                    ");

            
            #line 24 "..\..\Views\Device\AddOffline.cshtml"
               Write(Html.TextBoxFor(model => model.Device.SerialNumber));

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

WriteLiteral("                    ");

            
            #line 25 "..\..\Views\Device\AddOffline.cshtml"
               Write(Html.ValidationMessageFor(model => model.Device.SerialNumber));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
">\r\n                    Computer Name:\r\n                </th>\r\n                <t" +
"d>\r\n");

WriteLiteral("                    ");

            
            #line 33 "..\..\Views\Device\AddOffline.cshtml"
               Write(Html.TextBoxFor(model => model.Device.DeviceDomainId));

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

WriteLiteral("                    ");

            
            #line 34 "..\..\Views\Device\AddOffline.cshtml"
               Write(Html.ValidationMessageFor(model => model.Device.DeviceDomainId));

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

            
            #line 37 "..\..\Views\Device\AddOffline.cshtml"
            
            
            #line default
            #line hidden
            
            #line 37 "..\..\Views\Device\AddOffline.cshtml"
             if (hasAssetNumber)
            {

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

WriteLiteral("                        ");

            
            #line 44 "..\..\Views\Device\AddOffline.cshtml"
                   Write(Html.TextBoxFor(model => model.Device.AssetNumber));

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

WriteLiteral("                        ");

            
            #line 45 "..\..\Views\Device\AddOffline.cshtml"
                   Write(Html.ValidationMessageFor(model => model.Device.AssetNumber));

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

            
            #line 48 "..\..\Views\Device\AddOffline.cshtml"
            }

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

            
            #line 49 "..\..\Views\Device\AddOffline.cshtml"
             if (hasLocation)
            {

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

WriteLiteral("                        ");

            
            #line 56 "..\..\Views\Device\AddOffline.cshtml"
                   Write(Html.TextBoxFor(model => model.Device.Location));

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

WriteLiteral("                        ");

            
            #line 57 "..\..\Views\Device\AddOffline.cshtml"
                   Write(Html.ValidationMessageFor(model => model.Device.Location));

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

            
            #line 60 "..\..\Views\Device\AddOffline.cshtml"
            }

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

            
            #line 61 "..\..\Views\Device\AddOffline.cshtml"
             if (hasDeviceBatch)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr>\r\n                    <th>\r\n                        Device Ba" +
"tch:\r\n                    </th>\r\n                    <td>\r\n");

WriteLiteral("                        ");

            
            #line 68 "..\..\Views\Device\AddOffline.cshtml"
                   Write(Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches.ToSelectListItems()));

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

WriteLiteral("                        ");

            
            #line 70 "..\..\Views\Device\AddOffline.cshtml"
                   Write(Html.ValidationMessageFor(model => model.Device.DeviceBatchId));

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

            
            #line 73 "..\..\Views\Device\AddOffline.cshtml"
            }

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

            
            #line 74 "..\..\Views\Device\AddOffline.cshtml"
             if (hasDeviceProfile)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr>\r\n                    <th>\r\n                        Device Pr" +
"ofile:\r\n                    </th>\r\n                    <td>\r\n");

WriteLiteral("                        ");

            
            #line 81 "..\..\Views\Device\AddOffline.cshtml"
                   Write(Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId)));

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

WriteLiteral("                        ");

            
            #line 82 "..\..\Views\Device\AddOffline.cshtml"
                   Write(Html.ValidationMessageFor(model => model.Device.DeviceProfileId));

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

            
            #line 85 "..\..\Views\Device\AddOffline.cshtml"
            }

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

            
            #line 86 "..\..\Views\Device\AddOffline.cshtml"
             if (hasAssignUser)
            {

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

WriteLiteral("                        ");

            
            #line 93 "..\..\Views\Device\AddOffline.cshtml"
                   Write(Html.TextBoxFor(model => model.Device.AssignedUserId));

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

WriteLiteral("                        ");

            
            #line 94 "..\..\Views\Device\AddOffline.cshtml"
                   Write(Html.ValidationMessageFor(model => model.Device.AssignedUserId));

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

            
            #line 97 "..\..\Views\Device\AddOffline.cshtml"
            }

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

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

WriteLiteral(">\r\n");

            
            #line 100 "..\..\Views\Device\AddOffline.cshtml"
            
            
            #line default
            #line hidden
            
            #line 100 "..\..\Views\Device\AddOffline.cshtml"
             if (!hasDeviceProfile)
            {
                
            
            #line default
            #line hidden
            
            #line 102 "..\..\Views\Device\AddOffline.cshtml"
           Write(Html.Hidden("Device.DeviceProfileId", Model.DefaultDeviceProfileId));

            
            #line default
            #line hidden
            
            #line 102 "..\..\Views\Device\AddOffline.cshtml"
                                                                                    
            }

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

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

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

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

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

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

WriteLiteral(@">
                $(function () {
                    var $SerialNumber = $('#Device_SerialNumber').focus();

                    $SerialNumber.keydown(function (e) {
                        if (e.which == 13) {
                            $('#Device_DeviceDomainId').focus();
                            return false;
                        }
                    });

");

            
            #line 118 "..\..\Views\Device\AddOffline.cshtml"
                
            
            #line default
            #line hidden
            
            #line 118 "..\..\Views\Device\AddOffline.cshtml"
                 if (hasAssignUser)
                {
            
            #line default
            #line hidden
WriteLiteral(@"
                    $('#Device_DeviceDomainId').keydown(function (e) {
                    if (e.which == 13) {
                        $('#Device_AssignedUserId').focus();
                        return false;
                    }
                });");

            
            #line 125 "..\..\Views\Device\AddOffline.cshtml"
                          }

            
            #line default
            #line hidden
            
            #line 126 "..\..\Views\Device\AddOffline.cshtml"
 if (hasAssetNumber)
{
            
            #line default
            #line hidden
WriteLiteral("\r\n                    $(\'#Device_AssetNumber\').keydown(function (e) {\r\n          " +
"          if (e.which == 13) {\r\n");

            
            #line 130 "..\..\Views\Device\AddOffline.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 130 "..\..\Views\Device\AddOffline.cshtml"
                         if (hasLocation)
                        {
            
            #line default
            #line hidden
WriteLiteral("$(\'#Device_Location\').focus(); return false;");

            
            #line 131 "..\..\Views\Device\AddOffline.cshtml"
                                                                                  }
                        else if (hasAssignUser)
                        {
            
            #line default
            #line hidden
WriteLiteral("$(\'#Device_AssignedUserId\').focus(); return false;");

            
            #line 133 "..\..\Views\Device\AddOffline.cshtml"
                                                                                        }

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

            
            #line 136 "..\..\Views\Device\AddOffline.cshtml"
                       }

            
            #line default
            #line hidden
            
            #line 137 "..\..\Views\Device\AddOffline.cshtml"
 if (hasLocation && hasAssignUser)
{
            
            #line default
            #line hidden
WriteLiteral(@"
                    $('#Device_Location').keydown(function (e) {
                    if (e.which == 13) {
                        $('#Device_AssignedUserId').focus();
                        return false;
                    }
                });
                ");

            
            #line 145 "..\..\Views\Device\AddOffline.cshtml"
                       }

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

            
            #line 146 "..\..\Views\Device\AddOffline.cshtml"
                     if (hasAssignUser)
{
            
            #line default
            #line hidden
WriteLiteral(@"
                    var $AssignedUserId = $('#Device_AssignedUserId');
                $AssignedUserId
                    .watermark('Search Users')
                    .focus(function () { $AssignedUserId.select() })
                    .autocomplete({
                        source: '");

            
            #line 153 "..\..\Views\Device\AddOffline.cshtml"
                             Write(Url.Action(MVC.API.Search.UsersUpstream()));

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

            
            #line 169 "..\..\Views\Device\AddOffline.cshtml"
                       }

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

            
            #line 173 "..\..\Views\Device\AddOffline.cshtml"
}

            
            #line default
            #line hidden
        }
    }
}
#pragma warning restore 1591
