Airline Reservation System VB – Guaranteed 100% Score
An airline company wants you to develop an application that displays flight information. The database contains two tables. one containing information about the nights, the other containing passenger information. The user should be able to choose a flight number from a ComboBox. When a night number is chosen the application should display the date of the flight, the flight’s departure and arrival cities and the names of the passengers scheduled to take the flight.
a. Programming the AirlineReservationForm_Load event handler. Double click the Form in Design view to create its Load event handler. Create a ReservationsDataClassesDataContext object as an instance variable above the Load event handler. In the Load event handler, use a LINQ query to retrieve all the flights from the Flights table in the database (ordered by flight number) and asign the result to FlightBindingSource’s DataSource properly. Below thte LINQ query, write code that retrieves the currently displayed Flight from the FlightBindingSource and passes the Flight’s FlightNumber to method DisplayPassengers (which you define in a later step).
Name: Jennifer Lucas
Status: Online ⬤
Classes Taken: 3878
b. Creating an event handler for the FlightBindingSource’s PositionChanged event. Select FlightBindingSource in the Class Name ComboBox, then select PositionChanged in the Method Name ComboBox to create the FlightBindingSource’s PositionChanged event handler. Write code to access the currently displayed Flight object and pass its Flight Number to method Display Passengers as a Decimal.
c. Defining the DisplayPassengers method. Create a Sub procedure named DisplayPassengers. This method takes as an argument a Decimal representing a flight number. Write a LINQ query that retrieves from the database all Reservations containing the given flight number ordered by the passenger’s name. Assign the result to ReservationBindingSource’s DataSource property.