コード例 #1
0
ファイル: ucTKHaoMon.cs プロジェクト: toantranit/QuanLyTaiSan
        private void btnTim_Click(object sender, EventArgs e)
        {
            if (dateNgayTK.EditValue == null)
            {
                dateNgayTK.DateTime = DateTime.Now;
            }
            if (dateNgayTK.DateTime.Year <= 2008)
            {
                XtraMessageBox.Show("Năm thống kê phải lớn hơn 2008", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(this.ParentForm, typeof(WaitFormLoad), true, true, false);
                DevExpress.XtraSplashScreen.SplashScreenManager.Default.SetWaitFormCaption("Đang tải dữ liệu...");
                try
                {
                    //String ten = checkTen.Checked ? txtTen.Text : null;
                    //String ten = txtTen.Text;
                    LoaiTaiSan  loai       = checkLoaiTS.Checked ? ucComboBoxLoaiTS1.LoaiTS : null;
                    DonVi       DVQL       = ucComboBoxDonVi1.DonVi;
                    ViTri       vitri      = ucComboBoxViTri1.ViTri;
                    Phong       phong      = ucComboBoxViTri1.Phong;
                    List <Guid> tinhtrangs = CheckedComboBoxEditHelper.getCheckedValueArray(checkedCbxTinhTrang);
                    bool        isViTri    = true;
                    if (vitri == null)
                    {
                        isViTri = false;
                    }
                    List <CTTaiSan>      tmp  = CTTaiSanSF.search(null, loai, checkDonVi.Checked, DVQL, false, null, isViTri && checkViTri.Checked, vitri, !isViTri && checkViTri.Checked, phong, checkTinhTrang.Checked ? tinhtrangs : null).ToList();
                    List <TaiSanHienThi> list = TaiSanHienThi.Convert(tmp, dateNgayTK.DateTime.Year);
                    gridControlHaoMon.DataSource = list;

                    //saveSearchXml(this.Name);
                    //ucGridControlTaiSan1.CollapseAllGroups();
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(this.Name + "->Search:" + ex.Message);
                }
                DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm(false);
            }
        }
コード例 #2
0
        public void Search()
        {
            DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(this.ParentForm, typeof(WaitFormLoad), true, true, false);
            DevExpress.XtraSplashScreen.SplashScreenManager.Default.SetWaitFormCaption("Đang tải dữ liệu...");
            try
            {
                //String ten = checkTen.Checked ? txtTen.Text : null;
                //String ten = txtTen.Text;
                List <Guid> tinhtrangs = CheckedComboBoxEditHelper.getCheckedValueArray(checkedCbxTinhTrang);
                LoaiTaiSan  loai       = checkLoaiTS.Checked ? ucComboBoxLoaiTS1.LoaiTS : null;
                DonVi       DVQL       = ucComboBoxDonVi1.DonVi;
                ViTri       vitri      = ucComboBoxViTri1.ViTri;
                Phong       phong      = ucComboBoxViTri1.Phong;
                bool        isViTri    = true;
                if (vitri == null)
                {
                    isViTri = false;
                }
                List <TaiSanHienThi> list = TaiSanHienThi.Convert(CTTaiSanSF.search(null, loai, checkDonVi.Checked, DVQL, false, null, isViTri && checkViTri.Checked, vitri, !isViTri && checkViTri.Checked, phong, checkTinhTrang.Checked ? tinhtrangs : null,
                                                                                    (cbxEquationDonGia.EditValue != null && checkDonGia.Checked) ? cbxEquationDonGia.EditValue.ToString() : null, (spinDonGia.EditValue != null && checkDonGia.Checked) ? (long?)long.Parse(spinDonGia.EditValue.ToString()) : null,
                                                                                    (cbxEquationNgaySD.EditValue != null && checkNgaySuDung.Checked) ? cbxEquationNgaySD.EditValue.ToString() : null, (dateNgaySD.EditValue != null && checkNgaySuDung.Checked) ? (DateTime?)dateNgaySD.DateTime : null));
                //ucGridControlTaiSan1.DataSource = list;
                gridControlTaiSan.DataSource = list;
                taisans = list;
                //bool isEnabled = list.Count > 0;
                //barBtnSuaTaiSan.Enabled = isEnabled;
                //barBtnXoaTaiSan.Enabled = isEnabled;
                //btnSua_r.Enabled = isEnabled;
                //btnXoa_r.Enabled = isEnabled;

                //saveSearchXml(this.Name);
                //ucGridControlTaiSan1.CollapseAllGroups();
                gridViewTaiSan.CollapseAllGroups();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(this.Name + "->Search:" + ex.Message);
            }
            DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm(false);
        }
コード例 #3
0
        public void Search()
        {
            DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(this.ParentForm, typeof(WaitFormLoad), true, true, false);
            DevExpress.XtraSplashScreen.SplashScreenManager.Default.SetWaitFormCaption("Đang tải dữ liệu...");
            try
            {
                //String ten = checkTen.Checked ? txtTen.Text : null;
                String     ten     = txtTen.Text;
                LoaiTaiSan loai    = checkLoai.Checked ? ucComboBoxLoaiTS1.LoaiTS : null;
                DonVi      DVQL    = ucComboBoxDonVi1.DonVi;
                ViTri      vitri   = ucComboBoxViTri1.ViTri;
                Phong      phong   = ucComboBoxViTri1.Phong;
                bool       isViTri = true;
                if (vitri == null)
                {
                    isViTri = false;
                }
                List <Guid>          tinhtrangs = CheckedComboBoxEditHelper.getCheckedValueArray(checkedCbxTinhTrang);
                List <TaiSanHienThi> list       = TaiSanHienThi.Convert(CTTaiSanSF.search(checkTenTS.Checked ? ten : "", checkLoai.Checked ? loai : null, checkDVQL.Checked, DVQL, false, null, isViTri && checkViTri.Checked, vitri, !isViTri && checkViTri.Checked, phong, checkTinhTrang.Checked ? tinhtrangs : null));
                ucGridControlTaiSan1.DataSource = list;


                bool isEnabled = list.Count > 0;
                barBtnSuaTaiSan.Enabled = isEnabled;
                barBtnXoaTaiSan.Enabled = isEnabled;
                btnSua_r.Enabled        = isEnabled;
                btnXoa_r.Enabled        = isEnabled;

                saveSearchXml(this.Name);
                ucGridControlTaiSan1.CollapseAllGroups();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(this.Name + "->Search:" + ex.Message);
            }
            DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm(false);
        }