示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!ECommerceContext.CheckCustomerSiteID(Customer))
        {
            EditedObject = null;
            return;
        }

        // Show info/error message after redirect.
        if (!RequestHelper.IsPostBack() && QueryHelper.GetBoolean("saved", false))
        {
            if (QueryHelper.GetBoolean("error", false))
            {
                ShowConfirmation(GetString("com.customer.logincreated"));
                ShowError(GetString("com.customer.notificationemailnotsent"));
            }
            else
            {
                ShowConfirmation(GetString("com.customer.logincreated") + " " + GetString("com.customer.notificationsent"));
            }
        }

        if (Customer.CustomerIsRegistered)
        {
            passStrength.PlaceholderText = "mem.general.changepassword";

            txtUserName.Text = HTMLHelper.HTMLEncode(Functions.GetFormattedUserName(Customer.CustomerUser.UserName));

            HeaderActions.AddHeaderAction(new SaveAction());
            HeaderActions.AddHeaderAction(new HeaderAction
            {
                Text          = GetString("com.customer.generatepassword"),
                CommandName   = "generate",
                ButtonStyle   = ButtonStyle.Default,
                OnClientClick = "return confirm(" + ScriptHelper.GetLocalizedString("com.customer.passwordchange") + ");"
            });
        }
        else
        {
            txtUserName.Text    = Customer.CustomerEmail;
            pnlPassword.Visible = false;
            lblRegistrationNotification.ResourceString = GetString("com.customer.registrednotificationgenerate");

            HeaderActions.AddHeaderAction(new HeaderAction
            {
                Text        = GetString("com.customer.createlogin"),
                CommandName = "create"
            });
        }

        HeaderActions.ActionPerformed += HeaderActions_ActionPerformed;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!ECommerceContext.CheckCustomerSiteID(Customer))
        {
            EditedObject = null;
            return;
        }

        // Show info/error message after redirect.
        if (!RequestHelper.IsPostBack() && QueryHelper.GetBoolean("saved", false))
        {
            if (QueryHelper.GetBoolean("error", false))
            {
                ShowConfirmation(GetString("com.customer.logincreated"));
                ShowError(GetString("com.customer.notificationemailnotsent"));
            }
            else
            {
                ShowConfirmation(GetString("com.customer.logincreated") + " " + GetString("com.customer.notificationsent"));
            }
        }

        if (Customer.CustomerIsRegistered)
        {
            // Fill password text boxes with password hidden value
            passStrength.TextBoxAttributes.Add("value", HIDDEN_PASSWORD);
            txtPassword2.Attributes.Add("value", HIDDEN_PASSWORD);

            txtUserName.Text = Customer.CustomerUser.UserName;

            HeaderActions.AddHeaderAction(new SaveAction(PageHelper.CurrentPage));
            HeaderActions.AddHeaderAction(new HeaderAction
            {
                Text          = GetString("com.customer.generatepassword"),
                CommandName   = "generate",
                ButtonStyle   = ButtonStyle.Default,
                OnClientClick = "return confirm(" + ScriptHelper.GetLocalizedString("com.customer.passwordchange") + ");"
            });
        }
        else
        {
            txtUserName.Text = Customer.CustomerEmail;

            HeaderActions.AddHeaderAction(new HeaderAction
            {
                Text        = GetString("com.customer.createlogin"),
                CommandName = "create"
            });
        }

        HeaderActions.ActionPerformed += HeaderActions_ActionPerformed;
    }