Example #1
0
        public PricingData Clone()
        {
            var result = new PricingData();

            result.PricingRule      = PricingRule;
            result.Code             = Code;
            result.TicketDesignator = TicketDesignator;
            result.Endorsment       = Endorsment;
            result.TourCode         = TourCode;
            result.Discount         = Discount;
            result.AuthCode         = AuthCode;
            result.AgencyCommission = AgencyCommission != null ? new Money(AgencyCommission) : null;
            result.Bonus            = Bonus != null ? new Money(Bonus) : null;
            if (AirlineCommission != null)
            {
                result.AirlineCommission = new CommissionDataItem
                {
                    Amount   = AirlineCommission.Amount,
                    Currency = AirlineCommission.Currency,
                    Percent  = AirlineCommission.Percent
                };
            }
            if (AgencyProfit != null)
            {
                result.AgencyProfit = new CommissionDataItem
                {
                    Amount   = AgencyProfit.Amount,
                    Currency = AgencyProfit.Currency,
                    Percent  = AgencyProfit.Percent
                };
            }

            return(result);
        }
        public PricingData Copy()
        {
            var result = new PricingData();

            result.PricingRule = PricingRule;
            result.Code        = Code;

            if (AirlineCommission != null)
            {
                result.AirlineCommission = AirlineCommission.Copy();
            }

            if (AgencyProfit != null)
            {
                result.AgencyProfit = AgencyProfit.Copy();
            }

            result.TicketDesignator = TicketDesignator;
            result.Endorsment       = Endorsment;
            result.TourCode         = TourCode;
            result.Discount         = Discount;

            if (AgencyCommission != null)
            {
                result.AgencyCommission = AgencyCommission.Copy();
            }

            if (Bonus != null)
            {
                result.Bonus = Bonus.Copy();
            }

            result.AuthCode              = AuthCode;
            result.AcquiringMode         = AcquiringMode;
            result.AutoticketingDisabled = AutoticketingDisabled;

            return(result);
        }
        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);
        }