public List <CallQuestion> GetCallQuestions() { List <CallQuestion> toReturn = new List <CallQuestion>(); List <question> claimQuestions = LinkedClaim.Questions; foreach (question q in claimQuestions) { toReturn.Add(new CallQuestion(q, this)); } List <choice> callChoices = new List <choice>(); DataTable linkedChoices = Search("SELECT * FROM choices WHERE call_id = " + id + " UNION SELECT * FROM large_choices WHERE call_id = " + id); foreach (DataRow aChoice in linkedChoices.Rows) { choice c = new choice(); c.Load(aChoice); c.LinkedCall = this; CallQuestion cq = FindCallQuestion(c.question_id, toReturn); if (cq != null) { c.LinkedQuestion = cq.Question; cq.Choice = c; } } return(toReturn); }
public List <choice> GetCallChoices() { List <choice> toReturn = new List <choice>(); DataTable allChoices = Search("SELECT * FROM choices WHERE call_id = " + id + " UNION SELECT * FROM large_choices WHERE call_id = " + id); foreach (DataRow aRow in allChoices.Rows) { choice toAdd = new choice(); toAdd.Load(aRow); toReturn.Add(toAdd); } return(toReturn); }