Пример #1
0
        //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);
        }
Пример #2
0
        //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;
        }
Пример #3
0
 //adds a flight restriction to the list of restrictions
 public static void AddRestriction(FlightRestriction restriction)
 {
     restrictions.Add(restriction);
 }
Пример #4
0
 //adds a flight restriction to the list of restrictions
 public static void AddRestriction(FlightRestriction restriction)
 {
     restrictions.Add(restriction);
 }