private void btn_quenMatKhau_Click(object sender, EventArgs e) { if (txt_EmailDangNhap.Text != "") { if (BUS_NHANVIEN.QuenMatKhau(txt_EmailDangNhap.Text)) { StringBuilder builder = new StringBuilder(); builder.Append(RandomString(4, true)); builder.Append(RandomNumber(1000, 9990)); builder.Append(RandomString(2, false)); MessageBox.Show(builder.ToString()); string matkhaumoi = BUS_NHANVIEN.encryption(builder.ToString()); BUS_NHANVIEN.TaoMatKhauMoi(txt_EmailDangNhap.Text, matkhaumoi); SendMail(txt_EmailDangNhap.Text, matkhaumoi); } else { MessageBox.Show("Email Không tồn tại"); } } else { MessageBox.Show("bạn cần nhập email để phục hồi mật khẩu"); txt_EmailDangNhap.Focus(); } }