public static Course CreateForm(OdbcDataReader reader) { Course course = new Course(); Course.CreateForm(reader, course); return(course); }
// Load data from db into itself public override bool LoadFromDB(DBManager db, string sqlCriteria) { OdbcDataReader reader = db.Query("SELECT * FROM course WHERE " + sqlCriteria); if (!reader.Read()) { return(false); } return(Course.CreateForm(reader, this)); }
public static Course[] LoadListFromDBCustom(DBManager db, string sqlAll) { OdbcDataReader reader = db.Query(sqlAll); LinkedList <Course> list = new LinkedList <Course>(); while (reader.Read()) { list.AddLast(Course.CreateForm(reader)); } Course[] entities = new Course[list.Count]; int i = 0; foreach (Course t in list) { entities[i++] = t; } return(entities); }