Ejemplo n.º 1
0
        protected void HandleClickRegister(object sender, EventArgs e)
        {
            string name            = tbName.Text.Trim();
            string email           = tbEmail.Text.Trim();
            string password        = tbPassword.Text.Trim();
            string confirmPassword = tbConfirmPassword.Text.Trim();

            if (!password.Equals(confirmPassword))
            {
                lbError.Text = "Incorect confirm password";
                return;
            }

            ResponseRegisterDTO result = AuthBLL.Register(new UsersDTO
            {
                Name     = name,
                Email    = email,
                Password = password,
                Role     = Role.Employee
            });

            if (!result.Success)
            {
                lbError.Text = result.Error;
            }
            else
            {
                Response.Redirect("/login");
            }
        }