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