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