public List <StatByProbleme> find_all(String dat) { Probleme p = new Probleme(); Dictionary <string, string> id2 = new Dictionary <string, string>(); Dictionary <string, string> id3 = new Dictionary <string, string>(); List <StatByProbleme> stat = new List <StatByProbleme>(); this.connect(); SqlDataReader result = this.select(dat); while (result.Read()) { id2["IdProbleme"] = "" + result.GetInt32(0); p = p.find_by_id(id2); stat.Add(new StatByProbleme( p, result.GetInt32(1) )); } return(stat); }
public List <Solution> find_solution(SqlDataReader sql) { List <Solution> solutions = new List <Solution>(); Dictionary <string, string> id = new Dictionary <string, string>(); Probleme p = new Probleme(); this.connect(); SqlDataReader result = sql; while (result.Read()) { id["IdProbleme"] = "" + result.GetInt32(2); p = p.find_by_id(id); solutions.Add(new Solution( result.GetInt32(0), result.GetString(1), p )); } this.disconnect(); return(solutions); }