Exemplo n.º 1
0
        // Methods
        protected void btnRegister_Click(object sender, EventArgs e)
        {
            this.Page.Validate("Registration");
            if (this.Page.IsValid)
            {
                StringBuilder strbMeg = new StringBuilder("Please, correct the following invalid item(S)" + Utility.JS_NEW_LINE + Utility.JS_NEW_LINE);
                bool flag = true;
                flag = this.IsEmailValid(strbMeg);
                if (this.IsUserNameValid(strbMeg) && flag)
                {
                    this.oUser.Info.UserName = this.txtUserName.Text.Trim();
                    this.oUser.Info.Email = this.txtEmail.Text.Trim();

                    this.oUser.Info.Password = this.txtPassword.Text.Trim();
                    this.oUser.Info.CustRole = NRole.MEMBER;
                    Email email = new Email();
                    email.To = this.oUser.Info.Email;
                    if (this.oUser.Add()) // && !base.Request.IsLocal) && email.SendRegConfirmEmail(this.oUser.Info.Password))
                    {
                        base.BuildPopup("User " + this.oUser.Info.UserName + " has been successfully registered in Database.");
                        email.SendRegConfirmEmail(this.oUser.Info.Password, Request.IsLocal);
                    }
                }
                else
                {
                    base.BuildPopup(strbMeg.ToString());
                }
            }
        }