private Pago_ticket buildPago(MySqlDataReader data) { Pago_ticket item = new Pago_ticket( data.GetInt32("id"), data.GetInt32("id_ticket"), data.GetDouble("monto"), data.GetString("tipo_pago") ); return(item); }
public List <Pago_ticket> get_pago(int id_ticket) { string query = "select id, id_ticket, monto, tipo_pago from tbapagticket where id_ticket='" + id_ticket.ToString() + "'"; MySqlDataReader data = runQuery(query); List <Pago_ticket> result = new List <Pago_ticket>(); if (data.HasRows) { while (data.Read()) { Pago_ticket item = buildPago(data); result.Add(item); } } return(result); }