示例#1
0
        /// <summary>
        /// Khởi tạo các combobox
        /// </summary>
        private void LoadCombobox()
        {
            // khởi tạo combobox
            AutoComboBox auto = new AutoComboBox();
            // Khởi tạo điều kiện gọi danh mục
            List <string> lstDieuKien = new List <string>();

            // khởi tạo combobox
            auto = new AutoComboBox();
            auto.GenAutoComboBox(ref lstSourceChiNhanh, ref cmbChiNhanh, DatabaseConstant.DanhSachTruyVan.COMBOBOX_CNHANH.getValue(), null, ClientInformation.MaDonVi);

            // khởi tạo combobox
            auto = new AutoComboBox();
            auto.GenAutoComboBox(ref lstSourcePhongGD, ref cmbPhongGD, DatabaseConstant.DanhSachTruyVan.COMBOBOX_PHONG_GD.getValue(), null);
            LoadComboboxPhongGD();

            // khởi tạo combobox
            auto = new AutoComboBox();
            auto.GenAutoComboBox(ref lstSourceCum, ref cmbCum, DatabaseConstant.DanhSachTruyVan.COMBOBOX_CUM_ALL.getValue());
            LoadComboboxCum();

            lstDieuKien = new List <string>();
            lstDieuKien.Add(DatabaseConstant.DanhMuc.LY_DO_VAO_RA.getValue());
            // khởi tạo combobox
            auto = new AutoComboBox();

            lstDieuKien = new List <string>();
            lstDieuKien.Add(DatabaseConstant.DanhMuc.NGON_NGU.getValue());
            // khởi tạo combobox
            auto = new AutoComboBox();
            auto.GenAutoComboBox(ref lstSourceNgonNgu, ref cmbNgonNgu, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien, ApplicationConstant.LoaiNgonNguBaoCao.vi_VN.layGiaTri());

            lstDieuKien.Clear();
            lstDieuKien.Add(DatabaseConstant.DanhMuc.DINH_DANG_BAO_CAO.getValue());
            // khởi tạo combobox
            auto = new AutoComboBox();
            auto.GenAutoComboBox(ref lstSourceDinhDang, ref cmbDinhDang, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien, ApplicationConstant.LoaiDinhDangBaoCao.PDF.layGiaTri());
            auto.removeEntry(ref lstSourceDinhDang, ref cmbDinhDang, ApplicationConstant.LoaiDinhDangBaoCao.WORD.layGiaTri());
            auto.removeEntry(ref lstSourceDinhDang, ref cmbDinhDang, ApplicationConstant.LoaiDinhDangBaoCao.PDF.layGiaTri());
            cmbDinhDang.IsEnabled = false;
        }
        private void LoadDuLieu()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                // lấy dữ liệu đổ source cho combobox Phân hệ chức năng
                AutoComboBox  auto        = new AutoComboBox();
                List <string> lstDieuKien = new List <string>();
                lstDieuKien.Add(DatabaseConstant.DanhMuc.DANH_MUC_PHAN_HE.getValue());
                //lstSourcePhanHe.Add(new AutoCompleteEntry("Tất cả",""));
                auto.GenAutoComboBox(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien);
                // Nếu là M7MFI
                if (ClientInformation.Company.Equals(ApplicationConstant.DonViSuDung.M7MFI.layGiaTri()))
                {
                    // Không thực hiện cho TDTT, BHTH, QLTS
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.TDTT.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.BHTH.getValue());
                    //auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.NSTL.getValue());
                    //auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.KTDL.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.QLTS.getValue());
                }
                else if (ClientInformation.Company.Equals(ApplicationConstant.DonViSuDung.BINHKHANH.layGiaTri()))
                {
                    // Không thực hiện cho TDTT, BHTH, KTDL, QLTS
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.TDTT.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.BHTH.getValue());
                    //auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.NSTL.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.KTDL.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.QLTS.getValue());
                }
                else if (ClientInformation.Company.Equals(ApplicationConstant.DonViSuDung.BANTAYVANG.layGiaTri()))
                {
                    // Chỉ thực hiện cho TDVM
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.QTHT.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.DMDC.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.KHTV.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.GDKT.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.HDVO.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.TDTT.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.BHTH.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.NSTL.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.KTDL.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.QLTS.getValue());
                }
                else
                {
                    // Chỉ thực hiện cho TDVM
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.QTHT.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.DMDC.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.KHTV.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.GDKT.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.HDVO.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.TDTT.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.BHTH.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.NSTL.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.KTDL.getValue());
                    auto.removeEntry(ref lstSourcePhanHe, ref cmbPhanHeChucNang, DatabaseConstant.Module.QLTS.getValue());
                }

                // Hiển thị lưới dữ liệu phân quyền
                BuildGrid();
                LoadContent();
            }
            catch (System.Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            Mouse.OverrideCursor = Cursors.Arrow;
        }