private void LoadSurveyQuestions(Guid SurveyID) { classes.SQLCode mySQL = new classes.SQLCode(); List <classes.Question> surveyQuestions = mySQL.GetQuestionsBySurvey(SurveyID); surveyQuestions = surveyQuestions.OrderBy(a => a.QuestionNumber).ToList(); SerializeSurveyQuestions(surveyQuestions); lbCurrentQuestions.DataSource = surveyQuestions; lbCurrentQuestions.DataTextField = "QuestionText"; lbCurrentQuestions.DataValueField = "QuestionID"; lbCurrentQuestions.DataBind(); }
private void LoadQuestions(Guid SurveyID) { classes.SQLCode mySQL = new classes.SQLCode(); theseQuestions = mySQL.GetQuestionsBySurvey(SurveyID); foreach (classes.Question thisQuestion in theseQuestions) { List <classes.Answer> qAnswers = mySQL.GetAnswers(thisQuestion.QuestionID); foreach (classes.Answer thisAnswer in qAnswers) { theseAnswers.Add(thisAnswer); } } SerializeQuestions(theseQuestions); SerializeAnswers(theseAnswers); }