public frmMain() { InitializeComponent(); frmDangNhap f = new frmDangNhap(); f.MdiParent = this; f.Show(); unEnableButton(); btnTaoLogin.Enabled = false; btnDangXuat.Enabled = false; }
private void btnDangNhap_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Form frm = this.CheckExists(typeof(frmDangNhap)); if (frm != null) { frm.Activate(); } else { frmDangNhap f = new frmDangNhap(); f.MdiParent = this; f.Show(); } }
private void btnDangXuat_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { // Kiểm tra nếu form nào đang tồn tại thì tắt Form frmDN = this.CheckExists(typeof(frmDangNhap)); Form frmDiem = this.CheckExists(typeof(frmDiem)); Form frmHocPhi = this.CheckExists(typeof(frmHocPhi)); Form frmLop = this.CheckExists(typeof(frmLop)); Form frmMonHoc = this.CheckExists(typeof(frmMonHoc)); Form frmSV = this.CheckExists(typeof(frmSinhVien)); Form frmTaoLogin = this.CheckExists(typeof(frmTaoLogin)); Form Frpt_BangDiemMonHoc = this.CheckExists(typeof(Report.Frpt_BangDiemMonHoc)); Form Frpt_BangDiemTongKet = this.CheckExists(typeof(Report.Frpt_BangDiemTongKet)); Form Frpt_DanhSachDongHP = this.CheckExists(typeof(Report.Frpt_DanhSachDongHP)); Form Frpt_DsThiHetMon = this.CheckExists(typeof(Report.Frpt_DsThiHetMon)); Form Frpt_InDanhSachSinhVienLOP = this.CheckExists(typeof(Report.Frpt_InDanhSachSinhVienLOP)); Form Frpt_PhieuDiemSV = this.CheckExists(typeof(Report.Frpt_PhieuDiemSV)); if (frmDN != null) { frmDN.Close(); frmDangNhap f = new frmDangNhap(); f.MdiParent = this; f.Show(); this.MAGV.Text = ""; this.HOTEN.Text = ""; this.NHOM.Text = ""; unEnableButton(); btnDangXuat.Enabled = false; btnTaoLogin.Enabled = false; } if (frmDiem != null) { frmDiem.Close(); } if (frmHocPhi != null) { frmHocPhi.Close(); } if (frmMonHoc != null) { frmMonHoc.Close(); } if (frmLop != null) { frmLop.Close(); } if (frmSV != null) { frmSV.Close(); } if (frmTaoLogin != null) { frmTaoLogin.Close(); } if (Frpt_BangDiemMonHoc != null) { Frpt_BangDiemMonHoc.Close(); } if (Frpt_BangDiemTongKet != null) { Frpt_BangDiemTongKet.Close(); } if (Frpt_DanhSachDongHP != null) { Frpt_DanhSachDongHP.Close(); } if (Frpt_DsThiHetMon != null) { Frpt_DsThiHetMon.Close(); } if (Frpt_InDanhSachSinhVienLOP != null) { Frpt_InDanhSachSinhVienLOP.Close(); } if (Frpt_PhieuDiemSV != null) { Frpt_PhieuDiemSV.Close(); } }