void AddLandingCurrency(Section section, List <Aircraft> list, AircraftClassification @class, bool night, bool tailDragger)
        {
            string   caption       = string.Format("{0} Current{1}", night ? "Night" : "Day", tailDragger ? " (TailDragger)" : "");
            DateTime oldestLanding = DateTime.Now;
            int      landings      = 0;

            foreach (var flight in LogBook.GetFlightsForPassengerCurrencyRequirements(list, night))
            {
                landings += flight.NightLandings;

                if (!night)
                {
                    landings += flight.DayLandings;
                }

                oldestLanding = flight.Date;

                if (landings >= 3)
                {
                    section.Add(new CurrencyElement(caption, oldestLanding.AddDays(90)));
                    return;
                }
            }

            // currency is out of date
            section.Add(new CurrencyElement(caption, DateTime.Now));
        }
Example #2
0
        static void AddLandingCurrency(Section section, List <Aircraft> aircraft, bool night)
        {
            string   caption = string.Format("{0} Current", night ? "Night" : "Day");
            DateTime oldestLanding;
            int      landings = 0;

            if (aircraft != null && aircraft.Count > 0)
            {
                foreach (var flight in LogBook.GetFlightsForPassengerCurrencyRequirements(aircraft, night))
                {
                    landings += flight.NightLandings;

                    if (!night)
                    {
                        landings += flight.DayLandings;
                    }

                    oldestLanding = flight.Date;

                    if (landings >= 3)
                    {
                        section.Add(new CurrencyElement(caption, oldestLanding.AddDays(90)));
                        return;
                    }
                }
            }

            // currency is out of date
            section.Add(new CurrencyElement(caption, DateTime.Now));
        }