public frmAddThietBi(Phong obj, bool _loaichung) { InitializeComponent(); loaichung = _loaichung; _ucQuanLyThietBi.Dock = DockStyle.Fill; _ucQuanLyThietBi.loadData(loaichung); panelControl1.Controls.Add(_ucQuanLyThietBi); objPhong = obj; dateEdit1.DateTime = DateTime.Now; }
private void ribbonMain_SelectedPageChanged(object sender, EventArgs e) { if (drawEnd) { DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false); DevExpress.XtraSplashScreen.SplashScreenManager.Default.SetWaitFormCaption("Đang tải dữ liệu..."); try { DBInstance.reNew(); if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName("rbnPageViTri_Home"))) { _ucQuanLyViTri.loadData(); navBarGroupQLPhong.ControlContainer.Controls.Clear(); panelControl1.Controls.Clear(); panelControl1.Controls.Add(_ucQuanLyViTri); } else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName("rbnPageNhanVien_Home"))) { _ucQuanLyNhanVien.loadData(); navBarGroupQLPhong.ControlContainer.Controls.Clear(); panelControl1.Controls.Clear(); panelControl1.Controls.Add(_ucQuanLyNhanVien); } else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName("rbnPageLoaiTB_Home"))) { _ucQuanLyLoaiTB.reLoad(); navBarGroupQLPhong.ControlContainer.Controls.Clear(); panelControl1.Controls.Clear(); panelControl1.Controls.Add(_ucQuanLyLoaiTB); } else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName("rbnPageThietBi_Home"))) { //_ucQuanLyThietBi.loadData(true); _ucQuanLyThietBi.loadData(0, true); navBarGroupQLPhong.ControlContainer.Controls.Clear(); _ucQuanLyThietBi.getControl().Parent = navBarGroupQLPhong.ControlContainer; panelControl1.Controls.Clear(); panelControl1.Controls.Add(_ucQuanLyThietBi); } else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName("rbnPagePhongThietbi_Home"))) { navBarGroupQLPhong.ControlContainer.Controls.Clear(); _ucQuanLyPhongThietBi.getTreeList().Parent = navBarGroupQLPhong.ControlContainer; if (!open) { _ucQuanLyPhongThietBi.loadData(); } else { _ucQuanLyPhongThietBi.loadData(objPhong.reload()); } panelControl1.Controls.Clear(); panelControl1.Controls.Add(_ucQuanLyPhongThietBi); } else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName("rbnPagePhanQuyen_Home"))) { //_ucPhanQuyen.loadData(); _ucPhanQuyen.reLoad(); navBarGroupQLPhong.ControlContainer.Controls.Clear(); _ucPhanQuyen.getControl().Parent = navBarGroupQLPhong.ControlContainer; panelControl1.Controls.Clear(); panelControl1.Controls.Add(_ucPhanQuyen); } else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName("rbnPagePhong_Home"))) { navBarGroupQLPhong.ControlContainer.Controls.Clear(); _ucQuanLyPhong.getTreeList().Parent = navBarGroupQLPhong.ControlContainer; _ucQuanLyPhong.loadData(); panelControl1.Controls.Clear(); panelControl1.Controls.Add(_ucQuanLyPhong); } else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName("rbnPageThongKe_Home"))) { _ucTK_SLTB_TheoTinhTrang.loadData(); navBarGroupQLPhong.ControlContainer.Controls.Clear(); panelControl1.Controls.Clear(); panelControl1.Controls.Add(_ucTK_SLTB_TheoTinhTrang); } else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName("rbnPageSuCoPhong"))) { navBarGroupQLPhong.ControlContainer.Controls.Clear(); _ucQuanLySuCo.getTreeList().Parent = navBarGroupQLPhong.ControlContainer; if (!open) { _ucQuanLySuCo.loadData(); } else { _ucQuanLySuCo.loadData(objPhong.reload()); } panelControl1.Controls.Clear(); panelControl1.Controls.Add(_ucQuanLySuCo); } else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName("rbnPagePhanCongQTV_Home"))) { _ucPhanCongQTV.loadData(); navBarGroupQLPhong.ControlContainer.Controls.Clear(); panelControl1.Controls.Clear(); panelControl1.Controls.Add(_ucPhanCongQTV); } else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName("rbnPageTinhTrang_Home"))) { _ucQuanLyTinhTrang.loadData(true); navBarGroupQLPhong.ControlContainer.Controls.Clear(); navBarGroupQLPhong.ControlContainer.Controls.Add(_ucQuanLyTinhTrang.getControl()); panelControl1.Controls.Clear(); panelControl1.Controls.Add(_ucQuanLyTinhTrang); } else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName("rbnPageLogHeThong"))) { _ucLogHeThong.loadData(); navBarGroupQLPhong.ControlContainer.Controls.Clear(); panelControl1.Controls.Clear(); panelControl1.Controls.Add(_ucLogHeThong); } } catch (Exception ex) { System.Console.WriteLine(this.Name + ": ribbonMain_SelectedPageChanged :" + ex.Message); } DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm(false); } }