private void LoadData(string depCountry, string depCity, string arrCountry, string arrCity, string depAirport, string arrAirport, DateTime startDate, DateTime endDate, string clas, int numPers) { using (FlightServiceClient fsc = new FlightServiceClient()) { this.lastFlightResults = fsc.getFlights(depCountry, depCity, arrCountry, arrCity, depAirport, arrAirport, startDate, endDate, clas, numPers); if (this.lastFlightResults == null) { textBlock1.Text = "Geen resultaten gevonden, probeer de filter aan te passen."; } else { textBlock1.Text = this.lastFlightResults.Count() + " vluchten gevonden."; foreach (Flight f in this.lastFlightResults) listBox1.Items.Add(f.departureCountry + ", " + f.departureCity + " -> " + f.arrivalCountry + ", " + f.arrivalCity); if (listBox1.Items.Count > 0) listBox1.SelectedIndex = 0; } } }