/// <summary> /// Enlaza los datos datgridviews con su respectivo Datasources /// </summary> public List <InterJetFlight> BindFlights() { var userInput = (InterJetAvailabilityUserInput)Session["UserInput"]; if (userInput != null) { if (FlightManager.IsPointToPoint(userInput.DepartureStation, userInput.ArrivalStation)) { InterJetFlightsAvailability interJetAvailability = InterJetServiceManager.GetAvailability(userInput); if (interJetAvailability != null) { if (interJetAvailability.HasDepartureFlights) { this.DepartureInformationLabel.Text = userInput.DepartureFlightInformation; this.DepartureIntineraryInformationLabel.Text = userInput.DepartureFlightIntineraryInformation; return(interJetAvailability.GetDepartureFlights()); } else { return(new List <InterJetFlight>()); } } } else { //e.Result = // "LA RUTA INGRESADA NO CORRESPONDE A UN VUELO PUNTO A PUNTO; SOLICITE DISPONIBILIDAD VÍA LAS OPCIONES:\n\n"; // throw new DestinationNotFoundException("LA RUTA INGRESADA NO CORRESPONDE A UN VUELO PUNTO A PUNTO; SOLICITE DISPONIBILIDAD VÍA LAS OPCIONES:\n\n"); } } return(new List <InterJetFlight>()); }
/// <summary> /// Enlaza los datos datgridviews con su respectivo Datasources /// </summary> public void BindFlights(object sender, DoWorkEventArgs e) { var userInput = (InterJetAvailabilityUserInput)this.Session["UserInput"]; if (userInput != null) { if (this.FlightManager.IsPointToPoint(userInput.DepartureStation, userInput.ArrivalStation)) { InterJetFlightsAvailability interJetAvailability = InterJetServiceManager.GetAvailability(userInput); if (interJetAvailability != null) { if (interJetAvailability.HasDepartureFlights) { this.DepartureInformationLabel.Text = userInput.DepartureFlightInformation; this.DepartureIntineraryInformationLabel.Text = userInput.DepartureFlightIntineraryInformation; e.Result = interJetAvailability.GetDepartureFlights(); } else { e.Result = "NO SE ENCONTRARON VUELOS DISPONIBLES, POR FAVOR INTENTE EN OTRAS FECHAS."; //throw new Exception("NO SE ENCONTRARON VUELOS DISPONIBLES, POR FAVOR INTENTE EN OTRAS FECHAS."); } } } else { e.Result = "LA RUTA INGRESADA NO CORRESPONDE A UN VUELO PUNTO A PUNTO; SOLICITE DISPONIBILIDAD VÍA LAS OPCIONES:\n\n"; // throw new DestinationNotFoundException("LA RUTA INGRESADA NO CORRESPONDE A UN VUELO PUNTO A PUNTO; SOLICITE DISPONIBILIDAD VÍA LAS OPCIONES:\n\n"); } } }