protected void LoadStep(bool loadData)
    {
        // If user logged in, edit the customer data
        if (!ShoppingCartControl.UserInfo.IsPublic())
        {
            plcEditCustomer.Visible = true;
            plcEditOrgID.Visible    = mShowOrganizationIDField;
            plcEditTaxRegID.Visible = mShowTaxRegistrationIDField;
            plcAccount.Visible      = false;

            if (loadData)
            {
                LoadData();
            }
        }
        else
        {
            // Display/Hide the form for anonymous customer
            if (SiteContext.CurrentSite != null)
            {
                plhAnonymous.Visible = ECommerceSettings.AllowAnonymousCustomers(SiteContext.CurrentSite.SiteName);
            }

            if (!ShoppingCartControl.IsCurrentStepPostBack)
            {
                // If anonymous customer data were already saved -> display them
                if ((plhAnonymous.Visible) && (ShoppingCart.ShoppingCartCustomerID > 0))
                {
                    // Mark 'Continue as anonymous customer' radio button
                    radAnonymous.Checked = true;

                    LoadAnonymousCustomerData();
                }
                else
                {
                    // Mark 'Sign in using your existing account' radio button
                    radSignIn.Checked = true;
                }
            }

            plcEditCustomer.Visible = false;
            plcAccount.Visible      = true;

            plcTaxRegistrationID.Visible = mShowTaxRegistrationIDField;
            plcOrganizationID.Visible    = mShowOrganizationIDField;

            plcTaxRegistrationID2.Visible = mShowTaxRegistrationIDField;
            plcOrganizationID2.Visible    = mShowOrganizationIDField;

            // Set strings
            lnkPasswdRetrieval.Text = GetString("LogonForm.lnkPasswordRetrieval");
            lblPasswdRetrieval.Text = GetString("LogonForm.lblPasswordRetrieval");
            btnPasswdRetrieval.Text = GetString("LogonForm.btnPasswordRetrieval");

            lnkPasswdRetrieval.Visible = ShoppingCartControl.EnablePasswordRetrieval;
            btnPasswdRetrieval.Click  += btnPasswdRetrieval_Click;

            pnlPasswdRetrieval.Attributes.Add("style", "display:none;");
        }
    }
Exemple #2
0
    protected void LoadStep(bool loadData)
    {
        // If user logged in, edit the customer data
        if (!this.ShoppingCartControl.UserInfo.IsPublic())
        {
            this.plcEditCustomer.Visible = true;
            this.plcEditOrgID.Visible    = mShowOrganizationIDField;
            this.plcEditTaxRegID.Visible = mShowTaxRegistrationIDField;
            this.plcAccount.Visible      = false;
            this.lblTitle.Text           = GetString("ShoppingCart.CheckRegistrationEdit");

            if (loadData)
            {
                LoadData();
            }
        }
        else
        {
            // Display/Hide the form for anonymous customer
            if (CMSContext.CurrentSite != null)
            {
                plhAnonymous.Visible = ECommerceSettings.AllowAnonymousCustomers(CMSContext.CurrentSite.SiteName);
            }

            if (!this.ShoppingCartControl.IsCurrentStepPostBack)
            {
                // If anonymous customer data were already saved -> display them
                if ((plhAnonymous.Visible) && (this.ShoppingCartInfoObj.ShoppingCartCustomerID > 0))
                {
                    // Mark 'Continue as anonymous customer' radio button
                    radAnonymous.Checked = true;

                    // Disable 'Sign in' section
                    //AvailabilityOfSignInSection(false);
                    // Disable 'New registration' section
                    //AvailabilityOfNewRegistrationSection(false);
                    // Enable 'Continue as anonymous customer' section
                    //AvailabilityOfAnonymousSection(true);

                    LoadAnonymousCustomerData();
                }
                else
                {
                    // Mark 'Sign in using your existing account' radio button
                    radSignIn.Checked = true;

                    // Enable 'Sign in' section
                    //AvailabilityOfSignInSection(true);
                    // Disable 'New registration' section
                    //AvailabilityOfNewRegistrationSection(false);
                    // Disable 'Continue as anonymous customer' section
                    //AvailabilityOfAnonymousSection(false);
                }
            }

            this.plcEditCustomer.Visible = false;
            this.plcAccount.Visible      = true;

            this.plcTaxRegistrationID.Visible = this.mShowTaxRegistrationIDField;
            this.plcOrganizationID.Visible    = this.mShowOrganizationIDField;

            this.plcTaxRegistrationID2.Visible = this.mShowTaxRegistrationIDField;
            this.plcOrganizationID2.Visible    = this.mShowOrganizationIDField;

            this.lblTitle.Text = GetString("ShoppingCart.CheckRegistration");


            // Set strings
            lnkPasswdRetrieval.Text = GetString("LogonForm.lnkPasswordRetrieval");
            lblPasswdRetrieval.Text = GetString("LogonForm.lblPasswordRetrieval");
            btnPasswdRetrieval.Text = GetString("LogonForm.btnPasswordRetrieval");
            rqValue.ErrorMessage    = GetString("LogonForm.rqValue");


            this.lnkPasswdRetrieval.Visible = this.ShoppingCartControl.EnablePasswordRetrieval;
            btnPasswdRetrieval.Click       += new EventHandler(btnPasswdRetrieval_Click);

            this.pnlPasswdRetrieval.Attributes.Add("style", "display:none;");
            //this.pnlCompanyAccount1.Attributes.Add("style", "display:none;");
            //this.pnlCompanyAccount2.Attributes.Add("style", "display:none;");
        }

        //this.TitleText = GetString("Order_new.ShoppingCartCheckRegistration.Title");
    }