private void InsertStatementConstruct(Statement statementModel) { statementModel.No = ControlConstructScheme.STATEMENT_NO_PREFIX + (ConstructUtils.StatementCount(constructs) + 1); StatementVM statement = new StatementVM(statementModel); InsertConstruct(statement, true); }
public void InsertQuestionGroupConstruct(QuestionGroupVM questionGroup, bool manualOperation) { ConstructVM construct = ConstructVM.FindByQuestionGroupId(constructs, questionGroup.Id); if (construct != null) { if (manualOperation) { MessageBox.Show(Resources.AlreadySelectedQuestionGroup); //This question group is already selected } return; } QuestionGroupConstruct questionGroupConstructModel = new QuestionGroupConstruct(); questionGroupConstructModel.QuestionGroupId = questionGroup.Id; questionGroupConstructModel.No = ControlConstructScheme.QUESTION_GROUP_NO_PREFIX + (ConstructUtils.QuestionGroupConstructCount(constructs) + 1); QuestionGroupConstructVM questionGroupConstruct = new QuestionGroupConstructVM(questionGroupConstructModel, questionGroup); InsertConstruct(questionGroupConstruct, manualOperation); }
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); }