コード例 #1
0
        private void RefreshDataView()
        {
            try
            {
                string             msg       = string.Empty;
                DictionaryDosage[] dosageArr = PharmacyDatabaseService.AllDictionaryDosages(out msg);
                if (string.IsNullOrEmpty(msg))
                {
                    this.dataGridView1.DataSource = dosageArr;

                    ProcessGridViewAppearance();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("刷新数据失败!", "错误");
                Log.Error(ex);
            }
        }
コード例 #2
0
        private void GetComponentDatas()
        {
            try
            {
                string msg = string.Empty;

                _ListDictionaryMeasurementUnit = PharmacyDatabaseService.AllDictionaryMeasurementUnits(out msg).ToList();

                _ListDrugCategory = PharmacyDatabaseService.AllDrugCategorys(out msg).ToList();
                foreach (DrugCategory category in _ListDrugCategory)
                {
                    //dicDrugCategory.Add(category.Code, category.Name);
                }

                _ListDictionaryUserDefinedType = PharmacyDatabaseService.AllDictionaryUserDefinedTypes(out msg).ToList();
                foreach (DictionaryUserDefinedType userDefinedType in _ListDictionaryUserDefinedType)
                {
                    dicDictionaryUserDefinedType.Add(userDefinedType.Code, userDefinedType.Name);
                }

                _ListDictionaryDosage = PharmacyDatabaseService.AllDictionaryDosages(out msg).ToList();


                _ListDictionarySpecification = PharmacyDatabaseService.AllDictionarySpecifications(out msg).ToList();


                _ListDictionaryPiecemealUnit = PharmacyDatabaseService.AllDictionaryPiecemealUnits(out msg).ToList();


                _ListMedicalCategoryDetail = PharmacyDatabaseService.AllMedicalCategoryDetails(out msg).ToList();
                foreach (MedicalCategoryDetail unit in _ListMedicalCategoryDetail)
                {
                    dicMedicalCategoryDetail.Add(unit.Code, unit.Name);                    //to do
                }

                _ListDrugClinicalCategory = PharmacyDatabaseService.AllDrugClinicalCategorys(out msg).ToList();
                foreach (DrugClinicalCategory unit in _ListDrugClinicalCategory)
                {
                    dicDrugClinicalCategory.Add(unit.Code, unit.Name);
                }

                _ListDictionaryStorageType = PharmacyDatabaseService.AllDictionaryStorageTypes(out msg).ToList();
                foreach (DictionaryStorageType unit in _ListDictionaryStorageType)
                {
                    dicDrugStorageType.Add(unit.Code, unit.Name);
                }

                _ListPurchaseManageCategoryDetail = PharmacyDatabaseService.AllPurchaseManageCategoryDetails(out msg).ToList();
                foreach (PurchaseManageCategoryDetail unit in _ListPurchaseManageCategoryDetail)
                {
                    dicPurchaseManageCategoryDetail.Add(unit.Code, unit.Name);
                }

                _ListSpecialDrugCategory = PharmacyDatabaseService.AllSpecialDrugCategorys(out msg).ToList();
                foreach (SpecialDrugCategory unit in _ListSpecialDrugCategory)
                {
                    dicSpecialDrugCategory.Add(unit.Code, unit.Name);
                }

                _ListBusinessScope = PharmacyDatabaseService.AllBusinessScopes(out msg).ToList();
                foreach (BusinessScope unit in _ListBusinessScope)
                {
                    dicBusinessScope.Add(unit.Code, unit.Name);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "系统错误", MessageBoxButtons.OK);
                Log.Error(ex);
            }
        }