private void btnDongY_Click(object sender, EventArgs e) { string pass = nguoiDungBUS.GetPassword(username); string oldPass = txtMatKhauCu.Text; if (string.Compare(pass, oldPass) != 0) { XtraMessageBox.Show("Mật Khẩu cũ không đúng!", "Sai Mật Khẩu", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (string.Compare(txtMatKhauMoi.Text, txtNhapLaiMK.Text) != 0) { XtraMessageBox.Show("Mật khẩu nhập lại không trùng khớp!", "Hệ thống", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { int kq = nguoiDungBUS.CapNhatMatKhau(username, txtMatKhauMoi.Text); if (kq >= 1) { AddNhatKy("Cập nhật"); XtraMessageBox.Show("Đổi mật khẩu thành công!", "Hoàn thành", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("Đổi mật khẩu thất bại!", "Hệ thống", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }