コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }