#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.Organisation
{
    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/Organisation/Index.cshtml")]
    public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.Organisation.IndexModel>
    {
        public Index()
        {
        }
        public override void Execute()
        {
            
            #line 2 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
  
    Authorization.Require(Claims.Config.Organisation.Show);

    var canConfigAddresses = Authorization.Has(Claims.Config.Organisation.ConfigureAddresses);

    ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Organisation Details");
    Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
    Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");

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

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

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

WriteLiteral(">\r\n    <h2>Details</h2>\r\n    <table>\r\n        <tr>\r\n            <th");

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

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

            
            #line 19 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 19 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                 if (Authorization.Has(Claims.Config.Organisation.ConfigureName))
                {
                    
            
            #line default
            #line hidden
            
            #line 21 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
               Write(Html.EditorFor(m => m.OrganisationName));

            
            #line default
            #line hidden
            
            #line 21 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                                            
                    
            
            #line default
            #line hidden
            
            #line 22 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
               Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 22 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                             

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

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

WriteLiteral(@">
                    $(function () {
                        var field = $('#OrganisationName');
                        document.DiscoFunctions.PropertyChangeHelper(
                        field,
                        'Unknown',
                        '");

            
            #line 29 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                     Write(Url.Action(MVC.API.System.UpdateOrganisationName()));

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

            
            #line 34 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                }
                else
                {

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

            
            #line 37 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                   Write(Model.OrganisationName);

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

            
            #line 38 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                }

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

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

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

            
            #line 44 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 44 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                 if (Authorization.Has(Claims.Config.Organisation.ConfigureLogo))
                {

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

WriteLiteral("                    <br />\r\n");

WriteLiteral("                    <a");

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

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

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

WriteLiteral(">Update</a>\r\n");

            
            #line 49 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                }

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

WriteLiteral(" style=\"text-align: center;\"");

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

WriteLiteral(" style=\"height: 256px; width: 256px;\"");

WriteLiteral(" alt=\"Organisation Logo\"");

WriteAttribute("src", Tuple.Create(" src=\"", 2081), Tuple.Create("\"", 2115)
            
            #line 53 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
            , Tuple.Create(Tuple.Create("", 2087), Tuple.Create<System.Object, System.Int32>(Url.OrganisationLogoUrl()
            
            #line default
            #line hidden
, 2087), false)
);

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

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

WriteLiteral(">\r\n                Multi-Site Mode:\r\n            </th>\r\n            <td>\r\n");

            
            #line 62 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 62 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                 if (Authorization.Has(Claims.Config.Organisation.ConfigureMultiSiteMode))
                {
                    
            
            #line default
            #line hidden
            
            #line 64 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
               Write(Html.EditorFor(m => m.MultiSiteMode));

            
            #line default
            #line hidden
            
            #line 64 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                                          
            
            #line default
            #line hidden
            
            #line 64 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                                     Write(Html.LabelFor(m => m.MultiSiteMode));

            
            #line default
            #line hidden
            
            #line 64 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                                                                              
                    
            
            #line default
            #line hidden
            
            #line 65 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
               Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 65 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                             

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

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

WriteLiteral(@">
                    $(function () {
                        var field = $('#MultiSiteMode');
                        document.DiscoFunctions.PropertyChangeHelper(
                        field,
                        null,
                        '");

            
            #line 72 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                     Write(Url.Action(MVC.API.System.UpdateMultiSiteMode()));

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

            
            #line 77 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                }
                else
                {

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

WriteLiteral(" name=\"MultiSiteMode\"");

WriteLiteral(" class=\"check-box\"");

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

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

WriteLiteral(" ");

            
            #line 80 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                                                                                 Write(Model.MultiSiteMode ? new HtmlString("checked=\"checked\" ") : new HtmlString(string.Empty));

            
            #line default
            #line hidden
WriteLiteral(" disabled=\"disabled\"> ");

            
            #line 80 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                                                                                                                                                                                                         
            
            #line default
            #line hidden
            
            #line 80 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                                                                                                                                                                                                    Write(Html.LabelFor(m => m.MultiSiteMode));

            
            #line default
            #line hidden
            
            #line 80 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                                                                                                                                                                                                                                             
                }

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

            
            #line 82 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                 if (Model.OrganisationAddresses.Count > 1)
                {

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

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

WriteLiteral(" class=\"info-box\"");

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

WriteLiteral(" class=\"fa-p\"");

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

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral("></i>Multi-Site mode is recommended where multiple addresses are configured.\r\n   " +
"                     </p>\r\n                    </div>\r\n");

            
            #line 89 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                }

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

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

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

            
            #line 95 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 95 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                 if (canConfigAddresses)
                {

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

WriteLiteral("                    <br />\r\n");

WriteLiteral("                    <button");

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

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

WriteLiteral(">Create</button>\r\n");

            
            #line 100 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                }

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

            
            #line 103 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 103 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                 if (Model.OrganisationAddresses.Count > 0)
                {

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

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

WriteLiteral(@">
                        <tr>
                            <th>
                                Name
                            </th>
                            <th>
                                Address
                            </th>
                            <th></th>
                        </tr>
");

            
            #line 115 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 115 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                         foreach (var item in Model.OrganisationAddresses)
                        {

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

WriteLiteral(" data-addressid=\"");

            
            #line 117 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                           Write(item.Id);

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

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

            
            #line 119 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                     Write(Html.DisplayFor(modelItem => item.Name));

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

            
            #line 119 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                                                                            Write(Html.DisplayFor(modelItem => item.ShortName));

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

            
            #line 122 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                     Write(Html.DisplayFor(modelItem => item.Address));

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

            
            #line 123 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                           Write(Html.DisplayFor(modelItem => item.Suburb));

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

            
            #line 123 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                                                                                   Write(Html.DisplayFor(modelItem => item.Postcode));

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

            
            #line 124 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                           Write(Html.DisplayFor(modelItem => item.State));

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

            
            #line 124 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                                                                                  Write(Html.DisplayFor(modelItem => item.Country));

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

            
            #line 125 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 125 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                     if (!string.IsNullOrWhiteSpace(item.PhoneNumber))
                                    {

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

WriteLiteral("<span");

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

WriteLiteral(">Phone:</span> ");

WriteLiteral("<span>");

            
            #line 127 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                                                                        Write(Html.DisplayFor(modelItem => item.PhoneNumber));

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

            
            #line 128 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                    }

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

            
            #line 129 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                     if (!string.IsNullOrWhiteSpace(item.FaxNumber))
                                    {

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

WriteLiteral("<span");

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

WriteLiteral(">Fax:</span> ");

WriteLiteral("<span>");

            
            #line 131 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                                                                      Write(Html.DisplayFor(modelItem => item.FaxNumber));

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

            
            #line 132 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                    }

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

            
            #line 133 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                     if (!string.IsNullOrWhiteSpace(item.EmailAddress))
                                    {

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

WriteLiteral("<span>");

            
            #line 135 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                               Write(Html.DisplayFor(modelItem => item.EmailAddress));

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

            
            #line 136 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                    }

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

            
            #line 139 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 139 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                     if (canConfigAddresses)
                                    {

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

WriteLiteral(" class=\"fa fa-edit information edit\"");

WriteLiteral(" title=\"Edit Address\"");

WriteLiteral("></i> ");

WriteLiteral("<i");

WriteLiteral(" class=\"fa fa-times-circle warning delete\"");

WriteLiteral(" title=\"Delete Address\"");

WriteLiteral("></i>\r\n");

WriteLiteral("                                        <script");

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

WriteLiteral(" type=\"application/json\"");

WriteLiteral(">");

            
            #line 142 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                                                                       Write(Html.Raw(Json.Encode(item)));

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

            
            #line 143 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                    }

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

            
            #line 146 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                        }

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

            
            #line 148 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                }
                else
                {

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

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

WriteLiteral(">No Addresses Stored</span>\r\n");

            
            #line 152 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                }

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

            
            #line 157 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
 if (Authorization.Has(Claims.Config.Organisation.ConfigureLogo))
{

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

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

WriteLiteral(" title=\"Update Organisation Logo\"");

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

WriteLiteral(">\r\n");

            
            #line 160 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
        
            
            #line default
            #line hidden
            
            #line 160 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
         using (Html.BeginForm(MVC.API.System.OrganisationLogo(true, null, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
        {

            
            #line default
            #line hidden
WriteLiteral("            <h3>Update Organisation Logo</h3>\r\n");

WriteLiteral("            <div");

WriteLiteral(" style=\"margin-top: 10px; padding-bottom: 5px;\"");

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

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

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

WriteLiteral(" name=\"ResetLogo\"");

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

WriteLiteral("\r\n                       checked=\"checked\"");

WriteLiteral(" /><label");

WriteLiteral(" for=\"updateOrganisationLogoResetLogo\"");

WriteLiteral(">Remove Logo</label>\r\n            </div>\r\n");

WriteLiteral("            <div");

WriteLiteral(" style=\"margin-top: 5px; border-top: 1px dashed #aaa; padding-top: 5px;\"");

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

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

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

WriteLiteral(" name=\"ResetLogo\"");

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

WriteLiteral(" /><label");

WriteLiteral(" for=\"updateOrganisationLogoUploadLogo\"");

WriteLiteral(">Upload Logo</label>\r\n                <div");

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

WriteLiteral(" style=\"display: none; padding: 4px 0 0 14px;\"");

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

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

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

WriteLiteral(" name=\"Image\"");

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

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

WriteLiteral(" class=\"field-validation-valid field-validation-error\"");

WriteLiteral(">* Required</span>\r\n                </div>\r\n            </div>\r\n");

            
            #line 174 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
        }

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

WriteLiteral("    <script");

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

WriteLiteral(">\r\n        $(function () {\r\n            var button = $(\'#buttonUpdateOrganisation" +
"Logo\');\r\n            var buttonDialog = $(\'#dialogUpdateOrganisationLogo\');\r\n   " +
"         button.click(function () {\r\n                buttonDialog.dialog(\'open\')" +
";\r\n                return false;\r\n            });\r\n            buttonDialog.find" +
"(\'input[type=\"radio\"]\').click(function () {\r\n                if ($(\'#updateOrgan" +
"isationLogoUploadLogo\').is(\':checked\')) {\r\n                    $(\'#updateOrganis" +
"ationLogoUploadLogoImage\').removeAttr(\'disabled\');\r\n                    $(\'#upda" +
"teOrganisationLogoUploadLogoContainer\').slideDown();\r\n                }\r\n       " +
"         else {\r\n                    $(\'#updateOrganisationLogoUploadLogoContain" +
"er\').slideUp();\r\n                    $(\'#updateOrganisationLogoUploadLogoImage\')" +
".attr(\'disabled\', \'disabled\');\r\n                }\r\n            });\r\n            " +
"buttonDialog.dialog({\r\n                resizable: false,\r\n                modal:" +
" true,\r\n                autoOpen: false,\r\n                buttons: {\r\n          " +
"          \"Save\": function () {\r\n                        var $this = $(this);\r\n\r" +
"\n                        var $image = $(\'#updateOrganisationLogoUploadLogoImage\'" +
");\r\n                        if ($(\'#updateOrganisationLogoUploadLogo\').is(\':chec" +
"ked\') && $image.val() == \'\') {\r\n                            $image.addClass(\'inp" +
"ut-validation-error\');\r\n                            $(\'#updateOrganisationLogoUp" +
"loadLogoImageRequired\').removeClass(\'field-validation-valid\');\r\n                " +
"        } else {\r\n                            $image.removeClass(\'input-validati" +
"on-error\');\r\n                            $(\'#updateOrganisationLogoUploadLogoIma" +
"geRequired\').addClass(\'field-validation-valid\');\r\n                            $t" +
"his.dialog(\"disable\");\r\n                            $this.dialog(\"option\", \"butt" +
"ons\", null);\r\n                            $this.find(\'form\').submit();\r\n        " +
"                }\r\n                    },\r\n                    Cancel: function " +
"() {\r\n                        $(this).dialog(\"close\");\r\n                    }\r\n " +
"               }\r\n            });\r\n        });\r\n    </script>\r\n");

            
            #line 221 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
}

            
            #line default
            #line hidden
            
            #line 222 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
 if (canConfigAddresses)
{

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

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

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

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

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

WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg warning\"");

WriteLiteral("></i>\r\n            This item will be permanently deleted.\r\n        </p>\r\n        " +
"<p>\r\n            <strong>Are you sure?</strong>\r\n        </p>\r\n");

            
            #line 232 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
        
            
            #line default
            #line hidden
            
            #line 232 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
         using (Html.BeginForm(MVC.API.System.DeleteOrganisationAddress()))
        {
            
            
            #line default
            #line hidden
            
            #line 234 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
       Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
            
            #line 234 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                    

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

WriteLiteral(" name=\"Id\"");

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

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

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

WriteLiteral("            <input");

WriteLiteral(" name=\"redirect\"");

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

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

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

            
            #line 237 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
        }

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

WriteLiteral("    <div");

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

WriteLiteral(" title=\"Edit/Create Address\"");

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

WriteLiteral(">\r\n");

            
            #line 240 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
        
            
            #line default
            #line hidden
            
            #line 240 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
         using (Html.BeginForm(MVC.API.System.UpdateOrganisationAddress()))
        {
            
            
            #line default
            #line hidden
            
            #line 242 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
       Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
            
            #line 242 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
                                    

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

WriteLiteral(" name=\"redirect\"");

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

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

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

WriteLiteral("            <input");

WriteLiteral(" name=\"Id\"");

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

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

WriteLiteral(" data-bind />\r\n");

WriteLiteral("            <table>\r\n                <tr>\r\n                    <td>\r\n            " +
"            <label");

WriteLiteral(" for=\"editShortName\"");

WriteLiteral(">Short&nbsp;Name&nbsp;*</label>\r\n                    </td>\r\n                    <" +
"td>\r\n                        <input");

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

WriteLiteral(" name=\"ShortName\"");

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

WriteLiteral(" required data-bind />\r\n                    </td>\r\n                </tr>\r\n       " +
"         <tr>\r\n                    <td>\r\n                        <label");

WriteLiteral(" for=\"editName\"");

WriteLiteral(">Name&nbsp;*</label>\r\n                    </td>\r\n                    <td>\r\n      " +
"                  <input");

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

WriteLiteral(" name=\"Name\"");

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

WriteLiteral(" required data-bind />\r\n                    </td>\r\n                </tr>\r\n       " +
"         <tr>\r\n                    <td>\r\n                        <label");

WriteLiteral(" for=\"editAddress\"");

WriteLiteral(">Address&nbsp;*</label>\r\n                    </td>\r\n                    <td>\r\n   " +
"                     <input");

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

WriteLiteral(" name=\"Address\"");

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

WriteLiteral(" required data-bind />\r\n                    </td>\r\n                </tr>\r\n       " +
"         <tr>\r\n                    <td>\r\n                        <label");

WriteLiteral(" for=\"editSuburb\"");

WriteLiteral(">Suburb&nbsp;*</label>\r\n                    </td>\r\n                    <td>\r\n    " +
"                    <input");

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

WriteLiteral(" name=\"Suburb\"");

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

WriteLiteral(" required data-bind />\r\n                    </td>\r\n                </tr>\r\n       " +
"         <tr>\r\n                    <td>\r\n                        <label");

WriteLiteral(" for=\"editPostcode\"");

WriteLiteral(">Postcode&nbsp;*</label>\r\n                    </td>\r\n                    <td>\r\n  " +
"                      <input");

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

WriteLiteral(" name=\"Postcode\"");

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

WriteLiteral(" required data-bind />\r\n                    </td>\r\n                </tr>\r\n       " +
"         <tr>\r\n                    <td>\r\n                        <label");

WriteLiteral(" for=\"editState\"");

WriteLiteral(">State&nbsp;*</label>\r\n                    </td>\r\n                    <td>\r\n     " +
"                   <input");

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

WriteLiteral(" name=\"State\"");

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

WriteLiteral(" required data-bind />\r\n                    </td>\r\n                </tr>\r\n       " +
"         <tr>\r\n                    <td>\r\n                        <label");

WriteLiteral(" for=\"editCountry\"");

WriteLiteral(">Country&nbsp;*</label>\r\n                    </td>\r\n                    <td>\r\n   " +
"                     <input");

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

WriteLiteral(" name=\"Country\"");

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

WriteLiteral(" required data-bind />\r\n                    </td>\r\n                </tr>\r\n       " +
"         <tr>\r\n                    <td>\r\n                        <label");

WriteLiteral(" for=\"editPhoneNumber\"");

WriteLiteral(">Phone Number</label>\r\n                    </td>\r\n                    <td>\r\n     " +
"                   <input");

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

WriteLiteral(" name=\"PhoneNumber\"");

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

WriteLiteral(" data-bind />\r\n                    </td>\r\n                </tr>\r\n                " +
"<tr>\r\n                    <td>\r\n                        <label");

WriteLiteral(" for=\"editFaxNumber\"");

WriteLiteral(">Fax Number</label>\r\n                    </td>\r\n                    <td>\r\n       " +
"                 <input");

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

WriteLiteral(" name=\"FaxNumber\"");

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

WriteLiteral(" data-bind />\r\n                    </td>\r\n                </tr>\r\n                " +
"<tr>\r\n                    <td>\r\n                        <label");

WriteLiteral(" for=\"editEmailAddress\"");

WriteLiteral(">Email Address</label>\r\n                    </td>\r\n                    <td>\r\n    " +
"                    <input");

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

WriteLiteral(" name=\"EmailAddress\"");

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

WriteLiteral(" data-bind />\r\n                    </td>\r\n                </tr>\r\n            </ta" +
"ble>\r\n");

            
            #line 327 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
        }

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

WriteLiteral("    <script");

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

WriteLiteral(">\r\n        $(function () {\r\n            let $addressEditDialog = null;\r\n         " +
"   let $addressRemoveDialog = null;\r\n\r\n            $(\'#organisationAddresses\').f" +
"ind(\'i.delete\').click(function () {\r\n                const id = $(this).closest(" +
"\'tr\').attr(\'data-addressid\');\r\n                if (id) {\r\n                    if" +
" ($addressRemoveDialog === null) {\r\n                        $addressRemoveDialog" +
" = $(\"#dialogConfirmRemove\").dialog({\r\n                            resizable: fa" +
"lse,\r\n                            modal: true,\r\n                            auto" +
"Open: false,\r\n                            buttons: {\r\n                          " +
"      \"Delete\": function () {\r\n                                    const $this =" +
" $(this);\r\n                                    $this.dialog(\"disable\");\r\n       " +
"                             $this.dialog(\"option\", \"buttons\", null);\r\n         " +
"                           $this.find(\'form\').trigger(\'submit\');\r\n              " +
"                  },\r\n                                Cancel: function () {\r\n   " +
"                                 $(this).dialog(\"close\");\r\n                     " +
"           }\r\n                            }\r\n                        });\r\n      " +
"              }\r\n                    const $dialog = $addressRemoveDialog;\r\n    " +
"                $dialog.find(\'input[name=\"Id\"]\').val(id);\r\n                    $" +
"dialog.dialog(\'open\');\r\n                }\r\n            });\r\n\r\n            functi" +
"on editAddress(e) {\r\n                if ($addressEditDialog === null) {\r\n       " +
"             $addressEditDialog = $(\"#dialogEdit\").dialog({\r\n                   " +
"     resizable: false,\r\n                        modal: true,\r\n                  " +
"      autoOpen: false,\r\n                        width: 350,\r\n                   " +
"     buttons: {\r\n                            \"Save\": function () {\r\n            " +
"                    const $form = $addressEditDialog.find(\'form\');\r\n            " +
"                    if ($form[0].reportValidity()) {\r\n                          " +
"          const $this = $(this);\r\n                                    $this.dial" +
"og(\"disable\");\r\n                                    $this.dialog(\"option\", \"butt" +
"ons\", null);\r\n                                    $form.trigger(\'submit\');\r\n    " +
"                            }\r\n                            },\r\n                 " +
"           Cancel: function () {\r\n                                $(this).dialog" +
"(\"close\");\r\n                            }\r\n                        }\r\n          " +
"          });\r\n                    $addressEditDialog.find(\'form\').removeAttr(\'n" +
"ovalidate\');\r\n                }\r\n                const $dialog = $addressEditDia" +
"log;\r\n\r\n                if (e && e.currentTarget) {\r\n                    const a" +
"ddress = JSON.parse($(e.currentTarget).closest(\'tr\').find(\'script.addressJson\')." +
"html());\r\n\r\n                    $dialog.dialog(\'option\', \'title\', \'Edit Address:" +
" \' + address.Name);\r\n\r\n                    $dialog.find(\'input[data-bind]\').each" +
"(function () {\r\n                        const $this = $(this);\r\n                " +
"        const name = $this.attr(\'name\');\r\n                        if (address[na" +
"me]) {\r\n                            $this.val(address[name]);\r\n                 " +
"       } else {\r\n                            $this.val(\'\');\r\n                   " +
"     }\r\n                    });\r\n                } else {\r\n                    $" +
"dialog.dialog(\'option\', \'title\', \'Create Address\');\r\n                    $dialog" +
".find(\'input[data-bind]\').val(\'\');\r\n                }\r\n                $dialog.d" +
"ialog(\'open\');\r\n                $dialog.find(\'input[type=\"text\"]\').first().focus" +
"();\r\n            }\r\n\r\n            $(\'#organisationAddresses\').on(\'click\', \'i.edi" +
"t\', editAddress)\r\n            $(\'#createAddress\').on(\'click\', function (e) {\r\n  " +
"              e.preventDefault();\r\n                editAddress();\r\n             " +
"   return false;\r\n            });\r\n        });\r\n    </script>\r\n");

            
            #line 417 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
}
            
            #line default
            #line hidden
        }
    }
}
#pragma warning restore 1591
