Exemple #1
0
    void PopulateZipCityState()
    {
        this.ShipZipCityState.Items.Clear();
        this.ShipZipCityState.DataSource     = Vortx.OnePageCheckout.WebService.ZipServiceUtility.GetInfoByZip(ShipZip.Text);
        this.ShipZipCityState.DataTextField  = "DisplayValue";
        this.ShipZipCityState.DataValueField = "DisplayValue";
        this.ShipZipCityState.DataBind();

        if (ShipZipCityState.Items.Count <= 0)
        {
            PopulateOtherCountries();
            PopulateOtherStates();
            ToggleOtherCityState(true, false);
        }
        else
        {
            // add other option
            this.ShipZipCityState.Items.Add(new ListItem(StringResourceProvider.GetString("smartcheckout.aspx.122"), "Other"));

            // toggle dynamic city/state display
            ToggleOtherCityState(false, true);

            // hide the 'Enter zip for City and State.' message
            this.EnterZip.Visible = false;
        }
    }
    public override void BindView()
    {
        if (this.Model.RegisterAccountSelected)
        {
            this.PanelCreateAccount.Visible           = this.Model.RegisterAccount;
            this.CreateAccountPassword.Enabled        = this.Model.RegisterAccount;
            this.CreateAccountPasswordConfirm.Enabled = this.Model.RegisterAccount;

            this.RadioCreateAccountYes.Checked = this.Model.RegisterAccount;
            this.RadioCreateAccountNo.Checked  = !this.Model.RegisterAccount;

            if (!string.IsNullOrEmpty(this.Model.Password))
            {
                this.CreateAccountPassword.Attributes.Add("value", this.Model.Password);
                this.CreateAccountPasswordConfirm.Attributes.Add("value", this.Model.Password);
            }

            if (this.Model.IsRegistered)
            {
                this.PanelCreateAccount.Visible           = true;
                this.RadioCreateAccountYes.Enabled        = false;
                this.CreateAccountPassword.Enabled        = false;
                this.CreateAccountPasswordConfirm.Enabled = false;
                this.CreateAccountButton.Enabled          = false;

                this.CreateAccountPassword.Text            = "********";
                this.CreateAccountPassword.TextMode        = TextBoxMode.SingleLine;
                this.CreateAccountPasswordConfirm.Text     = "********";
                this.CreateAccountPasswordConfirm.TextMode = TextBoxMode.SingleLine;

                ShowError(StringResourceProvider.GetString("smartcheckout.aspx.126"));
            }
        }
    }
Exemple #3
0
    private void PopulateShippingMethods()
    {
        IEnumerable <IShippingMethod> shippingMethods = this.Model.ShippingMethods;
        var customer = AspDotNetStorefrontCore.Customer.Current;

        if (!customer.HasAtLeastOneAddress() ||
            (string.IsNullOrEmpty(customer.PrimaryShippingAddress.City) &&
             string.IsNullOrEmpty(customer.PrimaryShippingAddress.State) &&
             string.IsNullOrEmpty(customer.PrimaryShippingAddress.Country)))
        {
            ShowError(StringResourceProvider.GetString("smartcheckout.aspx.153"));
            ShippingMethods.Items.Clear();
            this.Disable();
            return;
        }

        if (shippingMethods.Count() <= 0)
        {
            if (!string.IsNullOrEmpty(this.Model.LastShippingMethodError))
            {
                if (AppLogic.AppConfigBool("Vortx.OnePageCheckout.AllowRTShipping.NoMethodSelected"))
                {
                    ShowError(StringResourceProvider.GetString("smartcheckout.aspx.165"));
                }
                else
                {
                    ShowError(this.Model.LastShippingMethodError);
                }
            }
            else
            {
                ShowError(StringResourceProvider.GetString("smartcheckout.aspx.131"));
            }
            ShippingMethods.Items.Clear();
            this.Disable();
            return;
        }

        if (CartContentsChanged && shippingMethods.Count() > 0)
        {
            ShowErrorWithCss(StringResourceProvider.GetString("smartcheckout.aspx.166"), "error-wrap");
        }
        else
        {
            PanelError.CssClass = string.Empty;
            PanelError.Visible  = false;
        }

        ShippingMethods.DataSource     = shippingMethods;
        ShippingMethods.DataTextField  = "DisplayName";
        ShippingMethods.DataValueField = "Identifier";
        ShippingMethods.DataBind();
    }
Exemple #4
0
    private void ShowNotAuthenticated()
    {
        PanelUsername.Visible = true;
        PanelPassword.Visible = true;

        PanelError.Visible     = true;
        PanelNoAccount.Visible = false;

        PanelCreateNewPassword.Visible = false;

        txtEmailAddress.Visible = true;
        txtEmailAddress.Enabled = false;
        PageUtility.AddClass(txtEmailAddress, "disabled");

        btnEmailSubmit.Visible = false;
        btnEmailSubmit.Enabled = false;

        btnPasswordSubmit.Visible = true;
        btnPasswordSubmit.Enabled = true;

        ButtonForgotPassword.Visible = true;
        ButtonForgotPassword.Enabled = true;

        LabelForgotPasswordResults.Visible = false;
        LostPasswordResults.Visible        = false;

        if (PaymentModel.ActivePaymentMethod != null &&
            PaymentModel.ActivePaymentMethod.PaymentType == PaymentType.PayPalExpress &&
            ((PaypalExpressPaymentModel)this.PaymentModel.ActivePaymentMethod).ExpressLoginComplete)
        {
            linkSwitchUser.Visible = false;
        }
        else
        {
            linkSwitchUser.Visible = true;
            linkSwitchUser.Enabled = true;
        }

        txtPassword.Visible  = true;
        txtPassword.Enabled  = true;
        txtPassword.TextMode = TextBoxMode.Password;
        PageUtility.RemoveClass(txtPassword, "disabled");

        txtEmailAddress.Text    = this.AccountModel.Username;
        lblError.Text           = StringResourceProvider.GetString("smartcheckout.aspx.128");
        EmailHelperText.Visible = false;

        PageUtility.RegisterFocusScript(this, txtPassword);
    }
Exemple #5
0
    private void Model_RegisterCompleted(object sender, EventArgs args)
    {
        this.PanelCreateAccount.Visible           = true;
        this.RadioCreateAccountYes.Enabled        = false;
        this.CreateAccountPassword.Enabled        = false;
        this.CreateAccountPasswordConfirm.Enabled = false;
        CreateAccountButton.Enabled = false;

        this.CreateAccountPassword.Text            = "********";
        this.CreateAccountPassword.TextMode        = TextBoxMode.SingleLine;
        this.CreateAccountPasswordConfirm.Text     = "********";
        this.CreateAccountPasswordConfirm.TextMode = TextBoxMode.SingleLine;


        ShowError(StringResourceProvider.GetString("smartcheckout.aspx.126"));
    }
Exemple #6
0
    public override void Initialize()
    {
        PanelUsername.Visible  = true;
        PanelPassword.Visible  = false;
        PanelError.Visible     = false;
        PanelNoAccount.Visible = false;

        txtEmailAddress.Visible = true;
        txtEmailAddress.Enabled = true;
        txtEmailAddress.Text    = String.Empty;

        PanelCreateNewPassword.Visible = false;

        txtPassword.Visible = false;
        txtPassword.Enabled = false;
        PageUtility.AddClass(txtPassword, "disabled");
        PageUtility.RemoveClass(txtEmailAddress, "disabled");

        txtPassword.Text = String.Empty;

        trConfirmEmail.Visible = false;

        btnEmailSubmit.Visible = true;
        btnEmailSubmit.Enabled = true;

        btnPasswordSubmit.Visible = false;
        btnPasswordSubmit.Enabled = false;

        ButtonForgotPassword.Visible = false;
        ButtonForgotPassword.Enabled = false;

        LostPasswordResults.Visible        = false;
        LabelForgotPasswordResults.Visible = false;

        linkSwitchUser.Visible = false;
        linkSwitchUser.Enabled = false;

        btnSkipLogin.Visible = false;
        btnSkipLogin.Enabled = false;

        EmailHelperText.Visible = true;

        if (!ConfigurationProvider.DefaultProvider.PasswordIsOptionalDuringCheckout)
        {
            lblNoAccount.Text = StringResourceProvider.GetString("smartcheckout.aspx.127");
        }
    }
Exemple #7
0
    private void PopulateShippingMethods()
    {
        IEnumerable <IShippingMethod> shippingMethods = this.ShoppingCartModel.ShippingMethods;

        if (shippingMethods.Count() <= 0)
        {
            ShowError(StringResourceProvider.GetString("smartcheckout.aspx.131"));
            ShippingMethods.Items.Clear();
            this.Disable();
        }
        else
        {
            PanelError.Visible             = false;
            ShippingMethods.DataSource     = shippingMethods;
            ShippingMethods.DataTextField  = "DisplayName";
            ShippingMethods.DataValueField = "Identifier";
            ShippingMethods.DataBind();
        }
    }
 private void PopulateZipCityState()
 {
     this.BillZipCityState.Items.Clear();
     this.BillZipCityState.DataSource     = Vortx.OnePageCheckout.WebService.ZipServiceUtility.GetInfoByZip(BillZip.Text);
     this.BillZipCityState.DataTextField  = "DisplayValue";
     this.BillZipCityState.DataValueField = "DisplayValue";
     this.BillZipCityState.DataBind();
     if (BillZipCityState.Items.Count <= 0)
     {
         PopulateOtherCountries();
         PopulateOtherStates();
         ToggleOtherCityState(true, false);
     }
     else
     {
         this.BillZipCityState.Items.Add(new ListItem(StringResourceProvider.GetString("smartcheckout.aspx.122"), "Other"));
         ToggleOtherCityState(false, true);
         this.EnterZip.Visible = false;
     }
 }