private void btnDangNhap_Click(object sender, EventArgs e) { if (txtMatKhau.Text != null && txtTaiKhoan.Text != null) { TaiKhoanDTO TaiKhoanGlobal = new TaiKhoanDTO(); if (tkbus.KiemTraDangNhap(out TaiKhoanGlobal, txtTaiKhoan.Text, txtMatKhau.Text)) { frmHome frmH = new frmHome(TaiKhoanGlobal); frmH.ShowDialog(); } else { MessageBox.Show("Tên Đăng nhập Hoặc Mật Khẩu không Đúng!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error); txtMatKhau.Text = string.Empty; txtTaiKhoan.Text = string.Empty; } } else { MessageBox.Show("Thông Tin Nhập Còn Thiếu Vui Lòng Điền Đủ!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void btnDangNhap_Click(object sender, EventArgs e) { if (txtMatKhau.Text != null && txtTaiKhoan.Text != null) { TaiKhoanDTO TaiKhoanGlobal = new TaiKhoanDTO(); if (tkbus.KiemTraDangNhap(out TaiKhoanGlobal, txtTaiKhoan.Text, txtMatKhau.Text)) { frmHome frmH = new frmHome(TaiKhoanGlobal); //this.Close(); frmH.ShowDialog(); } else { MessageBox.Show(Instance.TBTTDNKhongDung, Instance.ThongBao, MessageBoxButtons.OK, MessageBoxIcon.Error); txtMatKhau.Text = string.Empty; txtTaiKhoan.Text = string.Empty; } } else { MessageBox.Show(Instance.TBNhapThieuTT, Instance.CanhBao, MessageBoxButtons.OK, MessageBoxIcon.Warning); } }