private void AddTaskListsToViewModel(RotationTaskViewModel viewModel, Rotation rotation) { viewModel.OperatorTasks.Add(new SelectOptionViewModel(TaskResources.SelectOne, "0")); viewModel.AssistantTasks.Add(new SelectOptionViewModel(TaskResources.SelectOne, "0")); foreach (Task task in _taskDAO.GetAllOrdered().Where(x => x.Role.RoleType == RoleTypeEnum.Regular)) { SelectOptionViewModel selectOption = new SelectOptionViewModel(task.Title, task.Id.ToString(CultureInfo.InvariantCulture)); if (task.Role.SystemTitle == "Operator") { selectOption.IsSelected = (rotation != null && task.Id == rotation.OperatorTask.Id); viewModel.OperatorTasks.Add(selectOption); } else if (task.Role.SystemTitle == "Assistant") { selectOption.IsSelected = (rotation != null && task.Id == rotation.AssistantTask.Id); viewModel.AssistantTasks.Add(selectOption); } } }