示例#1
0
        /// <summary>
        /// Loads the passengers into the list of passengers for this aircraft from based on the passenger flight link in the database
        /// </summary>
        public void LoadPassengers()
        {
            var query =
                from passenger in FlightController.GetAllPassengers()
                join link in FlightController.GetAllLinks() on passenger.ID equals link.Passenger_ID
                where link.Flight_ID == _flightInfo.Flight_ID
                select passenger;

            Passengers.AddRange(query);
        }
示例#2
0
        /// <summary>
        /// Which seats on this aircraft are filled
        /// </summary>
        /// <returns></returns>
        public IEnumerable <int> GetFilledSeats()
        {
            var query =
                from passenger in FlightController.GetAllPassengers()
                join link in FlightController.GetAllLinks() on passenger.ID equals link.Passenger_ID
                where link.Flight_ID == _flightInfo.Flight_ID
                select link;

            List <int> filledSeats = new List <int>();

            foreach (FlightPassengerLink link in query)
            {
                filledSeats.Add(link.Seat_Number);
            }
            return(filledSeats);
        }