private void btndangnhap_Click(object sender, EventArgs e) { TaiKhoanBUS taikhoanBUS = new TaiKhoanBUS(); TaiKhoan taikhoan = new TaiKhoan(); taikhoan.Username = txtusename.Text; taikhoan.Password = txtPassword.Text; bool thanhcong = taikhoanBUS.DangNhap(taikhoan); if (thanhcong) { dadangnhap = true; frmmain.username = txtusename.Text; frmmain.gid = taikhoanBUS.GetGID(taikhoan); Dispose(); } else { MessageBox.Show("Sai thông tin đăng nhập", "Lỗi đăng nhập", MessageBoxButtons.OK, MessageBoxIcon.Error); } }