protected void FillViewBag(EXP_DrugDeclaration model) { var drugPrimaryRepo = new DrugPrimaryRepository(); ViewData["ContractList"] = new SelectList(new ContractRepository(false).GetActiveContractListWithInfo(model.OwnerId), "Id", "ContractInfo", model.ContractId); var repository = new ReadOnlyDictionaryRepository(); ViewData["AccelerationTypeList"] = new SelectList(repository.GetAccelerationTypes(), "Id", "NameRu", model.AccelerationTypeId); ViewData["TypeList"] = new SelectList(repository.GetDicTypes(), "Id", "NameRu", model.TypeId); if (model.RegisterId > 0 && model.sr_register != null) { model.ReestrNumber = model.sr_register.reg_number + "/" + model.sr_register.reg_number_kz; model.ReestrRegDate = model.sr_register.reg_date.ToShortDateString(); if (model.sr_register.expiration_date != null) { model.ReestrExpirationDate = model.sr_register.expiration_date.Value.ToShortDateString(); } var reestrDrug = new ExternalRepository().GEtRegisterDrugById(model.RegisterId); if (reestrDrug != null) { model.NumberNd = reestrDrug.nd_number; } } if (model.ExpDrugChangeTypes.Count == 0) { model.ExpDrugChangeTypes.Add(new EXP_DrugChangeType()); } if (model.ExpDrugProtectionDocs.Count == 0) { model.ExpDrugProtectionDocs.Add(new EXP_DrugProtectionDoc()); } if (model.ExpDrugOtherCountries.Count == 0) { model.ExpDrugOtherCountries.Add(new EXP_DrugOtherCountry()); } if (model.ExpDrugExportTrades.Count == 0) { model.ExpDrugExportTrades.Add(new EXP_DrugExportTrade()); } if (model.ExpDrugPatents.Count == 0) { model.ExpDrugPatents.Add(new EXP_DrugPatent()); } if (model.ExpDrugTypes.Count == 0) { model.ExpDrugTypes.Add(new EXP_DrugType()); } /* if (model.ExpDrugWrappings.Count == 0) * { * model.ExpDrugWrappings.Add(new EXP_DrugWrapping()); * }*/ if (model.ExpDrugOrganizationses.Count == 0) { model.ExpDrugOrganizationses.Add(new EXP_DrugOrganizations()); } if (model.ExpDrugDosages.Count == 0) { model.ExpDrugDosages.Add(new EXP_DrugDosage()); } /*if (model.ExpDrugPrices.Count == 0) * { * model.ExpDrugPrices.Add(new EXP_DrugPrice()); * }*/ var externalRepository = new ExternalRepository(); var countries = externalRepository.GetCounties().ToArray(); ViewData["Counties"] = new SelectList(countries, "Id", "name", 0); for (var i = 0; i < model.ExpDrugExportTrades.Count; i++) { ViewData["Counties" + i] = new SelectList(countries, "Id", "name", model.ExpDrugExportTrades[i].CountryId); } var types = repository.GetDrugType().ToArray(); var typeKinds = repository.GetDrugTypeKinds().ToArray(); ViewData["DrugTypes"] = new SelectList(types, "Id", "NameRu", 0); ViewData["DrugTypeKinds"] = new SelectList(typeKinds, "Id", "NameRu", 0); for (var i = 0; i < model.ExpDrugTypes.Count; i++) { ViewData["DrugTypes" + i] = new SelectList(types, "Id", "NameRu", model.ExpDrugTypes[i].DrugTypeId); ViewData["DrugTypeKinds" + i] = new SelectList(typeKinds, "Id", "NameRu", model.ExpDrugTypes[i].DrugTypeKind); } model.AtcCodeses = externalRepository.GetAtcList(); var methods = externalRepository.GetUseMethods(); model.MethodUseList = new MultiSelectList(methods, "id", "name", model.MethodUseIds); /* ViewData["SaleTypeList"] = new SelectList(repository.GetSaleType(), "Id", * "NameRu", model.SaleTypeId);*/ var measures = externalRepository.GetMeasures(); ViewData["MeasureList"] = new SelectList(measures, "Id", "name", null); var wrappingTypes = repository.GetWrappingTypes().ToArray(); var boxes = externalRepository.GetBoxes().ToArray(); ViewData["WrappingTypes"] = new SelectList(wrappingTypes, "Id", "NameRu", 0); ViewData["Boxes"] = new SelectList(boxes, "id", "name", 0); ViewData["MeasureShortList"] = new SelectList(measures, "id", "short_name", 0); ViewData["SizeMeasureList"] = new SelectList(measures, "id", "short_name", 0); ViewData["VolumeMeasureList"] = new SelectList(measures, "id", "short_name", 0); var booleans = repository.GetBooleanList(); ViewData["Booleans"] = new SelectList(booleans, "IsSign", "NameRu", false); var origins = repository.GetOrigins().ToArray(); var plantKinds = repository.GetPlantKinds().ToArray(); var normDocs = repository.GetExpDicNormDocFarms().ToArray(); var substanceTypes = externalRepository.GetSubstanceTypes().ToArray(); ViewData["SubstanceTypes"] = new SelectList(substanceTypes, "Id", "name", null); ViewData["Origins"] = new SelectList(origins, "Id", "NameRu", null); ViewData["NormDocs"] = new SelectList(normDocs, "Id", "NameRu", null); ViewData["PlantKinds"] = new SelectList(plantKinds, "Id", "NameRu", null); ViewData["IsControlList"] = new SelectList(booleans, "IsSign", "NameRu", null); ViewData["IsPoisonList"] = new SelectList(booleans, "IsSign", "NameRu", null); ViewData["SubstanceCounties"] = new SelectList(countries, "Id", "name", 0); ViewData["SubstanceMeasureList"] = new SelectList(measures, "id", "short_name", 0); var sales = repository.GetSaleType().ToList(); ViewData["SaleTypeList"] = new SelectList(sales, "Id", "NameRu", null); ViewData["BestBeforeMeasureTypeList"] = new SelectList(measures, "id", "short_name", null); ViewData["AppPeriodMixMeasureList"] = new SelectList(measures, "id", "short_name", null); ViewData["AppPeriodOpenMeasureList"] = new SelectList(measures, "id", "short_name", null); var drugDeclarationRepository = new DrugDeclarationRepository(); for (var i = 0; i < model.ExpDrugDosages.Count; i++) { var dosage = model.ExpDrugDosages[i]; if (dosage.ExpDrugWrappings == null || dosage.ExpDrugWrappings.Count == 0) { dosage.ExpDrugWrappings = new List <EXP_DrugWrapping> { new EXP_DrugWrapping() }; } if (dosage.ExpDrugSubstances == null || dosage.ExpDrugSubstances.Count == 0) { dosage.ExpDrugSubstances = new List <EXP_DrugSubstance> { new EXP_DrugSubstance() { ExpDrugSubstanceManufactures = new List <EXP_DrugSubstanceManufacture>() { new EXP_DrugSubstanceManufacture() } } }; } if (dosage.ExpDrugPrices == null) { dosage.ExpDrugPrices = new List <EXP_DrugPrice>(); } ViewData["MeasureList" + dosage.Id] = new SelectList(measures, "Id", "name", model.ExpDrugDosages[i].DosageMeasureTypeId); ViewData["SaleTypeList" + dosage.Id] = new SelectList(sales, "Id", "NameRu", model.ExpDrugDosages[i].SaleTypeId); ViewData["BestBeforeMeasureTypeList" + dosage.Id] = new SelectList(measures, "id", "short_name", model.ExpDrugDosages[i].BestBeforeMeasureTypeDicId); ViewData["AppPeriodMixMeasureList" + dosage.Id] = new SelectList(measures, "id", "short_name", model.ExpDrugDosages[i].AppPeriodMixMeasureDicId); ViewData["AppPeriodOpenMeasureList" + dosage.Id] = new SelectList(measures, "id", "short_name", model.ExpDrugDosages[i].AppPeriodOpenMeasureDicId); for (var j = 0; j < dosage.ExpDrugWrappings.Count; j++) { var wrap = dosage.ExpDrugWrappings[j]; ViewData["WrappingTypes" + wrap.Id] = new SelectList(wrappingTypes, "Id", "NameRu", wrap.WrappingTypeId); ViewData["Boxes" + wrap.Id] = new SelectList(boxes, "Id", "name", wrap.WrappingKindId); ViewData["SizeMeasureList" + wrap.Id] = new SelectList(measures, "Id", "short_name", wrap.SizeMeasureId); ViewData["VolumeMeasureList" + wrap.Id] = new SelectList(measures, "Id", "short_name", wrap.VolumeMeasureId); } for (var j = 0; j < dosage.ExpDrugPrices.Count; j++) { var price = dosage.ExpDrugPrices[j]; model.ExpDrugDosages[i].ExpDrugPrices[j].PrimaryText = drugDeclarationRepository.GetNameByWrappingNames(price.PrimaryValue); model.ExpDrugDosages[i].ExpDrugPrices[j].SecondaryText = drugDeclarationRepository.GetNameByWrappingNames(price.SecondaryValue); model.ExpDrugDosages[i].ExpDrugPrices[j].IntermediateText = drugDeclarationRepository.GetNameByWrappingNames(price.IntermediateValue); } for (var j = 0; j < dosage.ExpDrugSubstances.Count; j++) { var id = dosage.ExpDrugSubstances[j].Id.ToString(); dosage.ExpDrugSubstances[j].CategoryName = GetCategoryName(dosage.ExpDrugSubstances[j].sr_substances); dosage.ExpDrugSubstances[j].CategoryPos = dosage.ExpDrugSubstances[j].sr_substances?.category_pos; ViewData["SubstanceTypes" + id] = new SelectList(substanceTypes, "Id", "name", dosage.ExpDrugSubstances[j].SubstanceTypeId); ViewData["Origins" + id] = new SelectList(origins, "Id", "NameRu", dosage.ExpDrugSubstances[j].OriginId); ViewData["NormDocs" + id] = new SelectList(normDocs, "Id", "NameRu", dosage.ExpDrugSubstances[j].NormDocFarmId); ViewData["PlantKinds" + id] = new SelectList(plantKinds, "Id", "NameRu", dosage.ExpDrugSubstances[j].PlantKindId); ViewData["SubstanceMeasureList" + id] = new SelectList(measures, "Id", "short_name", dosage.ExpDrugSubstances[j].MeasureId); /* ViewData["SubstanceCounties" + id] = new SelectList(countries, "Id", "name", * dosage.ExpDrugSubstances[j].CountryId);*/ ViewData["IsControlList" + id] = new SelectList(booleans, "IsSign", "NameRu", dosage.ExpDrugSubstances[j].IsControl); ViewData["IsPoisonList" + id] = new SelectList(booleans, "IsSign", "NameRu", dosage.ExpDrugSubstances[j].IsPoison); /* ViewData["SubstanceCounties" + i] = new SelectList(countries, "Id", "name", * dosage.ExpDrugSubstances[j].CountryId);*/ if (dosage.ExpDrugSubstances[j].ExpDrugSubstanceManufactures != null) { for (var k = 0; k < dosage.ExpDrugSubstances[j].ExpDrugSubstanceManufactures.Count; k++) { ViewData[ "SubstanceCounties" + dosage.ExpDrugSubstances[j].ExpDrugSubstanceManufactures[k].Id ] = new SelectList(countries, "Id", "name", dosage.ExpDrugSubstances[j].ExpDrugSubstanceManufactures[k].CountryId); } } else { dosage.ExpDrugSubstances[j].ExpDrugSubstanceManufactures = new List <EXP_DrugSubstanceManufacture> { new EXP_DrugSubstanceManufacture() }; } } } ViewData["IsGrlsList"] = new SelectList(booleans, "IsSign", "NameRu", model.IsGrls); ViewData["IsGmpList"] = new SelectList(booleans, "IsSign", "NameRu", model.IsGmp); var manufactures = repository.GetManufactureTypeList(); ViewData["ManufactureTypeList"] = new SelectList(manufactures, "Id", "NameRu", model.ManufactureTypeId); /* ViewData["BestBeforeMeasureTypeList"] = new SelectList(measures, "id", "short_name", * model.BestBeforeMeasureTypeDicId); * ViewData["AppPeriodMixMeasureList"] = new SelectList(measures, "id", "short_name", * model.AppPeriodMixMeasureDicId); * ViewData["AppPeriodOpenMeasureList"] = new SelectList(measures, "id", "short_name", * model.AppPeriodOpenMeasureDicId); */ for (var i = 0; i < model.ExpDrugOtherCountries.Count; i++) { ViewData["OtherCounties" + i] = new SelectList(countries, "Id", "name", model.ExpDrugOtherCountries[i].CountryId); } var orgManufactureTypes = repository.GetDictionaries(CodeConstManager.DIC_ORG_MANUFACTURE_TYPE); var countyDics = repository.GetDictionaries(CodeConstManager.DIC_COUNTRY_TYPE); var opfTypeDics = repository.GetDictionaries(CodeConstManager.DIC_OPF_TYPE); ViewData["OrgManufactureTypes"] = new SelectList(orgManufactureTypes, "Id", "Name", null); ViewData["CountryDics"] = new SelectList(countyDics, "Id", "Name", null); ViewData["OpfTypeDics"] = new SelectList(opfTypeDics, "Id", "Name", null); for (var i = 0; i < model.ExpDrugOrganizationses.Count; i++) { var id = model.ExpDrugOrganizationses[i].Id.ToString(); ViewData["OrgManufactureTypes" + id] = new SelectList(orgManufactureTypes, "Id", "name", model.ExpDrugOrganizationses[i].OrgManufactureTypeDicId); ViewData["CountryDics" + id] = new SelectList(countyDics, "Id", "name", model.ExpDrugOrganizationses[i].CountryDicId); ViewData["OpfTypeDics" + id] = new SelectList(opfTypeDics, "Id", "name", model.ExpDrugOrganizationses[i].OpfTypeDicId); var manufacture = repository.GetDictionaryById(CodeConstManager.DIC_ORG_MANUFACTURE_TYPE, model.ExpDrugOrganizationses[i].OrgManufactureTypeDicId); if (manufacture != null) { model.ExpDrugOrganizationses[i].ManufactureName = manufacture.Name; } } var changeTypes = repository.GetDicChangeTypes().ToArray(); ViewData["ChangeTypes"] = new SelectList(changeTypes, "Id", "Code", 0); for (var i = 0; i < model.ExpDrugChangeTypes.Count; i++) { ViewData["ChangeTypes" + i] = new SelectList(changeTypes, "Id", "Code", model.ExpDrugChangeTypes[i].ChangeTypeId); } var markList = drugPrimaryRepo.GetPrimaryMarkList(model.Id, null); var remarkTypes = repository.GetRemarkTypes().ToArray(); ViewData["RemarkTypes" + model.Id] = new SelectList(remarkTypes, "Id", "NameRu", null); model.ExpExpertiseStageRemarks = new List <EXP_ExpertiseStageRemark>(); foreach (var expDrugPrimaryRemark in markList) { model.ExpExpertiseStageRemarks.Add(expDrugPrimaryRemark); } if (model.ExpExpertiseStageRemarks.Count == 0) { model.ExpExpertiseStageRemarks.Add(new EXP_ExpertiseStageRemark()); } else { model.IsShowRemark = true; } foreach (var expDrugPrimaryRemark in model.ExpExpertiseStageRemarks) { ViewData["RemarkTypes" + model.Id + "_" + expDrugPrimaryRemark.Id] = new SelectList(remarkTypes, "Id", "NameRu", expDrugPrimaryRemark.RemarkTypeId); } ViewBag.PaymentOverdue = model.EXP_DirectionToPays.Any(e => e.Type == 1 && e.Status.Code == Dictionary.ExpDirectionToPayStatus.PaymentExpired); model.Letters = new List <EXP_DrugCorespondence>(drugPrimaryRepo.GetDrugCorespondences(model.Id, true)); }
protected virtual void FillDosageControl(EXP_ExpertiseStageDosage model) { var externalRepository = new ExternalRepository(); var repository = new ReadOnlyDictionaryRepository(); var measures = externalRepository.GetMeasures(); var wrappingTypes = repository.GetWrappingTypes().ToArray(); var boxes = externalRepository.GetBoxes().ToArray(); // var remarkTypes = repository.GetRemarkTypes().ToArray(); var sales = repository.GetSaleType().ToList(); var drugDeclarationRepository = new DrugDeclarationRepository(); model.EXP_DrugDosage.ExpDrugWrappings = new List <EXP_DrugWrapping>(); model.EXP_DrugDosage.ExpDrugPrices = new List <EXP_DrugPrice>(); model.EXP_DrugDosage.ExpDrugSubstances = new List <EXP_DrugSubstance>(); // model.EXP_DrugDosage.ExpDrugAppDosageRemarks = new List<EXP_DrugAppDosageRemark>(); // model.EXP_DrugDosage.ExpDrugAppDosageResults = new List<EXP_DrugAppDosageResult>(); /* foreach (var expDrugAppDosageRemark in model.EXP_DrugDosage.EXP_DrugAppDosageRemark) * { * model.EXP_DrugDosage.ExpDrugAppDosageRemarks.Add(expDrugAppDosageRemark); * } * if (model.EXP_DrugDosage.ExpDrugAppDosageRemarks.Count == 0) * { * model.EXP_DrugDosage.ExpDrugAppDosageRemarks.Add(new EXP_DrugAppDosageRemark()); * } * * foreach (var expDrugAppDosageRemark in model.EXP_DrugDosage.EXP_DrugAppDosageResult) * { * model.EXP_DrugDosage.ExpDrugAppDosageResults.Add(expDrugAppDosageRemark); * } * if (model.EXP_DrugDosage.ExpDrugAppDosageResults.Count == 0) * { * model.EXP_DrugDosage.ExpDrugAppDosageResults.Add(new EXP_DrugAppDosageResult()); * } */ /* ViewData["RemarkTypes" + model.EXP_DrugDosage.DrugDeclarationId] = new SelectList(remarkTypes, "Id", "NameRu", * null); * foreach (var wrap in model.EXP_DrugDosage.ExpDrugAppDosageResults) * { * ViewData["ResultTypes" + model.EXP_DrugDosage.DrugDeclarationId + "_" + wrap.Id] = new SelectList(remarkTypes, "Id", "NameRu", * wrap.RemarkTypeId); * } * foreach (var wrap in model.EXP_DrugDosage.ExpDrugAppDosageRemarks) * { * ViewData["RemarkTypes" + model.EXP_DrugDosage.DrugDeclarationId + "_" + wrap.Id] = new SelectList(remarkTypes, "Id", "NameRu", * wrap.RemarkTypeId); * }*/ foreach (var expDrugWrapping in model.EXP_DrugDosage.EXP_DrugWrapping) { model.EXP_DrugDosage.ExpDrugWrappings.Add(expDrugWrapping); } foreach (var expDrugWrapping in model.EXP_DrugDosage.EXP_DrugPrice) { model.EXP_DrugDosage.ExpDrugPrices.Add(expDrugWrapping); } for (var d = 0; d < model.EXP_DrugDosage.EXP_DrugSubstance.Count; d++) { model.EXP_DrugDosage.ExpDrugSubstances.Add(model.EXP_DrugDosage.EXP_DrugSubstance.ToList()[d]); if (model.EXP_DrugDosage.EXP_DrugSubstance.ToList()[d].ExpDrugSubstanceManufactures == null) { model.EXP_DrugDosage.EXP_DrugSubstance.ToList()[d].ExpDrugSubstanceManufactures = new List <EXP_DrugSubstanceManufacture>(); } foreach (var expDrugSubstanceManufacture in model.EXP_DrugDosage.EXP_DrugSubstance.ToList()[d].EXP_DrugSubstanceManufacture) { model.EXP_DrugDosage.EXP_DrugSubstance.ToList()[d].ExpDrugSubstanceManufactures.Add(expDrugSubstanceManufacture); } } /* foreach (var expDrugWrapping in model.EXP_DrugDosage.EXP_DrugSubstance) * { * model.EXP_DrugDosage.ExpDrugSubstances.Add(expDrugWrapping); * foreach (var expDrugSubstanceManufacture in expDrugWrapping.EXP_DrugSubstanceManufacture) * { * model.EXP_DrugDosage.ExpDrugSubstances.Add(expDrugWrapping); * } * }*/ if (model.EXP_DrugDosage.ExpDrugWrappings == null || model.EXP_DrugDosage.ExpDrugWrappings.Count == 0) { model.EXP_DrugDosage.ExpDrugWrappings = new List <EXP_DrugWrapping>(); } if (model.EXP_DrugDosage.ExpDrugSubstances == null || model.EXP_DrugDosage.ExpDrugSubstances.Count == 0) { model.EXP_DrugDosage.ExpDrugSubstances = new List <EXP_DrugSubstance> (); } if (model.EXP_DrugDosage.ExpDrugPrices == null) { model.EXP_DrugDosage.ExpDrugPrices = new List <EXP_DrugPrice>(); } ViewData["MeasureList" + model.EXP_DrugDosage.Id] = new SelectList(measures, "Id", "name", model.EXP_DrugDosage.DosageMeasureTypeId); ViewData["SaleTypeList" + model.EXP_DrugDosage.Id] = new SelectList(sales, "Id", "NameRu", model.EXP_DrugDosage.SaleTypeId); ViewData["BestBeforeMeasureTypeList" + model.EXP_DrugDosage.Id] = new SelectList(measures, "id", "short_name", model.EXP_DrugDosage.BestBeforeMeasureTypeDicId); ViewData["AppPeriodMixMeasureList" + model.EXP_DrugDosage.Id] = new SelectList(measures, "id", "short_name", model.EXP_DrugDosage.AppPeriodMixMeasureDicId); ViewData["AppPeriodOpenMeasureList" + model.EXP_DrugDosage.Id] = new SelectList(measures, "id", "short_name", model.EXP_DrugDosage.AppPeriodOpenMeasureDicId); for (var j = 0; j < model.EXP_DrugDosage.ExpDrugWrappings.Count; j++) { var wrap = model.EXP_DrugDosage.ExpDrugWrappings[j]; ViewData["WrappingTypes" + wrap.Id] = new SelectList(wrappingTypes, "Id", "NameRu", wrap.WrappingTypeId); ViewData["Boxes" + wrap.Id] = new SelectList(boxes, "Id", "name", wrap.WrappingKindId); ViewData["SizeMeasureList" + wrap.Id] = new SelectList(measures, "Id", "short_name", wrap.SizeMeasureId); ViewData["VolumeMeasureList" + wrap.Id] = new SelectList(measures, "Id", "short_name", wrap.VolumeMeasureId); } var origins = repository.GetOrigins().ToArray(); var plantKinds = repository.GetPlantKinds().ToArray(); var substanceTypes = externalRepository.GetSubstanceTypes().ToArray(); var countries = externalRepository.GetCounties().ToArray(); var booleans = repository.GetBooleanList(); for (var j = 0; j < model.EXP_DrugDosage.ExpDrugSubstances.Count; j++) { var ids = model.EXP_DrugDosage.ExpDrugSubstances[j].Id.ToString(); model.EXP_DrugDosage.ExpDrugSubstances[j].CategoryName = GetCategoryName(model.EXP_DrugDosage.ExpDrugSubstances[j].sr_substances); model.EXP_DrugDosage.ExpDrugSubstances[j].CategoryPos = model.EXP_DrugDosage.ExpDrugSubstances[j].sr_substances?.category_pos; ViewData["SubstanceTypes" + ids] = new SelectList(substanceTypes, "Id", "name", model.EXP_DrugDosage.ExpDrugSubstances[j].SubstanceTypeId); ViewData["Origins" + ids] = new SelectList(origins, "Id", "NameRu", model.EXP_DrugDosage.ExpDrugSubstances[j].OriginId); ViewData["PlantKinds" + ids] = new SelectList(plantKinds, "Id", "NameRu", model.EXP_DrugDosage.ExpDrugSubstances[j].PlantKindId); ViewData["SubstanceMeasureList" + ids] = new SelectList(measures, "Id", "short_name", model.EXP_DrugDosage.ExpDrugSubstances[j].MeasureId); ViewData["SubstanceCounties" + ids] = new SelectList(countries, "Id", "name", model.EXP_DrugDosage.ExpDrugSubstances[j].CountryId); ViewData["IsControlList" + ids] = new SelectList(booleans, "IsSign", "NameRu", model.EXP_DrugDosage.ExpDrugSubstances[j].IsControl); ViewData["NormDocs" + ids] = new SelectList(repository.GetExpDicNormDocFarms().ToArray(), "Id", "NameRu", model.EXP_DrugDosage.ExpDrugSubstances[j].NormDocFarmId); ViewData["IsPoisonList" + ids] = new SelectList(booleans, "IsSign", "NameRu", model.EXP_DrugDosage.ExpDrugSubstances[j].IsPoison); /* ViewData["SubstanceCounties" + ids] = new SelectList(countries, "Id", "name", * model.EXP_DrugDosage.ExpDrugSubstances[j].CountryId);*/ if (model.EXP_DrugDosage.ExpDrugSubstances[j].ExpDrugSubstanceManufactures != null) { for (var k = 0; k < model.EXP_DrugDosage.ExpDrugSubstances[j].ExpDrugSubstanceManufactures.Count; k++) { ViewData["SubstanceCounties" + model.EXP_DrugDosage.ExpDrugSubstances[j].ExpDrugSubstanceManufactures[k].Id.ToString()] = new SelectList(countries, "Id", "name", model.EXP_DrugDosage.ExpDrugSubstances[j].ExpDrugSubstanceManufactures[k].CountryId); } } } for (var j = 0; j < model.EXP_DrugDosage.ExpDrugPrices.Count; j++) { var price = model.EXP_DrugDosage.ExpDrugPrices[j]; model.EXP_DrugDosage.ExpDrugPrices[j].PrimaryText = drugDeclarationRepository.GetNameByWrappingNames(price.PrimaryValue); model.EXP_DrugDosage.ExpDrugPrices[j].SecondaryText = drugDeclarationRepository.GetNameByWrappingNames(price.SecondaryValue); model.EXP_DrugDosage.ExpDrugPrices[j].IntermediateText = drugDeclarationRepository.GetNameByWrappingNames(price.IntermediateValue); } }