Exemplo n.º 1
0
        /// <summary>
        /// Полное копирование текущего объекта
        /// </summary>
        /// <returns>Полная копия объекта</returns>
        public CompleteSegment FullCopy()
        {
            var result = new CompleteSegment();

            result.AircraftType     = AircraftType;
            result.ArrDateTime      = ArrDateTime;
            result.Connection       = Connection;
            result.DepDateTime      = DepDateTime;
            result.ETicket          = ETicket;
            result.FlightNumber     = FlightNumber;
            result.FlightTime       = FlightTime;
            result.ID               = ID;
            result.MarkAirline      = MarkAirline;
            result.OpAirline        = OpAirline;
            result.RequestedSegment = RequestedSegment;
            result.StopNum          = StopNum;

            if (ArrAirp != null)
            {
                result.ArrAirp             = new AirportInformation();
                result.ArrAirp.AirportCode = ArrAirp.AirportCode;
                result.ArrAirp.CityCode    = ArrAirp.CityCode;
                result.ArrAirp.Terminal    = ArrAirp.Terminal;
                result.ArrAirp.UTC         = ArrAirp.UTC;
            }

            if (BookingClassInfo != null)
            {
                result.BookingClassInfo                  = new BookingClass();
                result.BookingClassInfo.BaseClass        = BookingClassInfo.BaseClass;
                result.BookingClassInfo.BookingClassCode = BookingClassInfo.BookingClassCode;
                result.BookingClassInfo.FreeSeatCount    = BookingClassInfo.FreeSeatCount;
                result.BookingClassInfo.MealType         = BookingClassInfo.MealType;

                if (BookingClassInfo.Baggage != null)
                {
                    result.BookingClassInfo.Baggage         = new Baggage();
                    result.BookingClassInfo.Baggage.Measure = BookingClassInfo.Baggage.Measure;
                    result.BookingClassInfo.Baggage.Value   = BookingClassInfo.Baggage.Value;
                }
            }

            if (DepAirp != null)
            {
                result.DepAirp             = new AirportInformation();
                result.DepAirp.AirportCode = DepAirp.AirportCode;
                result.DepAirp.CityCode    = DepAirp.CityCode;
                result.DepAirp.Terminal    = DepAirp.Terminal;
                result.DepAirp.UTC         = DepAirp.UTC;
            }

            if (SupplierInfo != null)
            {
                result.SupplierInfo             = new SupplierSegmentInfo();
                result.SupplierInfo.Status      = SupplierInfo.Status;
                result.SupplierInfo.SupplierRef = SupplierInfo.SupplierRef;
            }

            return(result);
        }
		/// <summary>
		/// Конструтор с инициализацией свойств объекта
		/// </summary>
		/// <param name="segment">Исходные данные для заполнения объекта</param>
		public BookingClassInformation(CompleteSegment segment)
		{
			Baggage = segment.BookingClassInfo.Baggage;
			BaseClass = segment.BookingClassInfo.BaseClass;
			BookingClassCode = segment.BookingClassInfo.BookingClassCode;
			FreeSeatCount = segment.BookingClassInfo.FreeSeatCount;
			MealType = segment.BookingClassInfo.MealType;
			AdditionalServices = segment.BookingClassInfo.AdditionalServices;


			SegmentNumber = segment.ID;
			Connection = segment.Connection;
		}
Exemplo n.º 3
0
		/// <summary>
		/// Полное копирование текущего объекта
		/// </summary>
		/// <returns>Полная копия объекта</returns>
		public CompleteSegment FullCopy()
		{
			var result = new CompleteSegment();

			result.AircraftType = AircraftType;
			result.ArrDateTime = ArrDateTime;
			result.Connection = Connection;
			result.DepDateTime = DepDateTime;
			result.ETicket = ETicket;
			result.FlightNumber = FlightNumber;
			result.FlightTime = FlightTime;
			result.ID = ID;
			result.MarkAirline = MarkAirline;
			result.OpAirline = OpAirline;
			result.RequestedSegment = RequestedSegment;
			result.StopNum = StopNum;

			if (ArrAirp != null)
			{
				result.ArrAirp = new AirportInformation();
				result.ArrAirp.AirportCode = ArrAirp.AirportCode;
				result.ArrAirp.CityCode = ArrAirp.CityCode;
				result.ArrAirp.Terminal = ArrAirp.Terminal;
				result.ArrAirp.UTC = ArrAirp.UTC;
			}

			if (BookingClassInfo != null)
			{
				result.BookingClassInfo = new BookingClass();
				result.BookingClassInfo.BaseClass = BookingClassInfo.BaseClass;
				result.BookingClassInfo.BookingClassCode = BookingClassInfo.BookingClassCode;
				result.BookingClassInfo.FreeSeatCount = BookingClassInfo.FreeSeatCount;
				result.BookingClassInfo.MealType = BookingClassInfo.MealType;

				if (BookingClassInfo.Baggage != null)
				{
					result.BookingClassInfo.Baggage = new Baggage();
					result.BookingClassInfo.Baggage.Measure = BookingClassInfo.Baggage.Measure;
					result.BookingClassInfo.Baggage.Value = BookingClassInfo.Baggage.Value;
				}

				if (BookingClassInfo.AdditionalServices != null)
				{
					result.BookingClassInfo.AdditionalServices = new List<AdditionalService>();
					foreach (var addService in BookingClassInfo.AdditionalServices)
					{
						var tmp = new AdditionalService();

						tmp.AircompanyCode = addService.AircompanyCode;
						tmp.Price = new Money(addService.Price);
						tmp.Code = addService.Code;
						tmp.Name = addService.Name;

						result.BookingClassInfo.AdditionalServices.Add(tmp);
					}
				}
			}

			if (DepAirp != null)
			{
				result.DepAirp = new AirportInformation();
				result.DepAirp.AirportCode = DepAirp.AirportCode;
				result.DepAirp.CityCode = DepAirp.CityCode;
				result.DepAirp.Terminal = DepAirp.Terminal;
				result.DepAirp.UTC = DepAirp.UTC;
			}

			if (SupplierInfo != null)
			{
				result.SupplierInfo = new SupplierSegmentInfo();
				result.SupplierInfo.Status = SupplierInfo.Status;
				result.SupplierInfo.SupplierRef = SupplierInfo.SupplierRef;
			}

			return result;
		}