コード例 #1
0
 public Phong getPhong()
 {
     if (phongid != Guid.Empty)
     {
         return(Phong.getById(phongid));
     }
     else
     {
         return(new Phong());
     }
 }
コード例 #2
0
 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);
 }
コード例 #3
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);
     }
 }
コード例 #4
0
 public void loadDataById(Guid id)
 {
     objPhong = Phong.getById(id);
     loadDataByPhong();
 }