예제 #1
0
        internal void AddQuestion(ProfileQuestion question)
        {
            int maxQuestionNumber = GetMaxQuestionNumber();

            question.CustomQuestionOrder = maxQuestionNumber + 1;
            AddQuestionToCollections(question);
        }
예제 #2
0
        internal Tuple <bool, ProfileQuestion> AddImportQuestion(ProfileImportQuestion importQuestion)
        {
            ProfileCategory category;

            if (!dictionaryCategoriesBySubLabel.TryGetValue(importQuestion.CategorySubLabel, out category))
            {
                category          = new ProfileCategory(this);
                category.SubLabel = importQuestion.CategorySubLabel;
                category.Heading  = importQuestion.Category;
                category.IsSelect = true;
                AddCategory(category);
            }


            if (!category.ContainsImportQuestion(importQuestion))
            {
                ProfileQuestion question = new ProfileQuestion(category, RankingManger, importQuestion);
                category.AddQuestion(question);
                return(Tuple.Create(true, question));
            }
            else
            {
                return(Tuple.Create <bool, ProfileQuestion>(false, null));
            }
        }
예제 #3
0
 private void AddQuestionToCollections(ProfileQuestion question)
 {
     ProfileQuestions.Add(question);
     if (question.IsCustomQuestion)
     {
         dictionaryCustomQuestions[question.CustomQuestionID] = question;
     }
     else
     {
         dictionaryDefaultQuestions[question.QuestionDefaultID] = question;
     }
 }
예제 #4
0
        internal bool IsSame(ProfileQuestion question)
        {
            if (this.Comments != Comments || this.SupplementalInfo != question.SupplementalInfo ||
                this.Question != question.Question || this.References != question.References ||
                this.SubLabelNumber != question.SubLabelNumber || this.IsSelect != question.IsSelect || this.IsCustomQuestion != question.IsCustomQuestion)
            {
                return(false);
            }
            if (this.IsCustomQuestion && question.IsCustomQuestion)
            {
                if (this.CustomQuestionID != question.CustomQuestionID)
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #5
0
        internal static ProfileQuestion CreateNewQuestion(ProfileCategory profileCategory, RankingManager rankingManager)
        {
            int             nextSubLabelNumber = profileCategory.GetNextSubLabelNumber();
            ProfileQuestion question           = new ProfileQuestion(profileCategory, rankingManager)
            {
                SubFunCatLabel = profileCategory.SubFunCatLabel,
                SubLabelNumber = nextSubLabelNumber
            };

            question.Weight           = 10;
            question.CanDelete        = true;
            question.CanEdit          = true;
            question.CanSelect        = true;
            question.IsCustomQuestion = true;
            question.CustomQuestionID = Guid.NewGuid();
            question.IsSelect         = true;

            return(question);
        }
예제 #6
0
 internal void UpdateSubLabelNumber(ProfileQuestion profileQuestion, int value)
 {
     throw new NotImplementedException();
 }
예제 #7
0
 public void RemoveQuestion(ProfileQuestion profileQuestion)
 {
     ProfileQuestions.Remove(profileQuestion);
 }
예제 #8
0
 internal bool DoesSubLabelNumberAlreadyExist(ProfileQuestion profileQuestion, int subLabelNumber)
 {
     throw new NotImplementedException();
 }
예제 #9
0
 public ProfileImportQuestion(ProfileQuestion questionObj)
 {
     this.QuestionObj = questionObj;
 }