public Phong getPhong() { if (phongid != Guid.Empty) { return(Phong.getById(phongid)); } else { return(new Phong()); } }
public void setData(Guid _phongid) { DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(this.ParentForm, typeof(WaitForm1), true, true, false); DevExpress.XtraSplashScreen.SplashScreenManager.Default.SetWaitFormCaption("Đang tải dữ liệu..."); try { objPhong = Phong.getById(_phongid); gridControlCTThietBi.DataSource = null; listCTThietBis = ChiTietTBHienThi.getAllByPhongId(_phongid); gridControlCTThietBi.DataSource = listCTThietBis; editGUI(); } catch (Exception ex) { Debug.WriteLine(this.Name + "->setData:" + ex.Message); } DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm(false); }
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); } }
public void loadDataById(Guid id) { objPhong = Phong.getById(id); loadDataByPhong(); }