private void tmiTongQuan_Click(object sender, EventArgs e) { if (bDangNhapThanhCong && this.ActiveMdiChild != frmTongQuan) { try { this.ActiveMdiChild.Close(); } catch (Exception) { } frmTongQuan = new FTongQuan(strMaSV); frmTongQuan.FormBorderStyle = FormBorderStyle.FixedToolWindow; frmTongQuan.WindowState = FormWindowState.Maximized; frmTongQuan.MdiParent = this; frmTongQuan.Show(); tmiTongQuan.DropDown.Hide(); return; } ttxtTaiKhoan.Focus(); ttxtTaiKhoan.SelectAll(); }
private void tmiDangNhap_Click(object sender, EventArgs e) { bool bCheck = CAccountSinhVien_BLL.checkAccount(ttxtTaiKhoan.Text, ttxtMatKhau.Text); if (bCheck == false) { MessageBox.Show("Đăng nhập thất bại."); bDangNhapThanhCong = false; return; } frmEmpty.Dispose(); try { this.ActiveMdiChild.Close(); } catch (Exception) {} bDangNhapThanhCong = true; this.strMaSV = ttxtTaiKhoan.Text; //Tim ten sinh vien lblTenSV.Text = CSinhVien_BLL.loadTenSinhVien(strMaSV); lblTenSV.Location = new Point(this.Size.Width - 75 - lblTenSV.Width, lblTenSV.Location.Y); frmTongQuan = new FTongQuan(strMaSV); frmTongQuan.FormBorderStyle = FormBorderStyle.FixedToolWindow; frmTongQuan.WindowState = FormWindowState.Maximized; frmTongQuan.MdiParent = this; frmTongQuan.Show(); tmiDangNhap.Visible = false; đăngKýToolStripMenuItem.Visible = false; ttxtMatKhau.Visible = false; ttxtTaiKhoan.Visible = false; tmiDangXuatTongQuan.Visible = true; lblTenSV.Visible = true; }