public List <Offices> GetOfficesbyrfc(string rfc) { string query = maq_query + " where rfc='" + rfc + "' "; MySqlDataReader data = runQuery(query); List <Offices> result = new List <Offices>(); if (data.HasRows) { while (data.Read()) { Offices item = buildOffice(data); result.Add(item); } } return(result); }
public List <Offices> GetOfficesbyid(int id) { string query = maq_query + " where id='" + id.ToString() + "'"; MySqlDataReader data = runQuery(query); List <Offices> result = new List <Offices>(); if (data.HasRows) { while (data.Read()) { Offices item = buildOffice(data); result.Add(item); } } return(result); }
private Offices buildOffice(MySqlDataReader data) { Offices item = new Offices( data.GetInt32("id"), data.GetString("nombre"), data.GetString("domicilio"), data.GetString("telefono"), data.GetString("servidor"), data.GetString("conect"), data.GetString("notas"), data.GetString("factura"), data.GetString("rfc"), data.GetString("interior"), data.GetString("exterior"), data.GetString("calle"), data.GetString("colonia"), data.GetString("cp"), data.GetString("municipio"), data.GetString("estado") ); return(item); }