Example #1
0
 protected void CancelButton_Click(object sender, EventArgs e)
 {
     _EditAddressId = 0;
     _PageMode      = "V";
     AddPanelPopup.Hide();
     if (!IsAddressValid(AbleContext.Current.User.PrimaryAddress))
     {
         Response.Redirect(AbleCommerce.Code.NavigationHelper.GetCheckoutUrl());
     }
 }
Example #2
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            Address primaryAddress = AbleContext.Current.User.PrimaryAddress;

            if (!Page.IsPostBack && !IsAddressValid(primaryAddress))
            {
                _EditAddressId = primaryAddress.Id;
                _PageMode      = "E";
                InitAddressForm(primaryAddress);
                EditBillingCaption.Visible = true;
                EditCaption.Visible        = false;
                AddCaption.Visible         = false;
            }
            CancelButton.Visible = true;
            //REBIND THE ADDRESS BOOK
            if (_PageMode != "V")
            {
                if (!EditBillingCaption.Visible)
                {
                    AddCaption.Visible  = (_PageMode == "A");
                    EditCaption.Visible = !AddCaption.Visible;
                }
                if (Request.Form["__EVENTTARGET"] != Country.UniqueID)
                {
                    ListItem defaultCountry = Country.Items.FindByValue(_SelectedCountryCode);
                    if (defaultCountry != null)
                    {
                        Country.SelectedIndex = Country.Items.IndexOf(defaultCountry);
                    }
                    CountryChanged(null, null);
                }
                FormPanel.Visible = true;
                AddPanelPopup.Show();
            }
            else
            {
                FormPanel.Visible = false;
                AddPanelPopup.Hide();
                _ShowProvinceList = false;
            }
            SaveCustomViewState();
        }