Example #1
0
        public void InsertQuestionConstruct(QuestionVM question, bool manualOperation)
        {
            ConstructVM construct = ConstructVM.FindByQuestionId(constructs, question.Id);

            if (construct != null)
            {
                if (manualOperation)
                {
                    //show error message if added by screen
                    MessageBox.Show(Resources.AlreadySelectedQuestion); //This question is already selected
                }
                return;
            }
            QuestionConstruct questionConstructModel = new QuestionConstruct();

            questionConstructModel.QuestionId = question.Id;
            questionConstructModel.No         = ControlConstructScheme.QUESTION_NO_PREFIX + (ConstructUtils.QuestionConstructCount(constructs) + 1);
            QuestionConstructVM questionConstruct = new QuestionConstructVM(questionConstructModel, question);

            InsertConstruct(questionConstruct, manualOperation);
        }