Esempio n. 1
0
        internal void AddQuestion(ProfileQuestion question)
        {
            int maxQuestionNumber = GetMaxQuestionNumber();

            question.CustomQuestionOrder = maxQuestionNumber + 1;
            AddQuestionToCollections(question);
        }
Esempio n. 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));
            }
        }
Esempio n. 3
0
 private void AddQuestionToCollections(ProfileQuestion question)
 {
     ProfileQuestions.Add(question);
     if (question.IsCustomQuestion)
     {
         dictionaryCustomQuestions[question.CustomQuestionID] = question;
     }
     else
     {
         dictionaryDefaultQuestions[question.QuestionDefaultID] = question;
     }
 }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 6
0
 internal void UpdateSubLabelNumber(ProfileQuestion profileQuestion, int value)
 {
     throw new NotImplementedException();
 }
Esempio n. 7
0
 public void RemoveQuestion(ProfileQuestion profileQuestion)
 {
     ProfileQuestions.Remove(profileQuestion);
 }
Esempio n. 8
0
 internal bool DoesSubLabelNumberAlreadyExist(ProfileQuestion profileQuestion, int subLabelNumber)
 {
     throw new NotImplementedException();
 }
Esempio n. 9
0
 public ProfileImportQuestion(ProfileQuestion questionObj)
 {
     this.QuestionObj = questionObj;
 }