Exemplo n.º 1
0
        public PriceBreakdown DeepCopy()
        {
            PriceBreakdown result = new PriceBreakdown();

            result.Brand = Brand;
            result.IncludedInMainServicePrice = IncludedInMainServicePrice;
            result.PrivateFareInd             = PrivateFareInd;
            result.Refundable        = Refundable;
            result.ValidatingCompany = ValidatingCompany;
            result.PricingData       = PricingData?.Copy();
            result.PricingDebug      = PricingDebug?.DeepCopy();

            if (TotalPrice != null)
            {
                result.TotalPrice = new Money(TotalPrice);
            }

            if (AgencyMarkup != null)
            {
                result.AgencyMarkup = new Money(AgencyMarkup);
            }

            if (RoundingChargePart != null)
            {
                result.RoundingChargePart = new Money(RoundingChargePart);
            }
            ;
            if (DiscountByPromoAction != null)
            {
                result.DiscountByPromoAction = new Money(DiscountByPromoAction);
            }

            if (SubAgentMarkup != null)
            {
                result.SubAgentMarkup = new Money(SubAgentMarkup);
            }

            if (!ChargeBreakdown.IsNullOrEmpty())
            {
                result.ChargeBreakdown = new ChargePartList(ChargeBreakdown.Select(c => c.Copy()));
            }

            if (!SubAgentChargeBreakdown.IsNullOrEmpty())
            {
                result.SubAgentChargeBreakdown = new ChargePartList(SubAgentChargeBreakdown.Select(s => s.Copy()));
            }

            if (!ServiceRef.IsNullOrEmpty())
            {
                result.ServiceRef = new RefList <int>(ServiceRef);
            }

            if (!SegmentRef.IsNullOrEmpty())
            {
                result.SegmentRef = new RefList <int>(SegmentRef);
            }

            if (!PassengerTypePriceBreakdown.IsNullOrEmpty())
            {
                result.PassengerTypePriceBreakdown = new PassengerTypePriceBreakdownList(PassengerTypePriceBreakdown.Select(p => p.Copy()));
            }

            return(result);
        }