public ActionResult IndicatorNew() { // Get text properties of selected indicator var properties = _reader.GetIndicatorMetadataTextProperties(); var userId = _reader.GetUserByUserName(UserDetails.CurrentUser().Name).Id; var permissionIds = _reader.GetUserGroupPermissionsByUserId(userId).Select(x => x.ProfileId); var model = new ProfileIndex { Profiles = _reader.GetProfiles() .OrderBy(x => x.Name) .Where(x => permissionIds.Contains(x.Id)) }; var listOfProfiles = CommonUtilities.GetOrderedListOfProfiles(model.Profiles); ViewBag.listOfProfiles = listOfProfiles; var domains = new ProfileMembers(); var defaultProfile = listOfProfiles.FirstOrDefault(); ViewBag.listOfDomains = CommonUtilities.GetOrderedListOfDomainsWithGroupId(domains, defaultProfile, _profileRepository); ViewBag.selectedSex = new SelectList(_lookUpsRepository.GetSexes(), "SexID", "Description"); ViewBag.selectedAge = new SelectList(_lookUpsRepository.GetAges(), "AgeID", "Description"); var comparatorOptions = CommonUtilities.GetListOfComparators(ComparatorIds.NationalAndSubnational); ViewBag.selectedComparator = new SelectList(comparatorOptions, "Value", "Text"); ViewBag.selectedComparatorMethod = new SelectList(_reader.GetAllComparatorMethods(), "Id", "Name"); ViewBag.selectedYearType = new SelectList(_lookUpsRepository.GetYearTypes(), "Id", "Label"); ViewBag.selectedValueType = new SelectList(_lookUpsRepository.GetIndicatorValueTypes(), "Id", "Label"); ViewBag.selectedCIMethodType = new SelectList(_lookUpsRepository.GetConfidenceIntervalMethods(), "Id", "Name"); ViewBag.selectedUnitType = new SelectList(_lookUpsRepository.GetUnits(), "Id", "Label"); ViewBag.selectedDenominatorType = new SelectList(_lookUpsRepository.GetDenominatorTypes(), "Id", "Name"); return(View(properties)); }