Web project solution
We discussed the three pages of the web project:
- Landing page: will present landing flights. once the page is loaded an AJAX call will be executed to the server in order to fetch the flights which landed in the past 4 hours and about to land in the next 12 hours
- Departure page: will present the flights about to departure in the next 12 hours. once the page is loaded an AJAX call will be executed to the server in oreder to fetch the flights
- Search page: will provide a page where the user can search for flights. after the user fills up the searching fields and clicks “Search” an AJAX call will be executed in order to fetch the desired flights
After the AJAX call result has been resolved, we will iterate over the response array and add each flight result into the display table
Server-side: in order to support the AJAX call we need to add a web API endpoint for the landing-flights, departure-flights and the flights search. we can add those methods into the Anonymous facade (+api-Controller) or create a new facade, i.e. LandDepartueFacade (+api-controller) which will expose the requested functionality. the facade will call an ADO method which will execute an SQL query into the data-base in order to fetch the data. the SQL query should include all of the search parameters (i.e. landing time, searching filters etc.) instead of fetching the entire data and filtering out the results using LINQ
Javascript Implementation recommendations:
- Create a Flight class ( flights.js )
- Create a Flight instance for each result item of the AJAX response
- Calculate the flight status in the Flight ctor
- Bonus feature: present only 30 flights in each table and add navigation buttons
Links: