public static FancyTreeNode ToFancyTreeNode(this AssessmentSubGoal assessmentSubGoal, List <IQuestionAnswer> projectAssessmentQuestionsDict) { var fancyTreeNode = new FancyTreeNode(assessmentSubGoal.GetDisplayName(), assessmentSubGoal.AssessmentGoalID.ToString(), false) { Children = assessmentSubGoal.GetActiveQuestions().Select(x => x.ToFancyTreeNode(projectAssessmentQuestionsDict)).ToList() }; return(fancyTreeNode); }
public static FancyTreeNode ToFancyTreeNode(this AssessmentQuestion assessmentQuestion, List <IQuestionAnswer> projectAssessmentQuestions) { var projectAssessmentQuestion = projectAssessmentQuestions != null && projectAssessmentQuestions.Any() ? projectAssessmentQuestions.SingleOrDefault(x => x.AssessmentQuestionID == assessmentQuestion.AssessmentQuestionID) : null; var answer = projectAssessmentQuestion?.Answer; var fancyTreeNode = new FancyTreeNode(assessmentQuestion.AssessmentQuestionText, assessmentQuestion.AssessmentQuestionID.ToString(), false) { Answer = answer.HasValue ? answer.ToYesNo() : ViewUtilities.NoAnswerProvided }; return(fancyTreeNode); }