private void btthaydoi_Click(object sender, EventArgs e) { if (txtmatkhaucu.Text.Trim() != KTdangnhap.strmatkhau.Trim()) { l1.Visible = true; tam = false; } else { l1.Visible = false; tam = true; } if (txtmatkhaumoi.Text != txtnhaplai.Text) { l2.Visible = true; tam1 = false; } else { l2.Visible = false; tam1 = true; } if (tam && tam1) { Lnhanvien nv = new Lnhanvien(KTdangnhap.strmanhanvien, KTdangnhap.strhoten, KTdangnhap.strdiachi, KTdangnhap.strquyenhan, KTdangnhap.strnguoidung, KTdangnhap.strmatkhau); if (nv.doimatkhau(txtmatkhaumoi.Text) == true) { MessageBox.Show("Đã hoàn thành việc thay đôi mật khẩu", "Thông báo"); } else { MessageBox.Show("Việc thay đổi đã bị lỗi hãy thử lại sau", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Question); } } }