public PersonaGateway Buscar(long personaId) { SqlCommand consulta = new SqlCommand(cadenaBusqueda, BD()); consulta.Parameters.AddWithValue("@personaId", personaId); consulta.Connection.Open(); SqlDataReader fila = consulta.ExecuteReader(); fila.Read(); return(PersonaGateway.Load(fila)); }
public List <PersonaGateway> BuscarResponsables() { SqlCommand consulta = new SqlCommand(cadenaBusquedaDependientes, BD()); consulta.Connection.Open(); SqlDataReader filas = consulta.ExecuteReader(); List <PersonaGateway> resultado = new List <PersonaGateway>(); while (filas.Read()) { resultado.Add(PersonaGateway.Load(filas)); } return(resultado); }