public List <Tickets> getLastTicket(string fecha, double subtotal, double descuento, double iva, double total, int cliente) { string query = "select id,folio, id_cliente, fecha, subtotal, descuento, iva, total, status, c_iva, s_iva, id_usuario, atendio, a_facturar, recibido from tbatickets where fecha='" + fecha + "' and subtotal='" + subtotal.ToString() + "' and iva='" + iva.ToString() + "' and descuento='" + descuento.ToString() + "' and total='" + total.ToString() + "' and id_cliente='" + cliente + "'"; MySqlDataReader data = runQuery(query); List <Tickets> result = new List <Tickets>(); if (data.HasRows) { while (data.Read()) { Tickets item = buildTicket(data); result.Add(item); } } return(result); }
public List <Tickets> getTicketsbyFechas(string fecha1, string fecha2) { string query = "select id,folio, id_cliente, fecha, subtotal, descuento, iva, total, status, c_iva, s_iva,id_usuario, atendio, a_facturar, recibido from tbatickets where fecha BETWEEN '" + fecha1 + "' and '" + fecha2 + "'"; MySqlDataReader data = runQuery(query); List <Tickets> result = new List <Tickets>(); if (data.HasRows) { while (data.Read()) { Tickets item = buildTicket(data); result.Add(item); } } return(result); }
public List <Tickets> getforbuild(string id_cliente) { string query = "select id,folio, id_cliente, fecha, subtotal, descuento, iva, total, status, c_iva, s_iva,id_usuario, atendio, a_facturar, recibido from tbatickets where id_cliente='" + id_cliente + "' and folio NOT IN (select ticket from tbatickafact)"; MySqlDataReader data = runQuery(query); List <Tickets> result = new List <Tickets>(); if (data.HasRows) { while (data.Read()) { Tickets item = buildTicket(data); result.Add(item); } } return(result); }
public List <Tickets> getActiveTicketsbyId(int id) { string query = "select id,folio, id_cliente, fecha, subtotal, descuento, iva, total, status, c_iva, s_iva, id_usuario,atendio, a_facturar, recibido from tbatickets where folio='" + id.ToString() + "' and status='A'"; MySqlDataReader data = runQuery(query); List <Tickets> result = new List <Tickets>(); if (data.HasRows) { while (data.Read()) { Tickets item = buildTicket(data); result.Add(item); } } return(result); }
public List <Tickets> getTickets_guardados() { string query = "select id,folio, id_cliente, fecha, subtotal, descuento, iva, total, status, c_iva, s_iva, id_usuario,atendio, a_facturar, recibido from tbatickets where status='G' order by folio desc"; MySqlDataReader data = runQuery(query); List <Tickets> result = new List <Tickets>(); if (data.HasRows) { while (data.Read()) { Tickets item = buildTicket(data); result.Add(item); } } return(result); }
public List <Tickets> getbyUser(int id_perosna) { DateTime thisDay = DateTime.Today; string query = "select id,folio, id_cliente, fecha, subtotal, descuento, iva, total, status, c_iva, s_iva, id_usuario, atendio, a_facturar, recibido from tbatickets where id_usuario='" + id_perosna.ToString() + "' and fecha like '%" + thisDay.ToString("yyyy-MM-dd") + "%'"; MySqlDataReader data = runQuery(query); List <Tickets> result = new List <Tickets>(); if (data.HasRows) { while (data.Read()) { Tickets item = buildTicket(data); result.Add(item); } } return(result); }
private Tickets buildTicket(MySqlDataReader data) { Tickets item = new Tickets( data.GetInt32("id"), data.GetInt32("folio"), data.GetInt32("id_cliente"), data.GetString("fecha"), data.GetDouble("subtotal"), data.GetDouble("descuento"), data.GetDouble("iva"), data.GetDouble("total"), data.GetString("status"), data.GetDouble("c_iva"), data.GetDouble("s_iva"), data.GetInt32("id_usuario"), data.GetInt32("atendio"), data.GetInt32("a_facturar"), data.GetDouble("recibido") ); return(item); }