Example #1
0
        public List <Aeropuerto> filtrarAeropuertos(string criterio)
        {
            List <Aeropuerto> oListAeropuerto = new List <Aeropuerto>();

            try
            {
                conexion.Open();
                SqlCommand comando = new SqlCommand("SP_FILTRAR_AEROPUERTO", conexion);
                comando.Parameters.Add("@criterio", SqlDbType.VarChar).Value = criterio;
                comando.CommandType = CommandType.StoredProcedure;
                SqlDataReader lector = comando.ExecuteReader();

                while (lector.Read())
                {
                    Aeropuerto oAeropuerto = new Aeropuerto();
                    oAeropuerto.IATA_aeropuertoID = ((string)lector["IATA_aeropuertoID"]);
                    //oAeropuerto.nombreAeropuerto = ((string)lector["nombreAeropuerto"]);
                    oAeropuerto.oCiudad.nombreCiudad = ((string)lector["nombreCiudad"]);
                    oListAeropuerto.Add(oAeropuerto);
                }
                lector.Close();
                conexion.Close();
                return(oListAeropuerto);
            }
            catch (Exception)
            {
                conexion.Close();
                return(null);
            }
        }
 public Vuelo_Programado(string _numeroVuelo, Aeropuerto _origen, Aeropuerto _destino, DateTime _horaSalida, double _tiempoDeVuelo)
 {
     numeroVuelo   = _numeroVuelo;
     origen        = _origen;
     destino       = _destino;
     horaSalida    = _horaSalida;
     tiempoDeVuelo = _tiempoDeVuelo;
 }
 public Vuelo_Programado()
 {
     origen  = new Aeropuerto();
     destino = new Aeropuerto();
 }