#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.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.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/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=\"jobNonWarrantyFinance\"");

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

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

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

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

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

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

            
            #line default
            #line hidden
            
            #line 15 "..\..\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 21 "..\..\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 26 "..\..\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 30 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                           }
                    else
                    {
            
            #line default
            #line hidden
WriteLiteral("<span");

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

WriteLiteral(">");

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

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

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

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

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

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

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

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

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

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

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

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

            
            #line 45 "..\..\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 45 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                                                                                                                                                                                             Write(Model.Job.OpenedDate.ToISO8601());

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

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

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

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

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

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

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

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

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

            
            #line default
            #line hidden
            
            #line 62 "..\..\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 68 "..\..\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 73 "..\..\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 77 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                           }
                    else
                    {
            
            #line default
            #line hidden
            
            #line 79 "..\..\Views\Job\JobParts\Warranty.cshtml"
                Write(Model.Job.JobMetaWarranty.ExternalReference);

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

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

            
            #line 83 "..\..\Views\Job\JobParts\Warranty.cshtml"
        
            
            #line default
            #line hidden
            
            #line 83 "..\..\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 88 "..\..\Views\Job\JobParts\Warranty.cshtml"
                
            
            #line default
            #line hidden
            
            #line 88 "..\..\Views\Job\JobParts\Warranty.cshtml"
                 if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ExternalCompletedDate))
                {
                    
            
            #line default
            #line hidden
            
            #line 90 "..\..\Views\Job\JobParts\Warranty.cshtml"
               Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaWarranty.ExternalCompletedDate, "Not Completed", "Job_JobMetaWarranty_ExternalCompletedDate"));

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

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

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

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

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

            
            #line 93 "..\..\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 93 "..\..\Views\Job\JobParts\Warranty.cshtml"
                                                                                                                                                                                                                                                      Write(Model.Job.OpenedDate.ToISO8601());

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

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

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

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

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

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

            
            #line 103 "..\..\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\"");

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 117 "..\..\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 122 "..\..\Views\Job\JobParts\Warranty.cshtml"
    
            
            #line default
            #line hidden
            
            #line 122 "..\..\Views\Job\JobParts\Warranty.cshtml"
     if (Authorization.Has(Claims.Job.Properties.WarrantyProperties.ProviderDetails))
    {
            
            #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 141 "..\..\Views\Job\JobParts\Warranty.cshtml"
                             Write(Url.Action(MVC.Job.WarrantyProviderJobDetails()));

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

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

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

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

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

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

        }
    }
}
#pragma warning restore 1591
