private void SetViewBag(string operationNumber, UseCountrySystemViewModel viewModel) { var outcomeResponse = _linkPredefinedIndicatorService.GetLinkIndicatorModelForCSResultMatrix(false, "LinkIndicator"); ViewBag.LinkIndicatorModel = outcomeResponse.Filter; ViewBag.CRFIndicators = new List <SelectListItem>(); if (viewModel != null) { var allCRFIndicatorIdUsed = viewModel.UCSStrategicObjective.SelectMany(x => x.ExpectedOutcomeIndicators).SelectMany(y => y.LinkedIndicators).Distinct(); var crfIndicatorResponse = _useCountrySystemService.GetCRFIndicatorsById(allCRFIndicatorIdUsed); ViewBag.CRFIndicators = crfIndicatorResponse.CRFIndicators; } this.SetViewBagListFromCatalog(_catalogService, new Dictionary <ConvergenceMasterDataTypeEnum, string> { { ConvergenceMasterDataTypeEnum.StrategicObjectiveType, "StrategicObjectiveList" }, { ConvergenceMasterDataTypeEnum.TimmingType, "TimmingList" }, { ConvergenceMasterDataTypeEnum.ForeseenActionType, "ForeseenActionsList" }, { ConvergenceMasterDataTypeEnum.UseCountrySystemType, "UseCountryList" }, }); var forseenActionAux = (List <SelectListItem>)ViewBag.ForeseenActionsList; var foreseenActionsListAux = forseenActionAux.ConvertToMultiDropDownItems(); var forseenList = new List <MultiDropDownItem>(); forseenList.Add(foreseenActionsListAux.SingleOrDefault(x => x.Value == _enumMappingService.GetMappingCode(ForeseenActionTypeEnum.NoForeseenAction).ToString())); forseenList.Add(foreseenActionsListAux.SingleOrDefault(x => x.Value == _enumMappingService.GetMappingCode(ForeseenActionTypeEnum.FiduciaryAssessment).ToString())); forseenList.Add(foreseenActionsListAux.SingleOrDefault(x => x.Value == _enumMappingService.GetMappingCode(ForeseenActionTypeEnum.CloseGap).ToString())); forseenList.Add(foreseenActionsListAux.SingleOrDefault(x => x.Value == _enumMappingService.GetMappingCode(ForeseenActionTypeEnum.StrNationalSystem).ToString())); forseenList.Add(foreseenActionsListAux.SingleOrDefault(x => x.Value == _enumMappingService.GetMappingCode(ForeseenActionTypeEnum.OpenDialogue).ToString())); forseenList.Add(foreseenActionsListAux.SingleOrDefault(x => x.Value == _enumMappingService.GetMappingCode(ForeseenActionTypeEnum.ValidationSystem).ToString())); forseenList.Add(foreseenActionsListAux.SingleOrDefault(x => x.Value == _enumMappingService.GetMappingCode(ForeseenActionTypeEnum.AgreementImplement).ToString())); forseenList.Add(foreseenActionsListAux.SingleOrDefault(x => x.Value == _enumMappingService.GetMappingCode(ForeseenActionTypeEnum.StrengtheningIntervention).ToString())); forseenList.Add(foreseenActionsListAux.SingleOrDefault(x => x.Value == _enumMappingService.GetMappingCode(ForeseenActionTypeEnum.UseSystemSuspended).ToString())); ViewBag.ForeseenActionsList = forseenList; ViewBag.CloseGapId = _enumMappingService.GetMappingCode <ForeseenActionTypeEnum>(ForeseenActionTypeEnum.CloseGap); }
private void SetViewBag(string operationNumber, ResultMatrixViewModel resultMatrix) { var outcomeResponse = _linkPredefinedIndicatorService.GetLinkIndicatorModelForCSResultMatrix(false, "LinkIndicator"); ViewBag.LinkIndicatorModel = outcomeResponse.Filter; var expiredObjectiveResponse = _resultMatrixService.GetExpiredObjectives(operationNumber); ViewBag.AssociatedObjectiveList = expiredObjectiveResponse.ExpiredObjectives; ViewBag.CRFIndicators = new List <SelectListItem>(); if (resultMatrix != null) { var allOutcomes = resultMatrix.Components.SelectMany(x => x.Objectives).SelectMany(y => y.ExpectedOutcomeIndicators); var allCRFIndicatorIdUsed = allOutcomes.SelectMany(x => x.LinkedIndicators).Distinct(); var crfIndicatorResponse = _resultMatrixService.GetCRFIndicatorsById(allCRFIndicatorIdUsed); ViewBag.CRFIndicators = crfIndicatorResponse.CRFIndicators; } ViewBag.TCType = _enumMappingService.GetMappingCode(CSOperationTypeEnum.TechnicalCooperation); ViewBag.SGType = _enumMappingService.GetMappingCode(CSOperationTypeEnum.LoanOperation); }