#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.Job.JobParts
{
    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/Job/JobParts/Warranty.cshtml")]
    public partial class Warranty : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.ShowModel>
    {
        public Warranty()
        {
        }
        public override void Execute()
        {
            
            #line 2 "..\..\Views\Job\JobParts\Warranty.cshtml"
  
    Authorization.Require(Claims.Job.ShowWarranty);

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

WriteLiteral(" id=\"jobDetailTab-Warranty\"");

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

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

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

WriteLiteral(">\r\n");

            
            #line 7 "..\..\Views\Job\JobParts\Warranty.cshtml"
        
            
            #line default
            #line hidden
            
            #line 7 "..\..\Views\Job\JobParts\Warranty.cshtml"
         if (Model.Job.JobMetaWarranty.ExternalName != null || Model.Job.JobMetaWarranty.ExternalLoggedDate.HasValue || Model.Job.JobMetaWarranty.ExternalReference != null)
        {

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

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

WriteLiteral(">Warranty Provider\r\n                </th>\r\n                <td>\r\n");

            
            #line 13 "..\..\Views\Job\JobParts\Warranty.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 13 "..\..\Views\Job\JobParts\Warranty.cshtml"
                     if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ExternalName))
                    {
                        
            
            #line default
            #line hidden
            
            #line 15 "..\..\Views\Job\JobParts\Warranty.cshtml"
                   Write(Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalName));

            
            #line default
            #line hidden
            
            #line 15 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                                
                        
            
            #line default
            #line hidden
            
            #line 16 "..\..\Views\Job\JobParts\Warranty.cshtml"
                   Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 16 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                               
                        
            
            #line default
            #line hidden
            
            #line 17 "..\..\Views\Job\JobParts\Warranty.cshtml"
                   Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 17 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                 

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

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

WriteLiteral(@">
                            $(function () {
                                document.DiscoFunctions.PropertyChangeHelper(
                                    $('#Job_JobMetaWarranty_ExternalName'),
                                    'Unknown',
                                    '");

            
            #line 23 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                Write(Url.Action(MVC.API.Job.UpdateWarrantyExternalName(Model.Job.Id, null)));

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

            
            #line 28 "..\..\Views\Job\JobParts\Warranty.cshtml"
                    }
                    else
                    {
                        if (string.IsNullOrWhiteSpace(Model.Job.JobMetaWarranty.ExternalName))
                        {
            
            #line default
            #line hidden
WriteLiteral("<span");

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

WriteLiteral(">&lt;Unknown/None&gt;</span>");

            
            #line 32 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                               }
                        else
                        {
            
            #line default
            #line hidden
WriteLiteral("<span");

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

WriteLiteral(">");

            
            #line 34 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                Write(Model.Job.JobMetaWarranty.ExternalName);

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

            
            #line 34 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                                                                   }
                    }

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

WriteLiteral("            <tr>\r\n                <th");

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

WriteLiteral(">Warranty Logged\r\n                </th>\r\n                <td>\r\n");

            
            #line 42 "..\..\Views\Job\JobParts\Warranty.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 42 "..\..\Views\Job\JobParts\Warranty.cshtml"
                     if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ExternalLoggedDate))
                    {
                        
            
            #line default
            #line hidden
            
            #line 44 "..\..\Views\Job\JobParts\Warranty.cshtml"
                   Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaWarranty.ExternalLoggedDate, "Not Logged", "Job_JobMetaWarranty_ExternalLoggedDate"));

            
            #line default
            #line hidden
            
            #line 44 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                                                                                                         
                        
            
            #line default
            #line hidden
            
            #line 45 "..\..\Views\Job\JobParts\Warranty.cshtml"
                   Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 45 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                 

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

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

WriteLiteral(">\r\n                            document.DiscoFunctions.DateDialogCreateUpdater(\'");

            
            #line 47 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                         Write(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)));

            
            #line default
            #line hidden
WriteLiteral("\', \'Warranty Logged\', \'Job_JobMetaWarranty_ExternalLoggedDate\', null, \'WarrantyEx" +
"ternalLoggedDate\', \'Not Logged\', \'");

            
            #line 47 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                                                                                                                                                                                                 Write(Model.Job.OpenedDate.ToISO8601());

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

            
            #line 49 "..\..\Views\Job\JobParts\Warranty.cshtml"
                    }
                    else
                    {
                        
            
            #line default
            #line hidden
            
            #line 52 "..\..\Views\Job\JobParts\Warranty.cshtml"
                   Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaWarranty.ExternalLoggedDate, "Unknown/None", null));

            
            #line default
            #line hidden
            
            #line 52 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                                                                       
                    }

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

WriteLiteral("            <tr>\r\n                <th");

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

WriteLiteral(">Warranty Reference\r\n                </th>\r\n                <td>\r\n");

            
            #line 60 "..\..\Views\Job\JobParts\Warranty.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 60 "..\..\Views\Job\JobParts\Warranty.cshtml"
                     if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ExternalReference))
                    {
                        
            
            #line default
            #line hidden
            
            #line 62 "..\..\Views\Job\JobParts\Warranty.cshtml"
                   Write(Html.EditorFor(m => m.Job.JobMetaWarranty.ExternalReference));

            
            #line default
            #line hidden
            
            #line 62 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                                     
                        
            
            #line default
            #line hidden
            
            #line 63 "..\..\Views\Job\JobParts\Warranty.cshtml"
                   Write(AjaxHelpers.AjaxSave());

            
            #line default
            #line hidden
            
            #line 63 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                               
                        
            
            #line default
            #line hidden
            
            #line 64 "..\..\Views\Job\JobParts\Warranty.cshtml"
                   Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 64 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                 

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

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

WriteLiteral(@">
                            $(function () {
                                document.DiscoFunctions.PropertyChangeHelper(
                                    $('#Job_JobMetaWarranty_ExternalReference'),
                                    'Unknown',
                                    '");

            
            #line 70 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                Write(Url.Action(MVC.API.Job.UpdateWarrantyExternalReference(Model.Job.Id, null)));

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

            
            #line 75 "..\..\Views\Job\JobParts\Warranty.cshtml"
                    }
                    else
                    {
                        if (string.IsNullOrWhiteSpace(Model.Job.JobMetaWarranty.ExternalReference))
                        {
            
            #line default
            #line hidden
WriteLiteral("<span");

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

WriteLiteral(">&lt;Unknown/None&gt;</span>");

            
            #line 79 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                               }
                        else
                        {
            
            #line default
            #line hidden
            
            #line 81 "..\..\Views\Job\JobParts\Warranty.cshtml"
                    Write(Model.Job.JobMetaWarranty.ExternalReference);

            
            #line default
            #line hidden
            
            #line 81 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                     }
                    }

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

            
            #line 85 "..\..\Views\Job\JobParts\Warranty.cshtml"
                    if (Model.Job.JobMetaWarranty.ExternalLoggedDate.HasValue)
                    {

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

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

WriteLiteral(">Warranty Completed\r\n                </th>\r\n                <td>\r\n");

            
            #line 91 "..\..\Views\Job\JobParts\Warranty.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 91 "..\..\Views\Job\JobParts\Warranty.cshtml"
                     if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ExternalCompletedDate))
                    {
                        
            
            #line default
            #line hidden
            
            #line 93 "..\..\Views\Job\JobParts\Warranty.cshtml"
                   Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaWarranty.ExternalCompletedDate, "Not Completed", "Job_JobMetaWarranty_ExternalCompletedDate"));

            
            #line default
            #line hidden
            
            #line 93 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                                                                                                                  
                        
            
            #line default
            #line hidden
            
            #line 94 "..\..\Views\Job\JobParts\Warranty.cshtml"
                   Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 94 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                 

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

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

WriteLiteral(">\r\n                            document.DiscoFunctions.DateDialogCreateUpdater(\'");

            
            #line 96 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                         Write(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)));

            
            #line default
            #line hidden
WriteLiteral("\', \'Warranty Logged\', \'Job_JobMetaWarranty_ExternalCompletedDate\', null, \'Warrant" +
"yExternalCompletedDate\', \'Not Completed\', \'");

            
            #line 96 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                                                                                                                                                                                                          Write(Model.Job.OpenedDate.ToISO8601());

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

            
            #line 98 "..\..\Views\Job\JobParts\Warranty.cshtml"
                    }
                    else
                    {
                        
            
            #line default
            #line hidden
            
            #line 101 "..\..\Views\Job\JobParts\Warranty.cshtml"
                   Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaWarranty.ExternalCompletedDate, "Unknown/None", null));

            
            #line default
            #line hidden
            
            #line 101 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                                                                          
                    }

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

            
            #line 105 "..\..\Views\Job\JobParts\Warranty.cshtml"
                    }
                    if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ProviderDetails))
                    {
                        Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");

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

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

WriteLiteral(" style=\"display: none\"");

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

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

WriteLiteral(">Provider Details\r\n                </th>\r\n                <td>\r\n                 " +
"   <div");

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

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

WriteLiteral(" class=\"ajaxLoading showInitially\"");

WriteLiteral(" title=\"Loading...\"");

WriteLiteral("></span> Loading...\r\n                    </div>\r\n                    <div");

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

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

WriteLiteral(" style=\"display: none\"");

WriteLiteral(">\r\n                    </div>\r\n                </td>\r\n            </tr>\r\n");

            
            #line 120 "..\..\Views\Job\JobParts\Warranty.cshtml"
                    }
        }
        else
        {

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

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

WriteLiteral(">Actions\r\n                </th>\r\n                <td>\r\n");

            
            #line 128 "..\..\Views\Job\JobParts\Warranty.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 128 "..\..\Views\Job\JobParts\Warranty.cshtml"
                     if (Model.Job.CanLogWarranty())
                    { 
                        
            
            #line default
            #line hidden
            
            #line 130 "..\..\Views\Job\JobParts\Warranty.cshtml"
                   Write(Html.ActionLinkSmallButton("Lodge Warranty", MVC.Job.LogWarranty(Model.Job.Id, null, null), "Job_Show_Warranty_Actions_LogWarranty_Button"));

            
            #line default
            #line hidden
            
            #line 130 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                                                                                                                    
                    }
                    else
                    {

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

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

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

            
            #line 135 "..\..\Views\Job\JobParts\Warranty.cshtml"
                    }

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

            
            #line 138 "..\..\Views\Job\JobParts\Warranty.cshtml"
        }

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

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

WriteLiteral(">\r\n    $(\'#jobDetailTabItems\').append(\'<li><a href=\"#jobDetailTab-Warranty\">Warra" +
"nty</a></li>\');\r\n");

            
            #line 143 "..\..\Views\Job\JobParts\Warranty.cshtml"
    
            
            #line default
            #line hidden
            
            #line 143 "..\..\Views\Job\JobParts\Warranty.cshtml"
     if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ProviderDetails) && Model.Job.JobMetaWarranty.ExternalName != null)
    {
            
            #line default
            #line hidden
WriteLiteral(@"
    $(function () {
        var warrantyProviderDetailLoaded = false;

        $('#jobDetailTabs').on('tabsactivate', function (e, ui) {
            if ($(ui.newPanel).is('#jobDetailTab-Warranty')) {
                if (!warrantyProviderDetailLoaded) {
                    var warrantyExternalName;
                    var $warrantyExternalName = $('#Job_JobMetaWarranty_ExternalName');
                    if ($warrantyExternalName.length > 0) {
                        if ($warrantyExternalName[0].nodeName === 'INPUT')
                            warrantyExternalName = $warrantyExternalName.val();
                        else
                            warrantyExternalName = $warrantyExternalName.text();
                        if (warrantyExternalName) {
                            $('#jobWarrantyProviderDetailContainer').show();
                            $('#jobWarrantyProviderDetailLoading span').show();
                            $('#jobWarrantyProviderDetailHost').load(
                                '");

            
            #line 162 "..\..\Views\Job\JobParts\Warranty.cshtml"
                             Write(Url.Action(MVC.Job.WarrantyProviderJobDetails()));

            
            #line default
            #line hidden
WriteLiteral("\',\r\n                                { id: \'");

            
            #line 163 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                   Write(Model.Job.Id);

            
            #line default
            #line hidden
WriteLiteral(@"' },
                                function () {
                                    $('#jobWarrantyProviderDetailLoading').hide();
                                    $(this).slideDown();
                                }
                            );

                            warrantyProviderDetailLoaded = true;
                        }
                    }
                }
            }
        });
    });
    ");

            
            #line 177 "..\..\Views\Job\JobParts\Warranty.cshtml"
           }

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

        }
    }
}
#pragma warning restore 1591
