Example #1
0
        private void btnRegister_Click(object sender, EventArgs e)
        {
            UserAccountManagerBLL accountBLL = new UserAccountManagerBLL();
            Users newUser = new Users();

            newUser.FirstName = txtFname.Text;
            newUser.Surname = txtSname.Text;
            newUser.Email = txtEmail.Text;
            // Userpassword is encrypted using SHA1();
            if (txtPassword.Text == txtConfirmPass.Text)
            {
                newUser.Password = txtConfirmPass.Text; //EncryptPassword.Encrypt(txtConfirmPass.Text);

                if (accountBLL.NewUser(newUser))
                {
                    MessageBox.Show("Registration Successful", "Success");
                    pbDropBox.Visible = true;
                    lblLinkDropBox.Visible = true;
                    btnDone.Visible = true;
                    btnRegister.Visible = false;
                    success = true;
                }
            }
            else
            {
                MessageBox.Show("Your passwords don't match!", "Error");
            }
        }