public virtual void RemoveFlightRoutes(FlightRoute __item)
 {
     if (__item != null && flightRoutes != null && flightRoutes.Contains(__item))
     {
         flightRoutes.Remove(__item);
     }
 }
 public virtual void AddFlightRoutes(FlightRoute __item)
 {
     if (__item != null && flightRoutes != null && !flightRoutes.Contains(__item))
     {
         flightRoutes.Add(__item);
     }
 }
Example #3
0
 public virtual void RemoveMarketingRoutes(FlightRoute __item)
 {
     if (__item != null && marketingRoutes != null && marketingRoutes.Contains(__item))
     {
         marketingRoutes.Remove(__item);
         __item.MarketingAirline = null;
     }
 }
Example #4
0
 public virtual void RemoveOperatingRoutes(FlightRoute __item)
 {
     if (__item != null && operatingRoutes != null && operatingRoutes.Contains(__item))
     {
         operatingRoutes.Remove(__item);
         __item.OperatingAirline = null;
     }
 }
Example #5
0
 public virtual void AddMarketingRoutes(FlightRoute __item)
 {
     if (__item != null && marketingRoutes != null && !marketingRoutes.Contains(__item))
     {
         marketingRoutes.Add(__item);
         if (__item.MarketingAirline != this)
         {
             __item.MarketingAirline = this;
         }
     }
 }
Example #6
0
 public virtual void AddOperatingRoutes(FlightRoute __item)
 {
     if (__item != null && operatingRoutes != null && !operatingRoutes.Contains(__item))
     {
         operatingRoutes.Add(__item);
         if (__item.OperatingAirline != this)
         {
             __item.OperatingAirline = this;
         }
     }
 }
 public virtual void SetFlightRoutesAt(FlightRoute __item, int __index)
 {
     if (__item == null)
     {
         flightRoutes[__index] = null;
     }
     else
     {
         flightRoutes[__index] = __item;
     }
 }
Example #8
0
 public virtual void SetMarketingRoutesAt(FlightRoute __item, int __index)
 {
     if (__item == null)
     {
         marketingRoutes[__index].MarketingAirline = null;
     }
     else
     {
         marketingRoutes[__index] = __item;
         if (__item.MarketingAirline != this)
         {
             __item.MarketingAirline = this;
         }
     }
 }
Example #9
0
 public virtual void SetOperatingRoutesAt(FlightRoute __item, int __index)
 {
     if (__item == null)
     {
         operatingRoutes[__index].OperatingAirline = null;
     }
     else
     {
         operatingRoutes[__index] = __item;
         if (__item.OperatingAirline != this)
         {
             __item.OperatingAirline = this;
         }
     }
 }
Example #10
0
/// <summary>
/// Copies the current object to a new instance
/// </summary>
/// <param name="deep">Copy members that refer to objects external to this class (not dependent)</param>
/// <param name="copiedObjects">Objects that should be reused</param>
/// <param name="asNew">Copy the current object as a new one, ready to be persisted, along all its members.</param>
/// <param name="reuseNestedObjects">If asNew is true, this flag if set, forces the reuse of all external objects.</param>
/// <param name="copy">Optional - An existing [FlightRoute] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual FlightRoute Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, FlightRoute copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((FlightRoute)copiedObjects[this]);
            }
            copy = copy ?? new FlightRoute();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
            }
            copy.FlightNumber          = this.FlightNumber;
            copy.OperatingFlightNumber = this.OperatingFlightNumber;
            copy.StopCount             = this.StopCount;
            copy.DisplayOption         = this.DisplayOption;
            copy.FlightDuration        = this.FlightDuration;
            copy.SecureSell            = this.SecureSell;
            copy.InsideAvailability    = this.InsideAvailability;
            copy.Group        = this.Group;
            copy.ProviderCode = this.ProviderCode;
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            copy.classesOfService = new List <ClassOfService>();
            if (deep && this.classesOfService != null)
            {
                foreach (var __item in this.classesOfService)
                {
                    if (!copiedObjects.Contains(__item))
                    {
                        if (asNew && reuseNestedObjects)
                        {
                            copy.AddClassesOfService(__item);
                        }
                        else
                        {
                            copy.AddClassesOfService(__item.Copy(deep, copiedObjects, asNew));
                        }
                    }
                    else
                    {
                        copy.AddClassesOfService((ClassOfService)copiedObjects[__item]);
                    }
                }
            }
            if (deep && this.originTerminal != null)
            {
                if (!copiedObjects.Contains(this.originTerminal))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.OriginTerminal = this.OriginTerminal;
                    }
                    else if (asNew)
                    {
                        copy.OriginTerminal = this.OriginTerminal.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.originTerminal = this.originTerminal.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.OriginTerminal = (Terminal)copiedObjects[this.OriginTerminal];
                    }
                    else
                    {
                        copy.originTerminal = (Terminal)copiedObjects[this.OriginTerminal];
                    }
                }
            }
            if (deep && this.destinationTerminal != null)
            {
                if (!copiedObjects.Contains(this.destinationTerminal))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.DestinationTerminal = this.DestinationTerminal;
                    }
                    else if (asNew)
                    {
                        copy.DestinationTerminal = this.DestinationTerminal.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.destinationTerminal = this.destinationTerminal.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.DestinationTerminal = (Terminal)copiedObjects[this.DestinationTerminal];
                    }
                    else
                    {
                        copy.destinationTerminal = (Terminal)copiedObjects[this.DestinationTerminal];
                    }
                }
            }
            if (deep && this.origin != null)
            {
                if (!copiedObjects.Contains(this.origin))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Origin = this.Origin;
                    }
                    else if (asNew)
                    {
                        copy.Origin = this.Origin.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.origin = this.origin.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Origin = (Airport)copiedObjects[this.Origin];
                    }
                    else
                    {
                        copy.origin = (Airport)copiedObjects[this.Origin];
                    }
                }
            }
            if (deep && this.destination != null)
            {
                if (!copiedObjects.Contains(this.destination))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Destination = this.Destination;
                    }
                    else if (asNew)
                    {
                        copy.Destination = this.Destination.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.destination = this.destination.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Destination = (Airport)copiedObjects[this.Destination];
                    }
                    else
                    {
                        copy.destination = (Airport)copiedObjects[this.Destination];
                    }
                }
            }
            if (deep && this.operatingAirline != null)
            {
                if (!copiedObjects.Contains(this.operatingAirline))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.OperatingAirline = this.OperatingAirline;
                    }
                    else if (asNew)
                    {
                        copy.OperatingAirline = this.OperatingAirline.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.operatingAirline = this.operatingAirline.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.OperatingAirline = (Airline)copiedObjects[this.OperatingAirline];
                    }
                    else
                    {
                        copy.operatingAirline = (Airline)copiedObjects[this.OperatingAirline];
                    }
                }
            }
            if (deep && this.marketingAirline != null)
            {
                if (!copiedObjects.Contains(this.marketingAirline))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.MarketingAirline = this.MarketingAirline;
                    }
                    else if (asNew)
                    {
                        copy.MarketingAirline = this.MarketingAirline.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.marketingAirline = this.marketingAirline.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.MarketingAirline = (Airline)copiedObjects[this.MarketingAirline];
                    }
                    else
                    {
                        copy.marketingAirline = (Airline)copiedObjects[this.MarketingAirline];
                    }
                }
            }
            copy.outgoingConnections = new List <Connection>();
            if (deep && this.outgoingConnections != null)
            {
                foreach (var __item in this.outgoingConnections)
                {
                    if (!copiedObjects.Contains(__item))
                    {
                        if (asNew && reuseNestedObjects)
                        {
                            copy.AddOutgoingConnections(__item);
                        }
                        else
                        {
                            copy.AddOutgoingConnections(__item.Copy(deep, copiedObjects, asNew));
                        }
                    }
                    else
                    {
                        copy.AddOutgoingConnections((Connection)copiedObjects[__item]);
                    }
                }
            }
            copy.incomingConnections = new List <Connection>();
            if (deep && this.incomingConnections != null)
            {
                foreach (var __item in this.incomingConnections)
                {
                    if (!copiedObjects.Contains(__item))
                    {
                        if (asNew && reuseNestedObjects)
                        {
                            copy.AddIncomingConnections(__item);
                        }
                        else
                        {
                            copy.AddIncomingConnections(__item.Copy(deep, copiedObjects, asNew));
                        }
                    }
                    else
                    {
                        copy.AddIncomingConnections((Connection)copiedObjects[__item]);
                    }
                }
            }
            copy.inFlightServices = new List <InFlightService>();
            if (deep && this.inFlightServices != null)
            {
                foreach (var __item in this.inFlightServices)
                {
                    if (!copiedObjects.Contains(__item))
                    {
                        if (asNew && reuseNestedObjects)
                        {
                            copy.AddInFlightServices(__item);
                        }
                        else
                        {
                            copy.AddInFlightServices(__item.Copy(deep, copiedObjects, asNew));
                        }
                    }
                    else
                    {
                        copy.AddInFlightServices((InFlightService)copiedObjects[__item]);
                    }
                }
            }
            if (deep && this.aircraft != null)
            {
                if (!copiedObjects.Contains(this.aircraft))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Aircraft = this.Aircraft;
                    }
                    else if (asNew)
                    {
                        copy.Aircraft = this.Aircraft.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.aircraft = this.aircraft.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Aircraft = (Aircraft)copiedObjects[this.Aircraft];
                    }
                    else
                    {
                        copy.aircraft = (Aircraft)copiedObjects[this.Aircraft];
                    }
                }
            }
            base.Copy(deep, copiedObjects, asNew, reuseNestedObjects, copy);
            return(copy);
        }