#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.17929
//
//     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.BI.Extensions;
    using Disco.Models.Repository;
    using Disco.Web;
    using Disco.Web.Extensions;
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
    [System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/_DeviceActions.cshtml")]
    public class DeviceActions : System.Web.Mvc.WebViewPage<Disco.Models.Repository.Device>
    {
        public DeviceActions()
        {
        }
        public override void Execute()
        {
WriteLiteral("<div");

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

WriteLiteral(">\r\n");

            
            #line 3 "..\..\Views\Device\_DeviceActions.cshtml"
    
            
            #line default
            #line hidden
            
            #line 3 "..\..\Views\Device\_DeviceActions.cshtml"
     if (Model.CanDecommission())
    { 
        
            
            #line default
            #line hidden
            
            #line 5 "..\..\Views\Device\_DeviceActions.cshtml"
   Write(Html.ActionLinkButton("Decommission", MVC.API.Device.Decommission(Model.SerialNumber, true), "buttonDeviceDecommission"));

            
            #line default
            #line hidden
            
            #line 5 "..\..\Views\Device\_DeviceActions.cshtml"
                                                                                                                                 

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

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

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

WriteLiteral(">\r\n            <p>\r\n                <span");

WriteLiteral(" class=\"ui-icon ui-icon-alert\"");

WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");

WriteLiteral("></span>\r\n                Are you sure?</p>\r\n        </div>\r\n");

WriteLiteral("        <script");

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

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

            
            #line 40 "..\..\Views\Device\_DeviceActions.cshtml"
    }

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

            
            #line 41 "..\..\Views\Device\_DeviceActions.cshtml"
     if (Model.CanRecommission())
    { 
        
            
            #line default
            #line hidden
            
            #line 43 "..\..\Views\Device\_DeviceActions.cshtml"
   Write(Html.ActionLinkButton("Recommission", MVC.API.Device.Recommission(Model.SerialNumber, true), "buttonDeviceRecommission"));

            
            #line default
            #line hidden
            
            #line 43 "..\..\Views\Device\_DeviceActions.cshtml"
                                                                                                                                 

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

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

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

WriteLiteral(">\r\n            <p>\r\n                <span");

WriteLiteral(" class=\"ui-icon ui-icon-alert\"");

WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");

WriteLiteral("></span>\r\n                Are you sure?</p>\r\n        </div>\r\n");

WriteLiteral("        <script");

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

WriteLiteral(@">
            $(function () {
                var button = $('#buttonDeviceRecommission');
                var buttonDialog = $('#dialogConfirmRecommission');
                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 78 "..\..\Views\Device\_DeviceActions.cshtml"
    }

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

            
            #line 79 "..\..\Views\Device\_DeviceActions.cshtml"
     if (Model.CanDelete())
    { 
        
            
            #line default
            #line hidden
            
            #line 81 "..\..\Views\Device\_DeviceActions.cshtml"
   Write(Html.ActionLinkButton("Delete Device", MVC.API.Device.Delete(Model.SerialNumber, true), "buttonDeviceDelete"));

            
            #line default
            #line hidden
            
            #line 81 "..\..\Views\Device\_DeviceActions.cshtml"
                                                                                                                      

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

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

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

WriteLiteral(">\r\n            <p>\r\n                <span");

WriteLiteral(" class=\"ui-icon ui-icon-alert\"");

WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");

WriteLiteral("></span>\r\n                This item will be permanently deleted and cannot be rec" +
"overed.<br />\r\n                Jobs linked to this Device (but not to a User) wi" +
"ll be deleted also.<br />\r\n                Are you sure?</p>\r\n        </div>\r\n");

WriteLiteral("        <script");

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

WriteLiteral(@">
            $(function () {
                var button = $('#buttonDeviceDelete');
                var buttonDialog = $('#dialogConfirmDelete');
                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 118 "..\..\Views\Device\_DeviceActions.cshtml"
    }

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

            
            #line 119 "..\..\Views\Device\_DeviceActions.cshtml"
     if (Model.CanCreateJob())
    {
        Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
        
            
            #line default
            #line hidden
            
            #line 122 "..\..\Views\Device\_DeviceActions.cshtml"
   Write(Html.ActionLinkButton("Create Job", MVC.Job.Create(Model.SerialNumber, Model.AssignedUserId), "buttonCreateJob"));

            
            #line default
            #line hidden
            
            #line 122 "..\..\Views\Device\_DeviceActions.cshtml"
                                                                                                                         
    }

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

        }
    }
}
#pragma warning restore 1591
