Ejemplo n.º 1
0
    private AirMaterial EditGroupMarkupWhenComm(AirMaterial currentAirMaterial, GroupMarkup groupMarkup)
    {
        //����Ѿ��ӹ������ء�
        if (currentAirMaterial.Profile.GetParam(FLAG_REFERENCE_MARKUP_EDITED) != null && (bool)currentAirMaterial.Profile.GetParam(FLAG_REFERENCE_MARKUP_EDITED))
        {
            return currentAirMaterial;
        }

        //����Markup�Ѿ��ӹ�
        currentAirMaterial.Profile.SetParam(FLAG_REFERENCE_MARKUP_EDITED, true);

        decimal adultBasePrice = 0.0m; //���˲���˰����
        decimal childBasePrice = 0.0m; //С������˰����
        adultBasePrice = currentAirMaterial.Profile.GetParam("PUBLISHED_ADULT_FARE") == null ? adultBasePrice : Convert.ToDecimal(currentAirMaterial.Profile.GetParam("PUBLISHED_ADULT_FARE"));
        childBasePrice = currentAirMaterial.Profile.GetParam("PUBLISHED_CHILD_FARE") == null ? childBasePrice : Convert.ToDecimal(currentAirMaterial.Profile.GetParam("PUBLISHED_CHILD_FARE"));
        int commision = currentAirMaterial.Profile.GetParam("COMMISION") == null ? 0 : Convert.ToInt32(currentAirMaterial.Profile.GetParam("COMMISION"));

        if (Convert.ToBoolean(currentAirMaterial.Profile.GetParam("ISWEBFARE")))
        {
            //if (groupMarkup.AdultMarkup.MarkupType == ConfigurationConst.GroupMarkType.Money)
            //{
            //    currentAirMaterial.Profile.SetParam("PUBLISHED_ADULT_FARE", adultBasePrice + groupMarkup.AdultMarkup.Markup);
            //}

            //    //�ٷֱ�
            //else if (groupMarkup.AdultMarkup.MarkupType == ConfigurationConst.GroupMarkType.Percent)
            //{
            //    currentAirMaterial.Profile.SetParam("PUBLISHED_ADULT_FARE", adultBasePrice * (1 + groupMarkup.AdultMarkup.Markup));
            //}

            ////ChildMarkup
            ////�������
            //if (((int)decimal.Parse(currentAirMaterial.ChildBaseFare.ToString())) != 0)
            //{
            //    if (groupMarkup.ChildMarkup.MarkupType == ConfigurationConst.GroupMarkType.Money)
            //    {
            //        currentAirMaterial.Profile.SetParam("PUBLISHED_CHILD_FARE", childBasePrice + groupMarkup.ChildMarkup.Markup);
            //    }

            //        //�ٷֱ�
            //    else if (groupMarkup.ChildMarkup.MarkupType == ConfigurationConst.GroupMarkType.Percent)
            //    {
            //        currentAirMaterial.Profile.SetParam("PUBLISHED_CHILD_FARE", childBasePrice * (1 + groupMarkup.ChildMarkup.Markup));
            //    }
            //}

        }
        else
        {

            ////AdultMarkup
            ////�������
            //if (groupMarkup.AdultMarkup.MarkupType == ConfigurationConst.GroupMarkType.Money)
            //{

            //    currentAirMaterial.SetAdultMarkup(currentAirMaterial.AdultMarkup + groupMarkup.AdultMarkup.Markup);
            //}

            //    //�ٷֱ�
            //else if (groupMarkup.AdultMarkup.MarkupType == ConfigurationConst.GroupMarkType.Percent)
            //{
            //    currentAirMaterial.Profile.SetParam("COMMISION", commision + 100 * groupMarkup.AdultMarkup.Markup);
            //}

            ////ChildMarkup
            ////�������
            //if (((int)decimal.Parse(currentAirMaterial.ChildBaseFare.ToString())) != 0)
            //{
            //    if (groupMarkup.ChildMarkup.MarkupType == ConfigurationConst.GroupMarkType.Money)
            //    {
            //        currentAirMaterial.SetChildMarkup(currentAirMaterial.ChildMarkup + groupMarkup.ChildMarkup.Markup);
            //    }

            //        //�ٷֱ�
            //    else if (groupMarkup.ChildMarkup.MarkupType == ConfigurationConst.GroupMarkType.Percent)
            //    {
            //        currentAirMaterial.Profile.SetParam("COMMISION", commision + 100 * groupMarkup.AdultMarkup.Markup);
            //    }
            //}

            //AdultMarkup
            //�������
            TERMS.Common.Markup newMarkup = new TERMS.Common.Markup();
            if (groupMarkup.AdultMarkup.MarkupType == ConfigurationConst.GroupMarkType.Money)
            {
                newMarkup = new TERMS.Common.Markup(TERMS.Common.PassengerType.Adult, new TERMS.Common.FareAmount(groupMarkup.AdultMarkup.Markup));

            }

                //�ٷֱ�
            else if (groupMarkup.AdultMarkup.MarkupType == ConfigurationConst.GroupMarkType.Percent)
            {
                newMarkup = new TERMS.Common.Markup(TERMS.Common.PassengerType.Adult, new TERMS.Common.FareAmount(currentAirMaterial.AdultBaseFare * (groupMarkup.AdultMarkup.Markup)));

            }

            //ChildMarkup
            //�������
            if (((int)decimal.Parse(currentAirMaterial.ChildBaseFare.ToString())) != 0)
            {
                if (groupMarkup.ChildMarkup.MarkupType == ConfigurationConst.GroupMarkType.Money)
                {
                    newMarkup.SetAmount(TERMS.Common.PassengerType.Child, new TERMS.Common.FareAmount(groupMarkup.ChildMarkup.Markup));

                }

                    //�ٷֱ�
                else if (groupMarkup.ChildMarkup.MarkupType == ConfigurationConst.GroupMarkType.Percent)
                {
                    newMarkup.SetAmount(TERMS.Common.PassengerType.Child, new TERMS.Common.FareAmount(currentAirMaterial.ChildBaseFare * (groupMarkup.ChildMarkup.Markup)));

                }
            }
            currentAirMaterial.Price.AddMarkup(newMarkup);
        }

        return currentAirMaterial;
    }
Ejemplo n.º 2
0
    private void GetAirBookingCondition(ref IList<Passenger> passengers)
    {
        AirMaterial airMaterial = new AirMaterial(SelectedAirMerchandise.Profile);
        airMaterial.SetAdultBaseFare(SelectedAirMerchandise.AdultBaseFare);
        airMaterial.SetChildBaseFare(SelectedAirMerchandise.ChildBaseFare);

        //ADD PengZhaohui
        TERMS.Common.Markup markup = new TERMS.Common.Markup(TERMS.Common.PassengerType.Adult, new TERMS.Common.FareAmount(SelectedAirMerchandise.AdultMarkup));
        markup.SetAmount(TERMS.Common.PassengerType.Child, new TERMS.Common.FareAmount(SelectedAirMerchandise.ChildMarkup));

        airMaterial.Price.SetMarkup(markup);
        //airMaterial.Price.AddMarkup(new TERMS.Common.Markup(TERMS.Common.PassengerType.Child, new TERMS.Common.FareAmount(SelectedAirMerchandise.ChildMarkup)));
        //ADD END

        if (Request["rdDept"] != null)
        {
            //IList<Terms.Product.Domain.ComponentGroupItem> componentGroupItems = ((AirComponentGroup)((ComponentGroup)CurrentSession.SecondSearchResults[Index.ToString()]).Items[0].Component).Items;
            //airBooking.AdultNumber =((AirProfile) Group.Profile).AdultNumber;
            //airBooking.ChildNumber = ((AirProfile)Group.Profile).ChildNumber;

            //airBooking.IsMexico = CurrentSession.SearchCondition.IsMexico;
            //airBooking.FareType = ((AirProfile)Group.Profile).FareType.ToUpper().Equals("COMM") ? FlightFareType.COMM : FlightFareType.NET;
            //airBooking.AdultAirFare.SetConsolidatorBase(0, Group.AdultBaseFare, airBooking.FareType);
            //airBooking.AdultAirFare.SetConsolidatorMarkup(Group.AdultMarkup, airBooking.FareType == FlightFareType.COMM);
            //airBooking.ChildAirFare.SetConsolidatorBase(0, Group.ChildBaseFare, airBooking.FareType);
            //airBooking.ChildAirFare.SetConsolidatorMarkup(Group.ChildMarkup, airBooking.FareType == FlightFareType.COMM);
            //componentGroup.SetAdultConsolidatorBase(0, componentGroup.AdultBaseFare);
            //componentGroup.SetChildConsolidatorBase(0, componentGroup.ChildBaseFare);
            //componentGroup.SetConsolidatorAdultMarkup(componentGroup.AdultMarkup, componentGroup.FareType == FlightFareType.COMM);
            //componentGroup.SetConsolidatorChildMarkup(componentGroup.ChildMarkup, componentGroup.FareType == FlightFareType.COMM);
            //AirTrip airTrip = ((Terms.Product.Domain.AirMaterial)componentGroupItems[Convert.ToInt32(Request["rdDept"].ToString())].Component).AirTrip;
            //airBooking.Trips.Add(airTrip);

            //AirComponentGroup gourp = new AirComponentGroup((AirProfile)((ComponentGroup)CurrentSession.SecondSearchResults[Index.ToString()]).Profile);
            //gourp.Items.Add(componentGroupItems[Convert.ToInt32(Request["rdDept"].ToString())]);

            AirMaterial depAirMaterial =(AirMaterial) ((AirMerchandise)SelectedAirMerchandise.Items[0]).Items[Convert.ToInt32(Request["rdDept"].ToString())];

            airMaterial.AirTrip.SubTrips.Add(depAirMaterial.AirTrip.SubTrips[0]);

        }

        if (Request["rdRtn"] != null && !((AirSearchCondition)this.Transaction.CurrentSearchConditions).FlightType.ToUpper().Equals("ONEWAY"))
        {

            //IList<Terms.Product.Domain.ComponentGroupItem> componentGroupItems = ((AirComponentGroup)((ComponentGroup)CurrentSession.SecondSearchResults[Index.ToString()]).Items[1].Component).Items;
            //AirTrip airTrip = ((Terms.Product.Domain.AirMaterial)componentGroupItems[Convert.ToInt32(Request["rdRtn"].ToString())].Component).AirTrip;
            //airBooking.Trips.Add(airTrip);

            //AirComponentGroup gourp = new AirComponentGroup((AirProfile)((ComponentGroup)CurrentSession.SecondSearchResults[Index.ToString()]).Profile);
            //gourp.Items.Add(componentGroupItems[Convert.ToInt32(Request["rdRtn"].ToString())]);
            //componentGroup.Items.Add(new ComponentGroupItem(gourp));

            AirMaterial depAirMaterial = (AirMaterial)((AirMerchandise)SelectedAirMerchandise.Items[1]).Items[Convert.ToInt32(Request["rdRtn"].ToString())];

            airMaterial.AirTrip.SubTrips.Add(depAirMaterial.AirTrip.SubTrips[0]);
        }
        //ComponentGroupItem componentGroupItem = new ComponentGroupItem(componentGroup);

        //ComponentGroup newComponentGroup = new ComponentGroup(((ComponentGroup)PackageMerchandise.ComponentGroup.Items[0].Component).Profile);
        //newComponentGroup.Items.Add(componentGroupItem);
        //SaleMerchandise saleMerchandise = new SaleMerchandise();
        //saleMerchandise.ComponentGroup = newComponentGroup;
        //this.Transaction.CurrentTransactionObject.Items.Clear();
        //this.Transaction.CurrentTransactionObject.AddItem(saleMerchandise);
        AirOrderItem airOrderItem = new AirOrderItem(airMaterial);

        this.Transaction.CurrentTransactionObject.Items.Clear();
        this.Transaction.CurrentTransactionObject.AddItem(airOrderItem);

        for (int i = 0; i < Convert.ToInt32(airMaterial.Profile.GetParam("ADULT_NUMBER")); i++)
        {
            Passenger passenger = new Passenger(ProductConst.PASSFIRSTNAME, ProductConst.ADTPASSLASTNAME,ProductConst.PASSMIDDLENAME, TERMS.Common.PassengerType.Adult);
            passengers.Add(passenger);
        }
        for (int i = 0; i < Convert.ToInt32(airMaterial.Profile.GetParam("CHILD_NUMBER")); i++)
        {
            Passenger passenger = new Passenger(ProductConst.PASSFIRSTNAME, ProductConst.CHDPASSLASTNAME, ProductConst.PASSMIDDLENAME, TERMS.Common.PassengerType.Child);
            passengers.Add(passenger);
        }
    }
Ejemplo n.º 3
0
    private AirMaterial EditGroupMarkup(AirMaterial currentAirMaterial, GroupMarkup groupMarkup)
    {
        //����Ѿ��ӹ������ء�
        if (currentAirMaterial.Profile.GetParam(FLAG_REFERENCE_MARKUP_EDITED) != null && (bool)currentAirMaterial.Profile.GetParam(FLAG_REFERENCE_MARKUP_EDITED))
        {
            return currentAirMaterial;
        }

        //����Markup�Ѿ��ӹ�
        currentAirMaterial.Profile.SetParam(FLAG_REFERENCE_MARKUP_EDITED,true);

        TERMS.Common.Markup newMarkup = new TERMS.Common.Markup();
        //AdultMarkup
        //�������
        if (groupMarkup.AdultMarkup.MarkupType == ConfigurationConst.GroupMarkType.Money)
        {
            newMarkup = new TERMS.Common.Markup(TERMS.Common.PassengerType.Adult, new TERMS.Common.FareAmount(groupMarkup.AdultMarkup.Markup));

        }

            //�ٷֱ�
        else if (groupMarkup.AdultMarkup.MarkupType == ConfigurationConst.GroupMarkType.Percent)
        {
            newMarkup = new TERMS.Common.Markup(TERMS.Common.PassengerType.Adult, new TERMS.Common.FareAmount(currentAirMaterial.AdultBaseFare * (groupMarkup.AdultMarkup.Markup)));

        }

        //ChildMarkup
        //�������
        if (((int)decimal.Parse(currentAirMaterial.ChildBaseFare.ToString())) != 0)
        {
            if (groupMarkup.ChildMarkup.MarkupType == ConfigurationConst.GroupMarkType.Money)
            {
                newMarkup.SetAmount(TERMS.Common.PassengerType.Child,new TERMS.Common.FareAmount(groupMarkup.ChildMarkup.Markup));

            }

                //�ٷֱ�
            else if (groupMarkup.ChildMarkup.MarkupType == ConfigurationConst.GroupMarkType.Percent)
            {
                newMarkup.SetAmount(TERMS.Common.PassengerType.Child, new TERMS.Common.FareAmount(currentAirMaterial.ChildBaseFare * (groupMarkup.ChildMarkup.Markup)));

            }
        }
        currentAirMaterial.Price.AddMarkup(newMarkup);
        return currentAirMaterial;
    }
Ejemplo n.º 4
0
    /// <summary>
    /// Init Result
    /// </summary>
    private void InitialResult()
    {
        CurrentSession.CurrentItinerary.FareInfo.SetAmount(TERMS.Common.PassengerType.Adult, new TERMS.Common.FareAmount(SelectedAirMerchandise.AdultBaseFare, new TERMS.Common.Currency(), new TERMS.Common.Currency()));
        CurrentSession.CurrentItinerary.FareInfo.SetAmount(TERMS.Common.PassengerType.Child, new TERMS.Common.FareAmount(SelectedAirMerchandise.ChildBaseFare, new TERMS.Common.Currency(), new TERMS.Common.Currency()));

        TERMS.Common.Markup markup = new TERMS.Common.Markup(TERMS.Common.PassengerType.Adult, new TERMS.Common.FareAmount(SelectedAirMerchandise.AdultMarkup));
        markup.SetAmount(TERMS.Common.PassengerType.Child, new TERMS.Common.FareAmount(SelectedAirMerchandise.ChildMarkup));
        CurrentSession.CurrentItinerary.FareInfo.SetMarkup(markup);
        //CurrentSession.CurrentItinerary.FareInfo.AddMarkup(new TERMS.Common.Markup(TERMS.Common.PassengerType.Child, new TERMS.Common.FareAmount(SelectedAirMerchandise.ChildMarkup, new TERMS.Common.Currency(), new TERMS.Common.Currency())));

        ItineraryInfo.Itinerary = CurrentSession.CurrentItinerary;
    }