Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                HttpCookie usernameCookie = Request.Cookies["UserName"];
                if ((usernameCookie != null) && !string.IsNullOrEmpty(usernameCookie.Value))
                {
                    UserName.Text            = usernameCookie.Value;
                    RememberUserName.Checked = true;
                    Password.Focus();
                }
                else
                {
                    UserName.Focus();
                }
                PasswordExpiredPanel.Visible = false;
                ForgotPasswordPanel.Visible  = false;
                EmailSentPanel.Visible       = false;
                CustomerPasswordPolicy policy = new CustomerPasswordPolicy();
                trCaptchaField.Visible = policy.ImageCaptcha;
                trCaptchaImage.Visible = policy.ImageCaptcha;
            }

            AbleCommerce.Code.PageHelper.ConvertEnterToTab(UserName);
            // SET DEFALUT BUTTONS FOR INPUT FIELDS
            if (trCaptchaImage.Visible)
            {
                AbleCommerce.Code.PageHelper.ConvertEnterToTab(Password);
                WebControl inputControl = CaptchaImage.FindControl("CaptchaInput") as WebControl;
                if (inputControl != null)
                {
                    AbleCommerce.Code.PageHelper.SetDefaultButton(inputControl, LoginButton.ClientID);
                }
            }
            else
            {
                AbleCommerce.Code.PageHelper.SetDefaultButton(Password, LoginButton.ClientID);
            }

            bool hasDigitalGoods  = _Basket.Items.HasDigitalGoods();
            bool hasSubscriptions = _Basket.Items.HasSubscriptions();

            if (hasDigitalGoods || hasSubscriptions)
            {
                GuestCheckoutPanel.Visible = _settings.AllowAnonymousCheckout && _settings.AllowAnonymousCheckoutForDigitalGoods;
            }
            else
            {
                GuestCheckoutPanel.Visible = _settings.AllowAnonymousCheckout;
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            InstructionText.Text = string.Format(InstructionText.Text, AbleContext.Current.Store.Name);
            if (!Page.IsPostBack)
            {
                HttpCookie usernameCookie = Request.Cookies["UserName"];
                if ((usernameCookie != null) && !string.IsNullOrEmpty(usernameCookie.Value))
                {
                    UserName.Text            = usernameCookie.Value;
                    RememberUserName.Checked = true;
                    Password.Focus();
                }
                else
                {
                    UserName.Focus();
                }
                PasswordExpiredPanel.Visible = false;
                ForgotPasswordPanel.Visible  = false;
                EmailSentPanel.Visible       = false;
                CustomerPasswordPolicy policy = new CustomerPasswordPolicy();
                trCaptchaField.Visible = policy.ImageCaptcha;
                trCaptchaImage.Visible = policy.ImageCaptcha;
            }

            AbleCommerce.Code.PageHelper.ConvertEnterToTab(UserName);
            // SET DEFALUT BUTTONS FOR INPUT FIELDS
            if (trCaptchaImage.Visible)
            {
                AbleCommerce.Code.PageHelper.ConvertEnterToTab(Password);
                WebControl inputControl = CaptchaImage.FindControl("CaptchaInput") as WebControl;
                if (inputControl != null)
                {
                    AbleCommerce.Code.PageHelper.SetDefaultButton(inputControl, LoginButton.ClientID);
                }
            }
            else
            {
                AbleCommerce.Code.PageHelper.SetDefaultButton(Password, LoginButton.ClientID);
            }
        }