Exemple #1
0
        private void btn_signup_Click(object sender, EventArgs e)
        {
            if (txtPassword.Text != "" && txtPasswordConfrim.Text != "" && txtUserName.Text != "")
            {
                if (txtPassword.Text == txtPasswordConfrim.Text)
                {
                    if (SysAccount.CreateAccount(txtUserName.Text, txtPassword.Text))
                    {
                        MessageBox.Show("Tạo tài khoản thành công", "Thành công!");
                        this.Hide();
                        this.Close();
                    }

                    else
                    {
                        MessageBox.Show("Tên tài khoản đã đăng ký", "Lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Mật khẩu xác nhận chưa trùng với mật khẩu", "Lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Phải điền đầy đủ thông tin các ô", "Lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 private void btnCreate_Click(object sender, EventArgs e)
 {
     if (btnCreate.Text == "Tạo tài khoản")
     {
         if (txtPassword.Text != txtReTypePass.Text)
         {
             MessageBox.Show("Mật khẩu gõ lại chưa chính xác!", "Thông báo");
         }
         else
         {
             if ((txtSuperAdminPass.Text).ToUpper() != Utility.SUPER_ADMIN_PASSWORD)
             {
                 MessageBox.Show("Mật khẩu Super Admin chưa chính xác!", "Thông báo");
             }
             else
             {
                 if (SysAccount.CreateAccount(txtUserName.Text, txtPassword.Text))
                 {
                     MessageBox.Show("Tạo tài khoản thành công", "Thành công!");
                 }
                 else
                 {
                     MessageBox.Show("Tạo tài khoản thất bại", "Lỗi!");
                 }
             }
         }
     }
     else
     {
         if (txtUserName.TextLength * txtPassword.TextLength == 0)
         {
             MessageBox.Show("Hãy điền hết các ô!", "Thông báo");
         }
         else
         {
             if (txtPassword.Text != txtReTypePass.Text)
             {
                 MessageBox.Show("Mật khẩu gõ lại chưa chính xác!", "Thông báo");
             }
             else
             {
                 if (!SysAccount.CheckOldPass(txtUserName.Text, txtSuperAdminPass.Text))
                 {
                     MessageBox.Show("Mật khẩu cũ bạn nhập chưa chính xác!", "Thông báo");
                 }
                 else
                 {
                     if (SysAccount.UpdateAccount(txtUserName.Text, txtPassword.Text))
                     {
                         MessageBox.Show("Sửa tài khoản thành công", "Thành công!");
                     }
                     else
                     {
                         MessageBox.Show("Sửa tài khoản thất bại", "Lỗi!");
                     }
                 }
             }
         }
     }
 }
Exemple #3
0
 private void btnCreate_Click(object sender, EventArgs e)
 {
     if (SysAccount.CreateAccount(txtUserName.Text, txtPassword.Text))
     {
         MessageBox.Show("Tạo tài khoản thành công", "Thành công!");
     }
     else
     {
         MessageBox.Show("Tạo tài khoản thất bại", "Thành công!");
     }
 }