/// <summary> /// Post an event when there is a missing /// answer /// </summary> /// <param name="e">Question's answer if any was answered</param> protected virtual void OnSelectionRequired(QuestionItemAnswersEventArgs e) { if (this.SelectionRequired != null) { this.SelectionRequired(this, e); } }
/// <summary> /// Post an event when there are too many selections /// </summary> /// <param name="e">Question's answers</param> protected virtual void OnSelectionOverflow(QuestionItemAnswersEventArgs e) { if (this.SelectionOverflow != null) { this.SelectionOverflow(this, e); } }
/// <summary> /// Post an event when all answers have been /// collected and grouped. /// </summary> /// <param name="e">The question's answers</param> protected virtual void OnAnswersPost(QuestionItemAnswersEventArgs e) { if (this.AnswerPosted != null) { this.AnswerPosted(this, e); } }
/// <summary> /// Store the answers received in a /// temporary storage /// </summary> /// <param name="sender">The question that raised the event</param> /// <param name="e">Answers posted with the question</param> protected virtual void OnAnswerPost(object sender, QuestionItemAnswersEventArgs e) { int voterId = this.VoterAnswers.Voters[0].VoterId; foreach (PostedAnswerData data in e.Answers) { VoterAnswersData.VotersAnswersRow row = this.currentVisitorAnswerSet.VotersAnswers.NewVotersAnswersRow(); row.VoterId = voterId; row.AnswerId = data.AnswerId; row.QuestionId = data.Item.QuestionId; row.AnswerText = data.FieldText; row.SectionNumber = data.SectionNumber; row.TypeMode = (int)data.TypeMode; this.currentVisitorAnswerSet.EnforceConstraints = false; this.currentVisitorAnswerSet.VotersAnswers.AddVotersAnswersRow(row); } }
/// <summary> /// Set the control SelectionsAreRequired flag to true /// and stores the sender for futher processing /// </summary> /// <param name="sender">The question that raised the event</param> /// <param name="e">Answers, if any, posted with the question</param> protected virtual void OnSelectionRequired(object sender, QuestionItemAnswersEventArgs e) { if (sender is QuestionItem) { this._selectionsAreRequired = true; } }
/// <summary> /// Store the answers received in a /// temporary storage /// </summary> /// <param name="sender">The question that raised the event</param> /// <param name="e">Answers posted with the question</param> protected virtual void OnAnswerPost(Object sender, QuestionItemAnswersEventArgs e) { int voterId = _voterAnswers.Voters[0].VoterId; foreach (PostedAnswerData postedAnswer in e.Answers) { VoterAnswersData.VotersAnswersRow voterAnswer = updatedAnswerSet.VotersAnswers.NewVotersAnswersRow(); voterAnswer.VoterId = voterId; voterAnswer.AnswerId = postedAnswer.AnswerId; voterAnswer.QuestionId = postedAnswer.Item.QuestionId; voterAnswer.AnswerText = postedAnswer.FieldText; voterAnswer.SectionNumber = postedAnswer.SectionNumber; updatedAnswerSet.EnforceConstraints = false; updatedAnswerSet.VotersAnswers.AddVotersAnswersRow(voterAnswer); } }