示例#1
0
 private void ribbonMain_SelectedPageChanged(object sender, EventArgs e)
 {
     try
     {
         if (drawEnd)
         {
             DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(this, typeof(WaitFormLoad), true, true, false);
             DevExpress.XtraSplashScreen.SplashScreenManager.Default.SetWaitFormCaption("Đang tải dữ liệu...");
             DBInstance.reNew();
             if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName(rbnPageViTri)))
             {
                 _ucQuanLyViTri.loadData();
                 panelControlMain.Controls.Clear();
                 panelControlMain.Controls.Add(_ucQuanLyViTri);
             }
             else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName(rbnPagePhong)))
             {
                 _ucQuanLyPhong.loadData();
                 panelControlMain.Controls.Clear();
                 panelControlMain.Controls.Add(_ucQuanLyPhong);
             }
             else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName(rbnPageDonVi)))
             {
                 _ucQuanLyDonVi.loadData();
                 panelControlMain.Controls.Clear();
                 panelControlMain.Controls.Add(_ucQuanLyDonVi);
             }
             else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName(rbnPageLoaiTS)))
             {
                 _ucQuanLyLoaiTS.loadData();
                 panelControlMain.Controls.Clear();
                 panelControlMain.Controls.Add(_ucQuanLyLoaiTS);
             }
             //else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName(rbnPageTaiSan)))
             //{
             //    _ucQuanLyTaiSan.loadData();
             //    panelControlMain.Controls.Clear();
             //    panelControlMain.Controls.Add(_ucQuanLyTaiSan);
             //}
             else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName(rbnPageDonVi_TaiSan)))
             {
                 _ucQuanLyDonVi_TaiSan.loadData(DonVi.getById(donvi_id), Phong.getById(phong_id));
                 panelControlMain.Controls.Clear();
                 panelControlMain.Controls.Add(_ucQuanLyDonVi_TaiSan);
                 donvi_id = null;
                 phong_id = null;
             }
             else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName(rbnPagePhanQuyen)))
             {
                 _ucPhanQuyen.loadData();
                 panelControlMain.Controls.Clear();
                 panelControlMain.Controls.Add(_ucPhanQuyen);
             }
             else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName(rbnPageThongKe)))
             {
                 _ucThongKe.loadData();
                 panelControlMain.Controls.Clear();
                 panelControlMain.Controls.Add(_ucThongKe);
             }
             else if (ribbonMain.SelectedPage.Equals(ribbonMain.Pages.GetPageByName(rbnPageLogHeThong)))
             {
                 _ucLogHeThong.loadData();
                 panelControlMain.Controls.Clear();
                 panelControlMain.Controls.Add(_ucLogHeThong);
             }
             DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm(false);
         }
     }
     catch (Exception ex)
     {
         DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm(false);
         Debug.WriteLine(this.Name + "->ribbonMain_SelectedPageChanged: " + ex.Message);
     }
 }
示例#2
0
 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);
     }
 }