/// <summary>
        /// The function being called when the flight event occured.
        /// </summary>
        /// <param name="args">The arguments being processed by the event subscribers.</param>
        private void OnFlightEvent(FlightMoveArgs args)
        {
            if (args.StationId != null)
            {
                StationModel station = stationsRepository.Get((int)args.StationId);
                station.FlightId = args.Flight.ID;
                stationsRepository.Update(station);
            }
            if (args.OldStation != null && args.OldStation.Id != 0)
            {
                StationModel oldStation = stationsRepository.Get(args.OldStation.Id);
                oldStation.FlightId = null;
                stationsRepository.Update(oldStation);
            }

            FlightEnterEvent.Invoke(args);
        }
Exemplo n.º 2
0
 private void OnFlightEvent(FlightEventArgs args)
 {
     FlightEnterEvent.Invoke(args);
 }