private void btnLuuKH_Click(object sender, EventArgs e) { TaiKhoan TaiKhoan = new TaiKhoan() { TenDayDu = TexTenDayDu.Text + "", GioiTinh = texGioitinh.Text + "", DienThoai = texDienThoai.Text + "" }; HienThiMatKhauBLL hienThiMatKhauBLL = new HienThiMatKhauBLL(); foreach (TaiKhoan taikhoan in hienThiMatKhauBLL.HienThiDanhSachTaiKhoan()) { if (taikhoan.TenTaiKhoan == TexTaiKhoan.Text) { MessageBox.Show("Tài Khoản Đã Tồn Tại"); return; } else { TaiKhoan.TenTaiKhoan = TexTaiKhoan.Text; } } if (TexMatKhau.Text == "") { MessageBox.Show("Bạn Cần Nhập Mật Khẩu"); return; } else { MaHoa maHoa = new MaHoa(); TaiKhoan.MatKhau = maHoa.ToMD5(TexMatKhau.Text); } if (cbHienThi.Text == "") { MessageBox.Show("Chưa Chọn Hiển Thị"); return; } else { TaiKhoan.HienThi = bool.Parse(cbHienThi.Text); } hienThiMatKhauBLL.ThemThongTinNguoiDung(TaiKhoan); TexTaiKhoan.Text = ""; TexMatKhau.Text = ""; TexTenDayDu.Text = ""; texGioitinh.Text = ""; texDienThoai.Text = ""; cbHienThi.Text = ""; HienThiNguoiDung(hienThiMatKhauBLL.HienThiDanhSachTaiKhoan()); }
public UCNguoiDung() { InitializeComponent(); HienThiMatKhauBLL hienThiMatKhauBLL = new HienThiMatKhauBLL(); HienThiNguoiDung(hienThiMatKhauBLL.HienThiDanhSachTaiKhoan()); }
private void btnDanhSach_Click(object sender, EventArgs e) { HienThiMatKhauBLL hienThiMatKhauBLL = new HienThiMatKhauBLL(); HienThiNguoiDung(hienThiMatKhauBLL.HienThiDanhSachTaiKhoan()); }