/// <summary> /// Parse the answer state and returns the /// answers of this question /// </summary> /// <returns></returns> protected virtual GridAnswerDataCollection GetGridVoterAnswers() { GridAnswerDataCollection gridAnswers = null; if (VoterAnswersState != null) { VoterAnswersData.VotersAnswersRow[] answerState = (VoterAnswersData.VotersAnswersRow[])VoterAnswersState.Select("QuestionId = " + QuestionId); if (answerState != null && answerState.Length > 0) { gridAnswers = new GridAnswerDataCollection(); for (int i = 0; i < answerState.Length; i++) { gridAnswers.Add(new GridAnswerData(answerState[i].QuestionId, answerState[i].AnswerId, answerState[i].SectionNumber, answerState[i].AnswerText, (AnswerTypeMode)answerState[i].TypeMode)); } } } return gridAnswers; }
/// <summary> /// Returns only specific section number answers /// </summary> private GridAnswerDataCollection GetSectionAnswers(int sectionNumber) { GridAnswerDataCollection datas = new GridAnswerDataCollection(); foreach (GridAnswerData data in this.GridVoterAnswers) { if (data.SectionNumber == sectionNumber) { datas.Add(data); } } return datas; }
public SectionAnswersItemEventArgs(int sectionNumber, GridAnswerDataCollection sectionAnswers) { this.SectionNumber = sectionNumber; this.SectionAnswers = sectionAnswers; }