Esempio n. 1
0
        private void LoadDuLieu()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                var names = Enum.GetNames(typeof(DatabaseConstant.PhanHeKhaiThacDuLieuEF));
                foreach (string name in names)
                {
                    // do something!
                    int               idItem   = (int)DatabaseConstant.getValuePhanHeKhaiThacDuLieuEF(name);
                    string            codeItem = name;
                    string            nameItem = LLanguage.SearchResourceByKey(DatabaseConstant.getLanguagePhanHeKhaiThacDuLieuEF(DatabaseConstant.getValuePhanHeKhaiThacDuLieuEF(name)));
                    AutoCompleteEntry entry    = new AutoCompleteEntry(nameItem, codeItem, idItem.ToString());
                    lstSourcePhanHe.Add(entry);
                    cmbPhanHeChucNang.Items.Add(entry);
                }
                cmbPhanHeChucNang.SelectedIndex = 0;

                //// 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);

                // lấy dữ liệu đổ source cho combobox Loại đối tượng
                lstDieuKien = new List <string>();
                lstDieuKien.Add(DatabaseConstant.DanhMuc.LOAI_DTUONG_KTHAC_TNGUYEN.getValue());
                auto.GenAutoComboBox(ref lstSourceLoaiDTuong, ref cmbDoiTuong, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien,
                                     BusinessConstant.LoaiDoiTuong.NHOM_NGUOI_SDUNG.layGiaTri());

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