/// <summary>
        /// Search for an accidents with a given Aircraft Category, display the accidents and save them to the file.
        /// </summary>
        /// <param name="AircraftCategory">Aircraft Category</param>
        public void AccidentsByAirplane(string AircraftCategory)
        {
            List <IUser> flights = flightsInfo.Where(x => x.AircraftCategory.Trim() == AircraftCategory && AircraftCategory != "").ToList();

            if (flights.Count == 0)
            {
                DecoratorsAndUIMethods.NoInformationFoundMessage();
                return;
            }
            flights.SaveSearchResults(HelperMethods.GetTheRootFolderPath() + GlobalConfig.ACCIDENTBYAIRPLANESEARCHFILE, "Airplane", $"{AircraftCategory}");
            foreach (var flight in flights)
            {
                flight.DecorateWithTitle($"Accidents with {AircraftCategory}");
            }
        }
        /// <summary>
        /// Search for an accidents with a given Country, display the accidents and save them to the file.
        /// </summary>
        /// <param name="Country">Country name</param>
        public void AccidentsByCountry(string Country)
        {
            List <IUser> flights = flightsInfo.Where(x => x.Country.Trim() == Country && Country != "").ToList();

            if (flights.Count == 0)
            {
                DecoratorsAndUIMethods.NoInformationFoundMessage();
                return;
            }
            flights.SaveSearchResults(HelperMethods.GetTheRootFolderPath() + GlobalConfig.ACCIDENTBYCOUNTRYSEARCHFILE, "Country", $"{Country}");
            foreach (var flight in flights)
            {
                flight.DecorateWithTitle($"Accidents in {Country}");
            }
        }
        /// <summary>
        /// Search for an accidents between the given dates, display the accidents and save them to the file.
        /// </summary>
        /// <param name="From">From date</param>
        /// <summary>
        /// Initialize all flights.
        /// </summary>
        /// <param name="To">To date</param>
        public void AccidentsBetweenDates(DateTime From, DateTime To)
        {
            List <IUser> flights = flightsInfo.Where(x => Convert.ToDateTime(x.EventDate).IsBetween(From, To)).ToList();

            if (flights.Count == 0)
            {
                DecoratorsAndUIMethods.NoInformationFoundMessage();
                return;
            }
            flights.SaveSearchResults(HelperMethods.GetTheRootFolderPath() + GlobalConfig.ACCIDENTBETWEENDATESSEARCHFILE, "Between", $"{From.Day}/{From.Month}/{From.Year} and {To.Day}/{To.Month}/{To.Year}");
            foreach (var flight in flights)
            {
                flight.DecorateWithTitle($"Accidents between {From.Day}/{From.Month}/{From.Year} and {To.Day}/{To.Month}/{To.Year}");
            }
        }
        /// <summary>
        /// Search for an accidents with a given Air Carrier, display the accidents and save them to the file.
        /// </summary>
        /// <param name="AirCarrier">Air Carrier name</param>
        public void AccidentsByAirCarrier(string AirCarrier)
        {
            List <IUser> flights = flightsInfo.Where(x => x.AirCarrier.Trim() == AirCarrier && AirCarrier != "").ToList();

            if (flights.Count == 0)
            {
                DecoratorsAndUIMethods.NoInformationFoundMessage();
                return;
            }
            flights.SaveSearchResults(HelperMethods.GetTheRootFolderPath() + GlobalConfig.ACCIDENTBYAIRCARRIERSFILE, "AirCarrier", $"{AirCarrier}");
            foreach (var flight in flights)
            {
                flight.DecorateWithTitle($"Accidents by {AirCarrier} air carrier");
            }
        }
        /// <summary>
        /// Search for an accidents with a given Weather conditions, display the accidents and save them to the file.
        /// </summary>
        /// <param name="WCondition">Type of conditions</param>
        public void AccidentsByWeatherCondition(string WCondition)
        {
            List <IUser> flights = flightsInfo.Where(x => x.WeatherCondition.Trim() == WCondition && WCondition != "").ToList();

            if (flights.Count == 0)
            {
                DecoratorsAndUIMethods.NoInformationFoundMessage();
                return;
            }
            flights.SaveSearchResults(HelperMethods.GetTheRootFolderPath() + GlobalConfig.ACCIDENTBYWEATHERCONDITIONFILE, "Weather Conditions", $"{WCondition}");
            foreach (var flight in flights)
            {
                flight.DecorateWithTitle($"Accidents in {WCondition} weather condition");
            }
        }
 /// <summary>
 /// Display that no information available
 /// </summary>
 public void TwentyMostCrowdedFlights()
 {
     DecoratorsAndUIMethods.NoInformationFoundMessage();
 }
 /// <summary>
 /// Display that no information available
 /// </summary>
 public void AccidentStatisticByAirplaneType()
 {
     DecoratorsAndUIMethods.NoInformationFoundMessage();
 }
Exemple #8
0
 /// <summary>
 /// Display that no information available
 /// </summary>
 public void AccidentsByAirCarrier(string AirCarrier)
 {
     DecoratorsAndUIMethods.AccessDeniedMessage();
 }
Exemple #9
0
 /// <summary>
 /// Display that no information available
 /// </summary>
 public void TenMostSeriousInjuries()
 {
     DecoratorsAndUIMethods.AccessDeniedMessage();
 }
Exemple #10
0
 /// <summary>
 /// Display that no information available
 /// </summary>
 public void AccidentStatisticByPurposeOfFlight()
 {
     DecoratorsAndUIMethods.AccessDeniedMessage();
 }
Exemple #11
0
 /// <summary>
 /// Display that no information available
 /// </summary>
 public void AccidentsByWeatherCondition(string WCondition)
 {
     DecoratorsAndUIMethods.AccessDeniedMessage();
 }