public TaskViewModel CreateGenericTaskForm(int definitionId) { IList <SelectOptionViewModel> languages = new LanguageListBuilder().CreateSelectedLanguageList("0"); TaskViewModel viewModel = new TaskViewModel(languages) { DefinitionId = definitionId }; viewModel.Roles.Add(new SelectOptionViewModel(TaskResources.SelectOne, "0")); foreach (Role role in _roleDAO.GetAllFilteredByCurrentCulture()) { // We want separate handling for rotation tasks, as the view should be quite different if (role.RoleType != RoleTypeEnum.Rotation) { viewModel.Roles.Add(new SelectOptionViewModel(role.Title, role.Id.ToString(CultureInfo.InvariantCulture))); } } viewModel.NoiseProtections.Add(new SelectOptionViewModel(TaskResources.SelectOne, "0")); foreach (NoiseProtection noiseProtection in _noiseProtectionDAO.GetAllFilteredByCurrentCulture()) { viewModel.NoiseProtections.Add(new SelectOptionViewModel(noiseProtection.Title, noiseProtection.Id.ToString(CultureInfo.InvariantCulture))); } return(viewModel); }