//returns if there is flight restrictions from one country to another public static Boolean HasRestriction(Country from, Country to, DateTime date, FlightRestriction.RestrictionType type) { FlightRestriction restriction = GetRestrictions().Find(r => (r.From == from || (r.From is Union && ((Union)r.From).isMember(from, date))) && (r.To == to || (r.To is Union && ((Union)r.To).isMember(to, date))) && (date >= r.StartDate && date <= r.EndDate) && r.Type == type); //FlightRestriction res = GetRestrictions().Find(r => r.From == from && r.To == to && r.Type == type); return(restriction != null); }
//returns if there is flight restrictions from one country to another public static Boolean HasRestriction(Country from, Country to, DateTime date, FlightRestriction.RestrictionType type) { FlightRestriction restriction = GetRestrictions().Find(r=>(r.From == from || (r.From is Union && ((Union)r.From).isMember(from,date))) && (r.To == to || (r.To is Union && ((Union)r.To).isMember(to,date))) && (date>=r.StartDate && date<=r.EndDate) && r.Type == type); //FlightRestriction res = GetRestrictions().Find(r => r.From == from && r.To == to && r.Type == type); return restriction != null; }
//adds a flight restriction to the list of restrictions public static void AddRestriction(FlightRestriction restriction) { restrictions.Add(restriction); }
//adds a flight restriction to the list of restrictions public static void AddRestriction(FlightRestriction restriction) { restrictions.Add(restriction); }