/// <summary> /// Returns a list of all classifications that are children of the current classification. Returns an /// empty list (count = 0) if none exist. /// </summary> /// <returns></returns> internal List <question> GetSubClassifications() { List <question> toReturn = new List <question>(); question q = new question(); DataTable dt = Search("SELECT * FROM questions WHERE parent = " + id + " AND is_classification = 1 ORDER BY order_id"); foreach (DataRow aRow in dt.Rows) { q = new question(); q.Load(aRow); toReturn.Add(q); } return(toReturn); }
public List <question> GetSubQuestions() { List <question> toReturn = new List <question>(); DataTable matches = Search("SELECT * FROM QUESTIONS WHERE parent = " + id + " AND is_classification <> 1 " + " ORDER BY order_id"); foreach (DataRow aRow in matches.Rows) { question toAdd = new question(); toAdd.Load(aRow); toReturn.Add(toAdd); } return(toReturn); }
internal List <question> SubCategories() { List <question> toReturn = new List <question>(); DataTable dt = Search("SELECT * FROM questions WHERE parent = " + id + " AND is_classification = 1 ORDER BY order_id"); question workingQuestion; foreach (DataRow aRow in dt.Rows) { workingQuestion = new question(); workingQuestion.Load(aRow); toReturn.Add(workingQuestion); } return(toReturn); }