Exemplo n.º 1
0
 public void loadDataOnlyPhong()
 {
     DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(this.ParentForm, typeof(WaitFormLoad), true, true, false);
     DevExpress.XtraSplashScreen.SplashScreenManager.Default.SetWaitFormCaption("Đang tải dữ liệu...");
     try
     {
         editGUI("view");
         loadLoaiPhong();
         _ViTriHienTai = _ucTreeViTri.Vitri;
         if (_ViTriHienTai != null)
         {
             listPhong = PhongHienThi.getPhongByViTri(_ViTriHienTai.coso != null ? _ViTriHienTai.coso.id : Guid.Empty, _ViTriHienTai.day != null ? _ViTriHienTai.day.id : Guid.Empty, _ViTriHienTai.tang != null ? _ViTriHienTai.tang.id : Guid.Empty);
         }
         else
         {
             listPhong = null;
         }
         gridControlPhong.DataSource = listPhong;
         if (listPhong == null || listPhong.Count() == 0)
         {
             enableButton(false);
             gridLookUpLoai.EditValue = null;
         }
     }
     catch (Exception ex)
     {
         Debug.WriteLine(this.Name + "->loadData: " + ex.Message);
     }
     DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm(false);
 }
Exemplo n.º 2
0
        //FocusedRowChanged in TreePhong
        public void FocusedRowChangedTreePhong()
        {
            DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(this.ParentForm, typeof(WaitForm1), true, true, false);
            DevExpress.XtraSplashScreen.SplashScreenManager.Default.SetWaitFormCaption("Đang tải dữ liệu...");
            try
            {
                _ViTriHienTai = _ucTreeViTri.getVitri();
                //cosoid = _cosoid;
                //dayid = _dayid;
                //tangid = _tangid;
                //listPhong = Phong.getPhongByViTri(_cosoid, _dayid, _tangid);
                listPhong = PhongHienThi.getPhongByViTri(_ViTriHienTai.coso != null ? _ViTriHienTai.coso.id : Guid.Empty, _ViTriHienTai.day != null ? _ViTriHienTai.day.id : Guid.Empty, _ViTriHienTai.tang != null ? _ViTriHienTai.tang.id : Guid.Empty);
                gridControlPhong.DataSource = listPhong;
                switch (listPhong.Count)
                {
                case 0:
                    deleteData();
                    enableEdit(false);
                    enableBar(false);
                    break;

                default:
                    getThongTinPhong(true);
                    enableEdit(false);
                    enableBar(true);
                    break;
                }
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(this.Name + " : FocusedRowChangedTreePhong : " + ex.Message);
            }
            DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm(false);
        }
Exemplo n.º 3
0
 public void FocusedRowChangedTreePhong()
 {
     try
     {
         _ViTriHienTai = _ucTreeViTri.Vitri;
         listPhong     = PhongHienThi.getPhongByViTri(_ViTriHienTai.coso != null ? _ViTriHienTai.coso.id : Guid.Empty, _ViTriHienTai.day != null ? _ViTriHienTai.day.id : Guid.Empty, _ViTriHienTai.tang != null ? _ViTriHienTai.tang.id : Guid.Empty);
         gridControlPhong.DataSource = listPhong;
         if (listPhong.Count() == 0)
         {
             enableButton(false);
             gridLookUpLoai.EditValue = null;
         }
     }
     catch (Exception ex)
     {
         Debug.WriteLine(this.Name + "->FocusedRowChangedTreePhong: " + ex.Message);
     }
 }
Exemplo n.º 4
0
 // Reload dữ liệu
 public void reLoad()
 {
     DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(this.ParentForm, typeof(WaitForm1), true, true, false);
     DevExpress.XtraSplashScreen.SplashScreenManager.Default.SetWaitFormCaption("Đang tải dữ liệu...");
     try
     {
         _ucComboBoxViTri            = new ucComboBoxViTri(false, false);
         _ucComboBoxViTri.DataSource = listVitris;
         _ucComboBoxViTri.Dock       = DockStyle.Fill;
         panelControl1.Controls.Clear();
         panelControl1.Controls.Add(_ucComboBoxViTri);
         _ucTreeViTri.setVitri(_ViTriHienTai);
         listPhong = PhongHienThi.getPhongByViTri(_ViTriHienTai.coso != null ? _ViTriHienTai.coso.id : Guid.Empty, _ViTriHienTai.day != null ? _ViTriHienTai.day.id : Guid.Empty, _ViTriHienTai.tang != null ? _ViTriHienTai.tang.id : Guid.Empty);
         //listPhong = Phong.getPhongByViTri(cosoid, dayid, tangid);
         gridControlPhong.DataSource = listPhong;
     }
     catch (Exception ex)
     {
         Debug.WriteLine(this.Name + "->reLoad: " + ex.Message);
     }
     DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm(false);
 }
Exemplo n.º 5
0
        // Load dữ liệu
        public void loadData()
        {
            try
            {
                //load layout
                layout.load(gridViewPhong);
                canAdd     = Permission.canAdd <Phong>();
                listVitris = ViTriHienThi.getAll().ToList();
                _ucTreeViTri.loadData(listVitris);
                _ucComboBoxViTri.DataSource = listVitris;
                _ViTriHienTai = _ucTreeViTri.getVitri();
                listPhong     = PhongHienThi.getPhongByViTri(_ViTriHienTai.coso != null ? _ViTriHienTai.coso.id : Guid.Empty, _ViTriHienTai.day != null ? _ViTriHienTai.day.id : Guid.Empty, _ViTriHienTai.tang != null ? _ViTriHienTai.tang.id : Guid.Empty);
                gridControlPhong.DataSource = listPhong;
                if (listPhong.Count() == 0)
                {
                    deleteData();
                    enableEdit(false);
                    enableBar(false);
                }
                else
                {
                    getThongTinPhong(true);
                    enableEdit(false);
                    enableBar(true);
                }

                listNhanVienPT = NhanVienPT.getAll();
                NhanVienPT NhanVienPTNULL = new NhanVienPT();
                NhanVienPTNULL.hoten = "[Không có]";
                NhanVienPTNULL.id    = Guid.Empty;
                listNhanVienPT.Insert(0, NhanVienPTNULL);
                searchLookUpEditNhanVienPT.Properties.DataSource = listNhanVienPT;
            }
            catch (Exception ex)
            {
                Debug.WriteLine(this.Name + "->loadData: " + ex.Message);
            }
        }