public static IEnumerable <CurrencyStatusItem> AircraftInspectionWarningsForUser(string szUser, IEnumerable <DeadlineCurrency> aircraftDeadlines) { Aircraft[] rgar = MaintenanceLog.AircraftMaintainedByUser(szUser); List <CurrencyStatusItem> arcs = new List <CurrencyStatusItem>(); List <DeadlineCurrency> lstDeadlines = (aircraftDeadlines == null) ? new List <DeadlineCurrency>() : new List <DeadlineCurrency>(aircraftDeadlines); if (rgar != null) { foreach (Aircraft ar in rgar) { MaintenanceRecord mr = ar.Maintenance; AddPendingInspection(arcs, ar.TailNumber + Resources.Aircraft.CurrencyAltimeter, mr.NextAltimeter, ar.AircraftID, 30); AddPendingInspection(arcs, ar.TailNumber + Resources.Aircraft.CurrencyAnnual, mr.NextAnnual, ar.AircraftID, 30); AddPendingInspection(arcs, ar.TailNumber + Resources.Aircraft.CurrencyELT, mr.NextELT, ar.AircraftID, 30); AddPendingInspection(arcs, ar.TailNumber + Resources.Aircraft.CurrencyPitot, mr.NextStatic, ar.AircraftID, 30); AddPendingInspection(arcs, ar.TailNumber + Resources.Aircraft.CurrencyXPonder, mr.NextTransponder, ar.AircraftID, 30); AddPendingInspection(arcs, ar.TailNumber + Resources.Aircraft.CurrencyVOR, mr.NextVOR, ar.AircraftID, 4); AddPendingInspection(arcs, ar.TailNumber + Resources.Aircraft.CurrencyRegistration, mr.RegistrationExpiration, ar.AircraftID, 30); arcs.AddRange(DeadlineCurrency.CurrencyForDeadlines(lstDeadlines.FindAll(dc => ar.AircraftID == dc.AircraftID))); } } return(arcs); }
public static IEnumerable <CurrencyStatusItem> AircraftInspectionWarningsForUser(string szUser) { Aircraft[] rgar = MaintenanceLog.AircraftMaintainedByUser(szUser); List <CurrencyStatusItem> arcs = new List <CurrencyStatusItem>(); if (rgar != null) { foreach (Aircraft ar in rgar) { MaintenanceRecord mr = ar.Maintenance; AddPendingInspection(arcs, ar.TailNumber + Resources.Aircraft.CurrencyAltimeter, mr.NextAltimeter, ar.AircraftID); AddPendingInspection(arcs, ar.TailNumber + Resources.Aircraft.CurrencyAnnual, mr.NextAnnual, ar.AircraftID); AddPendingInspection(arcs, ar.TailNumber + Resources.Aircraft.CurrencyELT, mr.NextELT, ar.AircraftID); AddPendingInspection(arcs, ar.TailNumber + Resources.Aircraft.CurrencyPitot, mr.NextStatic, ar.AircraftID); AddPendingInspection(arcs, ar.TailNumber + Resources.Aircraft.CurrencyXPonder, mr.NextTransponder, ar.AircraftID); AddPendingInspection(arcs, ar.TailNumber + Resources.Aircraft.CurrencyVOR, mr.NextVOR, ar.AircraftID); AddPendingInspection(arcs, ar.TailNumber + Resources.Aircraft.CurrencyRegistration, mr.RegistrationExpiration, ar.AircraftID); } } return(arcs); }