private object GetAirLegList(AirOrderItem airOrderItem)
        {
            IList<AirLeg> airLegList = new List<AirLeg>();

            foreach (SubAirTrip subAirTrip in airOrderItem.Merchandise.AirTrip.SubTrips)
            {
                foreach (AirLeg airLeg in subAirTrip.Flights)
                {
                    airLegList.Add(airLeg);
                }
            }

            return airLegList;
        }
    private void GetAirBookingCondition(ref IList<TERMS.Business.Centers.SalesCenter.Passenger> passengers, AirMaterial airMaterial)
    {
        //AirMaterial newAirMaterial = new AirMaterial(airMaterial.Profile);
        //newAirMaterial.SetAdultBaseFare(airMaterial.AdultBaseFare);
        //newAirMaterial.SetChildBaseFare(airMaterial.ChildBaseFare);

        //TERMS.Common.Markup newMarkup = new TERMS.Common.Markup();

        //newMarkup = new TERMS.Common.Markup(TERMS.Common.PassengerType.Adult, new TERMS.Common.FareAmount(airMaterial.AdultMarkup));
        //newMarkup.SetAmount(TERMS.Common.PassengerType.Child, new TERMS.Common.FareAmount(airMaterial.ChildMarkup));
        //newAirMaterial.Price.AddMarkup(newMarkup);

        //ADD PengZhaohui
        //newAirMaterial.SetAdultMarkup(airMaterial.AdultMarkup);
        //newAirMaterial.SetChildMarkup(airMaterial.ChildMarkup);
        //ADD END

        //int tourIndex = Convert.ToInt32(Request["selectedTour"].ToString());

        //AirMaterial airMaterial = (AirMaterial)airMaterial.Items[tourIndex];
        //newAirMaterial.AirTrip = airMaterial.AirTrip;

        AirOrderItem airOrderItem = new AirOrderItem(airMaterial);

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

        SetPreBookingPassengers(airMaterial, ref passengers);
        //for (int i = 0; i < Convert.ToInt32(newAirMaterial.Profile.GetParam("ADULT_NUMBER")); i++)
        //{
        //    TERMS.Business.Centers.SalesCenter.Passenger passenger = new TERMS.Business.Centers.SalesCenter.Passenger(ProductConst.PASSFIRSTNAME, ProductConst.ADTPASSLASTNAME, ProductConst.PASSMIDDLENAME, TERMS.Common.PassengerType.Adult);
        //    passengers.Add(passenger);
        //}
        //for (int i = 0; i < Convert.ToInt32(newAirMaterial.Profile.GetParam("CHILD_NUMBER")); i++)
        //{
        //    TERMS.Business.Centers.SalesCenter.Passenger passenger = new TERMS.Business.Centers.SalesCenter.Passenger(ProductConst.PASSFIRSTNAME, ProductConst.CHDPASSLASTNAME, ProductConst.PASSMIDDLENAME, TERMS.Common.PassengerType.Child);
        //    passengers.Add(passenger);
        //}
    }
示例#3
0
    private void SearchToBinder()
    {
        if (packageMerchandise != null && packageMerchandise.Items.Count > 0)
        {
            //int index = m_SaleMerchandise.DefaultMerchandise.Length - 1;

            PackageOrderItem packageOrderItem = new PackageOrderItem(new PackageProfile("PackageProfile"));

            int hotelIndex = Convert.ToInt32(((List<int>)packageMerchandise.DefaultIndex[1 + packageMerchandise.CurrentHotelListNumber])[0]);
            List<PackageMaterial> MVHotelList = packageMerchandise.GetPackageMaterials(1 + packageMerchandise.CurrentHotelListNumber);
            packageOrderItem.RoomPrice = ((PackageMaterial)MVHotelList[hotelIndex]).RoomPrice;
            packageOrderItem.Nights = ((PackageMaterial)MVHotelList[hotelIndex]).Nights;
            packageOrderItem.RoomPricePerNight = ((PackageMaterial)MVHotelList[hotelIndex]).RoomPricePerNight;
            packageOrderItem.AirPrice = ((PackageMaterial)MVHotelList[hotelIndex]).AirPrice;
            packageOrderItem.TotalPrice = ((PackageMaterial)MVHotelList[hotelIndex]).TotalPrice;

            AirOrderItem airOrderItem = new AirOrderItem((AirMaterial)packageMerchandise.DefaultMerchandise[0]);

            packageOrderItem.Add(airOrderItem);

            for (int i = 1; i < packageMerchandise.Items.Count; i++)
            {
                for (int k = 0; k < ((List<Hotel>)packageMerchandise.DefaultMerchandise[i]).Count; k++)
                {
                    MVHotel mvHotel = (MVHotel)((List<Hotel>)packageMerchandise.DefaultMerchandise[i])[k];

                    for (int roomIndex = 0; roomIndex < mvHotel.Items.Count; roomIndex++)
                    {
                        MVRoom mvRoom = (MVRoom)mvHotel.Items[roomIndex];

                        //mvRoom.DefaultRoomType.Room.Hotel.SetAddress(new TERMS.Common.Address(mvRoom.DefaultRoomType.Room.Hotel.City, mvRoom.DefaultRoomType.Room.Hotel.Address, mvHotel.GetAddress().ZipCode));

                        HotelOrderItem hotelOrderItem = new HotelOrderItem(mvRoom.DefaultRoomType, mvRoom.Profile);

                        packageOrderItem.Add(hotelOrderItem);
                    }
                }
                if (Utility.Transaction.CurrentTransactionObject != null)
                    Utility.Transaction.CurrentTransactionObject.Items.Clear();
                Utility.Transaction.CurrentTransactionObject.Items.Add(packageOrderItem);
            }
        }

        //this.DefaultFlightDetails1.FlightDetails = AirMaterialList;
        //this.FlightHeader1.ReBind();
        //this.PKGPackageDetailsControl1.pgMerchandise = packageMerchandise;

        //this.PKGPackageDetailsControl1.BindHotels();

        ////���Hotel��checkin checkout �IJ����5�� edit by tll
        //SetChooseDisable();
    }
    private void DoAvailableProcess(int flightdetailIndex, AirMaterial tGoup)
    {
        OperaterAdvice.DoAdvice(Terms.Configuration.Utility.ConfigurationConst.OperateType.ClickAvalibale, this);

        CurrentSession.OriginalIndex = flightdetailIndex;
        FlightMerchandiseManager flightMerchandiseManager = new FlightMerchandiseManager();
        AirMaterial airMaterial = tGoup;
        decimal originalPrice = GetTotalPrice(airMaterial);
        decimal newPrice = 0;

        bool bclError = false;

        //if (tGoup.Profile.GetParam("FARE_TYPE").Equals(FlightFareType.SR.ToString()) || tGoup.Profile.GetParam("FARE_TYPE").Equals("COMMNEW") || tGoup.Profile.GetParam("FARE_TYPE").Equals(FlightFareType.PUB.ToString()))
        //{
        //    //AirMaterial airMaterial = tGoup;

        //    AirOrderItem airOrderItem = new AirOrderItem(airMaterial);

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

        //    IList<TERMS.Business.Centers.SalesCenter.Passenger> passengers = new List<TERMS.Business.Centers.SalesCenter.Passenger>();
        //    SetPreBookingPassengers(airMaterial, ref passengers);

        //    try
        //    {
        //        AirService.PreBookAirline2(ref airMaterial, passengers);
        //    }
        //    catch (Exception ex)
        //    {
        //        DoErrorProcess(ex);
        //        log.Error(ex.Message, ex);
        //        bclError = true;
        //    }

        //    if (bclError)
        //        this.Err("", "Booking failed", "NewStep2.aspx");

        //    FlightMerchandiseManager flightMerchandiseManager = new FlightMerchandiseManager();

        //    airMaterial = flightMerchandiseManager.EditMaterialGroupMarkup(airMaterial);

        //}
        //else
        //{
        //    IList<TERMS.Business.Centers.SalesCenter.Passenger> passengers = new List<TERMS.Business.Centers.SalesCenter.Passenger>();
        //    try
        //    {

        //        GetAirBookingCondition(ref passengers, tGoup);
        //    }
        //    catch (Exception E)
        //    {
        //        log.Error(E.Message, E);
        //    }
        //    //AirMaterial airMaterial = tGoup;

        //    bool bclError = false;

        //    try
        //    {
        //        string[] requestXML = new string[3];
        //        //ws.PreBookAirline(ref group, SearchArray, requestXML);
        //        AirService.PreBookAirline2(ref airMaterial, passengers);

        //        FlightMerchandiseManager flightMerchandiseManager = new FlightMerchandiseManager();

        //        airMaterial = flightMerchandiseManager.EditMaterialGroupMarkup(airMaterial);
        //    }
        //    catch (Exception ex)
        //    {
        //        DoErrorProcess(ex);
        //        log.Error(ex.Message, ex);
        //        bclError = true;
        //    }

        //    if (bclError)
        //        this.Err("", "Booking failed", "NewStep2.aspx");

        //}

        try
        {
            IList<TERMS.Business.Centers.SalesCenter.Passenger> passengers = new List<TERMS.Business.Centers.SalesCenter.Passenger>();

            if (tGoup.Profile.GetParam("FARE_TYPE").Equals(FlightFareType.SR.ToString()) || tGoup.Profile.GetParam("FARE_TYPE").Equals("COMMNEW") || tGoup.Profile.GetParam("FARE_TYPE").Equals(FlightFareType.PUB.ToString()))
            {
                AirOrderItem airOrderItem = new AirOrderItem(airMaterial);

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

                SetPreBookingPassengers(airMaterial, ref passengers);

            }
            else
            {
                try
                {

                    GetAirBookingCondition(ref passengers, tGoup);
                }
                catch (Exception E)
                {
                    log.Error(E.Message, E);
                }

            }

            AirService.PreBookAirline2(ref airMaterial, passengers);

            airMaterial = flightMerchandiseManager.EditMaterialGroupMarkup(airMaterial);

        }
        catch (Exception ex)
        {
            DoErrorProcess(ex);
            log.Error(ex.Message, ex);
            bclError = true;

            DisplayCannotbook();
            return;
        }

        if (bclError)
        {
            DisplayCannotbook();
            return;
        }

        if (Convert.ToBoolean(tGoup.Profile.GetParam("ISWEBFARE")))
        {
            tGoup.FareType = AirFareType.Published;
            Price price = new Price();
            price.SetAmount(TERMS.Common.PassengerType.Adult,new FareAmount(Convert.ToDecimal(tGoup.Profile.GetParam("PUBLISHED_ADULT_FARE"))));
            price.SetAmount(TERMS.Common.PassengerType.Child,new FareAmount(Convert.ToDecimal(tGoup.Profile.GetParam("PUBLISHED_CHILD_FARE"))));
            Markup mk = FlightMerchandise.AirProduct.GetMarkup(tGoup);
            price.AddMarkup(mk);
            tGoup.SetPrice(price);

        }
        //
        //if (IsPriceChanged())

        airMaterial = EditFare(airMaterial);

        newPrice = GetTotalPrice(airMaterial);

        SelectAirMaterial = tGoup;

        //���õ�ǰҳ��
        SetCurrentPageNumber();

        SetCurrentTabFlag();

        if (isClickAvailable == true && IsChangeNotLess(newPrice, originalPrice))
        {
            OperaterAdvice.DoAdvice(Terms.Configuration.Utility.ConfigurationConst.OperateType.IBE_AvailableFareChanged, this);

            ScriptManager.RegisterStartupScript(upSelect, upSelect.GetType(), "alt", "<script>$('ctl00_MainContent_pnlSelectProcessing').style.display ='none';</script>", false);

            Label lblCurrentMsg = null;
            Panel pnlCurrentComfirm = null;

            if (isClickAvailable == false)
            {
                lblCurrentMsg = lblSoldOutMsg_Select;
                pnlCurrentComfirm = pnlComfirm_Select;
            }
            else
            {
                lblCurrentMsg = lblSoldOutMsg;
                pnlCurrentComfirm = pnlComfirm;
            }

            if (IsLittleChanged(originalPrice, newPrice))
            {
                lblCurrentMsg.Text = string.Format(LittleChangedSoldoutMsg, ((decimal)(newPrice - originalPrice)).ToString("#,###.##"));
            }
            else
            {
                lblCurrentMsg.Text = string.Format(LargeChangedSoldoutMsg, ((decimal)(newPrice - originalPrice)).ToString("#,###.##"));
            }

            pnlCurrentComfirm.Attributes.Add("style", "display:block;");

        }
        else
        {
            ScriptManager.RegisterStartupScript(upSelect, upSelect.GetType(), "alt", "<script>$('ctl00_MainContent_pnlSelectProcessing').style.display ='none';document.getElementById('maskDIV').style.display = 'none';</script>", false);
            Response.Redirect("Step3_confirm.aspx?ConditionID=" + Request.Params["ConditionID"]);
        }

        //Response.Redirect("Step3_bulk.aspx");
    }
    protected bool GetFlights(string pnr)
    {
        string errMsg = string.Empty;
        DpwPNR dpwPNR = new DpwPNR();
        bool isMatchAirline = false;
        bool isMatchDeparture = false;
        bool isMatchBeginDate = false;
        bool isMatchEndDate = false;
        string originalAirline = ((TourOrderItem)Transaction.CurrentTransactionObject.Items[0]).AirLine;
        string originalDeparture = ((TourOrderItem)Transaction.CurrentTransactionObject.Items[0]).DepartureCity;
        //string originalDestination= ((TourOrderItem)Transaction.CurrentTransactionObject.Items[0]).;
        DateTime originalBeginDate = ((TourOrderItem)Transaction.CurrentTransactionObject.Items[0]).BeginDate;
        DateTime originalEndDate = ((TourOrderItem)Transaction.CurrentTransactionObject.Items[0]).EndDate;
        if (pnr.Equals(string.Empty))
        {
            errMsg = "Please Input PNR";

        }
        else if (pnr.Length != 6)
        {
            errMsg = "Please Input Correct PNR";

        }
        else
        {
            dpwPNR = m_airService.GetPnrData(pnr, out errMsg);

        }
        if (errMsg.Equals(string.Empty))
        {
            DpwFlightList flights = dpwPNR.Flights;

            AirMaterial airMaterial = new AirMaterial(new TERMS.Core.Profiles.Profile("air"));
            //int[] divideNumber =

            Hashtable timeSpan = new Hashtable();
            List<AirLeg> airLegList = m_AirLegList;
            bool isOneWay = false;

            if (flights.Count > 0)
            {
                if (!flights[0].DepartureAirport.Equals(flights[flights.Count - 1].ArrivalAirport))
                    isOneWay = true;
            }

            for (int i = 0; i < flights.Count; i++)
            {
                if (flights[i].Airline.Contains(originalAirline))
                    isMatchAirline = true;
                AirLeg air = new AirLeg();
                air.AirLine = new Airline(flights[i].Airline);
                air.ArriveTime = flights[i].ArrivalDateTime;
                air.BookingClass = flights[i].BookingClass;
                Airport deptAirport = new Airport();
                City deptCity = new City();

                Terms.Common.Domain.Airport airport = m_airService.CommAirportDao.FindByAirport(flights[i].DepartureAirport);
                deptCity.Code = airport.City.Code;
                deptCity.Name = airport.City.Name;
                deptAirport.City = deptCity;
                deptAirport.Name = airport.Name;
                deptAirport.Code = airport.Code;
                air.DepartureAirport = deptAirport;
                air.DepartureTime = flights[i].DepartureDateTime;

                if (i == 0)
                {
                    if (deptCity.Code.Contains(originalDeparture))
                        isMatchDeparture = true;
                    if (air.DepartureTime.ToString("MM/dd/yyyy").Equals(originalBeginDate.ToString("MM/dd/yyyy")))
                        isMatchBeginDate = true;
                }

                Airport destAirport = new Airport();
                City destCity = new City();

                Terms.Common.Domain.Airport airtport2 = m_airService.CommAirportDao.FindByAirport(flights[i].ArrivalAirport);
                destCity.Code = airtport2.City.Code;
                destCity.Name = airtport2.City.Name;
                destAirport.City = destCity;
                destAirport.Name = airtport2.Name;
                destAirport.Code = airtport2.Code;
                air.DestinationAirport = destAirport;
                air.FlightNumber = flights[i].FlightNumber;

                if (i > 0)
                {
                    timeSpan.Add(i.ToString() + "-" + (i + 1).ToString(), flights[i].DepartureDateTime.Subtract(flights[i - 1].ArrivalDateTime));

                }

                airLegList.Add(air);
                //SubAirTrip subAirTrip = new SubAirTrip();
                //subAirTrip.
            }

            if (isOneWay)
            {
                SubAirTrip deptSubAirTrip = new SubAirTrip();
                for (int j = 0; j < airLegList.Count; j++)
                {
                    deptSubAirTrip.AddLeg(airLegList[j]);
                }
                airMaterial.AddSubTrip(deptSubAirTrip);
            }
            else
            {
                TimeSpan bigSpan = new TimeSpan();
                string bigSpanKey = string.Empty;
                foreach (string key in timeSpan.Keys)
                {
                    if (bigSpan.CompareTo(timeSpan[key]) < 0)
                    {
                        bigSpan = (TimeSpan)timeSpan[key];
                        bigSpanKey = key;
                    }
                }

                string[] flightNumber = bigSpanKey.Split('-');

                if (flightNumber.Length == 2)
                {
                    SubAirTrip deptSubAirTrip = new SubAirTrip();
                    SubAirTrip retnSubAirTrip = new SubAirTrip();

                    for (int j = 0; j < airLegList.Count; j++)
                    {
                        if (j <= (Convert.ToInt32(flightNumber[0]) - 1))
                            deptSubAirTrip.AddLeg(airLegList[j]);
                        else
                            retnSubAirTrip.AddLeg(airLegList[j]);

                    }

                    airMaterial.AddSubTrip(deptSubAirTrip);
                    airMaterial.AddSubTrip(retnSubAirTrip);
                    if (retnSubAirTrip.Flights[0].DepartureTime.ToString("MM/dd/yyyy").Equals(originalEndDate.ToString("MM/dd/yyyy")))
                        isMatchEndDate = true;
                }
            }

            m_NewAirOrderItem = new AirOrderItem(airMaterial);

            //Fare
            int fareLength = dpwPNR.FareInfo.Fares.Count;
            for (int fareCount = 0; fareCount < fareLength; fareCount++)
            {
                DpwFare fare = dpwPNR.FareInfo.Fares[fareCount];

                switch (fare.PTC)
                {
                    case GTTWSpanClient.PassengerType.Adult:
                        m_NewAirOrderItem.Merchandise.SetAdultBaseFare(fare.BaseFare);
                        m_NewAirOrderItem.Merchandise.SetAdultTax(fare.Tax);
                        break;
                    case GTTWSpanClient.PassengerType.Child:
                        m_NewAirOrderItem.Merchandise.SetChildBaseFare(fare.BaseFare);
                        m_NewAirOrderItem.Merchandise.SetChildTax(fare.Tax);
                        break;
                    case GTTWSpanClient.PassengerType.Infant:
                        break;
                    default:
                        break;
                }
            }
            m_NewAirOrderItem.WSpanRecordLocator = dpwPNR.RecordLoactor;

            Transaction.CurrentTransactionObject.Items.Add(m_NewAirOrderItem);

            int adultNumber = GetPassengers(dpwPNR.Passengers)[0];
            int childNumber = GetPassengers(dpwPNR.Passengers)[1];

            //TourPriceInfoControl1.Tax = m_NewAirOrderItem.Merchandise.AdultTax * adultNumber + m_NewAirOrderItem.Merchandise.ChildTax * childNumber;
            //TourPriceInfoControl1.ShowTotalPrice = GetNetPrice();// +TourPriceInfoControl1.Tax;
            if (Transaction.CurrentTransactionObject.Items[0].AdultNumber != adultNumber || Transaction.CurrentTransactionObject.Items[0].ChildNumber != childNumber)
            {
                lblError.Text = "PNR��s passenger number is not equal order��s traveler number.";
                return false;
            }
            else
            {
                if (!isMatchAirline)
                {
                    lblError.Text = "Warning: Not default airlines price may be different.";

                    lblError.Style.Add("color", "blue");
                }
                else if (!isMatchDeparture)
                {
                    lblError.Text = "Warning: Not default departure city/destination. Be careful.";
                    lblError.Style.Add("color", "blue");
                }
                else if (!isMatchBeginDate || !isMatchEndDate)
                {
                    lblError.Text = "Warning: Not default departure/return date. Be careful.";
                    lblError.Style.Add("color", "blue");
                }
                else
                {
                    lblError.Style.Add("color", "red");
                }
                return true;
            }

        }
        else
        {
            lblError.Text = errMsg;
            return false;
        }
    }
示例#6
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);
        }
    }
    private void SearchToBinder()
    {
        //if (Utility.SelectAirGroup == null)
        //{
        //    ComponentGroup group = new ComponentGroup();
        //    AirComponentGroup airGroup = (AirComponentGroup)((ComponentGroup)PackageMerchandise.ComponentGroup.Items[1].Component).Items[ParentIndex].Component;
        //    ComponentGroupItem componentGroupItem = new ComponentGroupItem(airGroup.Items[SonIndex].Component);
        //    AirComponentGroup lastGroup = new AirComponentGroup((AirProfile)airGroup.Profile);
        //    lastGroup = (AirComponentGroup)airGroup.Clone();
        //    lastGroup.Items.Add(componentGroupItem);
        //    group.Profile = PackageMerchandise.ComponentGroup.Profile;
        //    group.Items.Clear();
        //    group.Items.Add(new ComponentGroupItem(lastGroup));
        //    Utility.SelectAirGroup = group;

        //    if (Utility.Transaction.CurrentTransactionObject.Items.Count == 0)
        //    {
        //        SaleMerchandise saleMerchandise = new SaleMerchandise();
        //        saleMerchandise.ComponentGroup = group;
        //        Utility.Transaction.CurrentTransactionObject.AddItem(saleMerchandise);

        //    }
        //    else
        //    {
        //        Utility.Transaction.CurrentTransactionObject.Items[0].Merchandise.ComponentGroup = group;
        //    }
        //}
        if (pgMerchandise != null && pgMerchandise.Items.Count > 0)
        {
            //int index = m_SaleMerchandise.DefaultMerchandise.Length - 1;

            PackageOrderItem packageOrderItem = new PackageOrderItem(new PackageProfile("PackageProfile"));

            int hotelIndex = Convert.ToInt32(((List<int>)pgMerchandise.DefaultIndex[1 + pgMerchandise.CurrentHotelListNumber])[0]);
            List<PackageMaterial> MVHotelList = pgMerchandise.GetPackageMaterials(1 + pgMerchandise.CurrentHotelListNumber);
            packageOrderItem.RoomPrice = ((PackageMaterial)MVHotelList[hotelIndex]).RoomPrice;
            packageOrderItem.Nights = ((PackageMaterial)MVHotelList[hotelIndex]).Nights;
            packageOrderItem.RoomPricePerNight = ((PackageMaterial)MVHotelList[hotelIndex]).RoomPricePerNight;
            packageOrderItem.AirPrice = ((PackageMaterial)MVHotelList[hotelIndex]).AirPrice;
            packageOrderItem.TotalPrice = ((PackageMaterial)MVHotelList[hotelIndex]).TotalPrice;

            AirOrderItem airOrderItem = new AirOrderItem((AirMaterial)pgMerchandise.DefaultMerchandise[0]);

            packageOrderItem.Add(airOrderItem);

            for (int i = 1; i < pgMerchandise.Items.Count; i++)
            {
                for (int k = 0; k < ((List<Hotel>)pgMerchandise.DefaultMerchandise[i]).Count; k++)
                {
                    MVHotel mvHotel = (MVHotel)((List<Hotel>)pgMerchandise.DefaultMerchandise[i])[k];

                    for (int roomIndex = 0; roomIndex < mvHotel.Items.Count; roomIndex++)
                    {
                        MVRoom mvRoom = (MVRoom)mvHotel.Items[roomIndex];

                        //mvRoom.DefaultRoomType.Room.Hotel.SetAddress(new TERMS.Common.Address(mvRoom.DefaultRoomType.Room.Hotel.City, mvRoom.DefaultRoomType.Room.Hotel.Address, mvHotel.GetAddress().ZipCode));

                        HotelOrderItem hotelOrderItem = new HotelOrderItem(mvRoom.DefaultRoomType, mvRoom.Profile);

                        packageOrderItem.Add(hotelOrderItem);
                    }
                }
                if (Utility.Transaction.CurrentTransactionObject != null)
                    Utility.Transaction.CurrentTransactionObject.Items.Clear();
                Utility.Transaction.CurrentTransactionObject.Items.Add(packageOrderItem);
            }
        }

        this.DefaultFlightDetails1.FlightDetails = AirMaterialList;
        this.FlightHeader1.ReBind();
        this.ShowPackageHotels1.pgMerchandise = pgMerchandise;

        this.ShowPackageHotels1.BindHotels();

        //如果Hotel的checkin checkout 的差大于5天 edit by tll
        SetChooseDisable();
    }
示例#8
0
    protected void btnContinue_Click(object sender, EventArgs e)
    {
        if (SessionExpired)
            Err("The search condition has been removed from cache, please re-search.", "", "Step3_bulk.aspx");
        else if (SelectedAirMerchandise.Profile.GetParam("FARE_TYPE").Equals(FlightFareType.SR.ToString()) || SelectedAirMerchandise.Profile.GetParam("FARE_TYPE").Equals(FlightFareType.PUB.ToString()))
        {
            int tourIndex = Convert.ToInt32(Request["selectedTour"].ToString());

            AirMaterial airMaterial = (AirMaterial)SelectedAirMerchandise.Items[tourIndex];

            AirOrderItem airOrderItem = new AirOrderItem(airMaterial);

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

        }
        else
        {
            AirMaterial airMaterial = (AirMaterial)SelectedAirMerchandise.Items[Index];
            IList<Passenger> passengers = new List<Passenger>();
            try
            {

                GetAirBookingCondition(ref passengers,airMaterial);
            }
            catch (Exception E)
            {
                log.Error(E.Message, E);
            }
            //AirMaterial airMaterial = (AirMaterial)((TERMS.Business.Centers.SalesCenter.AirOrderItem)this.Transaction.CurrentTransactionObject.Items[0]).Merchandise;

            bool bclError = false;

            try
            {
                string[] requestXML = new string[3];
                //ws.PreBookAirline(ref group, SearchArray, requestXML);
                AirService.PreBookAirline(ref airMaterial, passengers);
            }
            catch (Exception ex)
            {
                log.Error(ex.Message, ex);
                bclError = true;
            }

            if (bclError)
                this.Err("Sorry, can not booking the routing.  please choose others routing again.", "", "Step3_bulk.aspx");

        }
        Response.Redirect("Step3_confirm.aspx");
    }
示例#9
0
    private void GetAirBookingCondition(ref IList<Passenger> passengers,AirMaterial airMaterial)
    {
        //AirMaterial newAirMaterial = new AirMaterial(SelectedAirMerchandise.Profile);
        //newAirMaterial.SetAdultBaseFare(SelectedAirMerchandise.AdultBaseFare);
        //newAirMaterial.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));

        //newAirMaterial.Price.SetMarkup(markup);

        ////newAirMaterial.Price.AddMarkup(new TERMS.Common.Markup(TERMS.Common.PassengerType.Child, new TERMS.Common.FareAmount(SelectedAirMerchandise.ChildMarkup)));

        ////ADD END

        //int tourIndex = Convert.ToInt32(Request["selectedTour"].ToString());

        //AirMaterial airMaterial = (AirMaterial)SelectedAirMerchandise.Items[tourIndex];

        //decimal distributeAdultMarkup = airMaterial.GetPrice().GetMarkup(TERMS.Common.PassengerType.Adult, "DISTRIBUTE_MARKUP");
        //decimal distributeChildMarkup = airMaterial.GetPrice().GetMarkup(TERMS.Common.PassengerType.Child, "DISTRIBUTE_MARKUP");

        //newAirMaterial.AirTrip = airMaterial.AirTrip;
        //int adultNumber = Convert.ToInt32(SelectedAirMerchandise.Profile.GetParam("ADULT_NUMBER"));
        //int childNumber = Convert.ToInt32(SelectedAirMerchandise.Profile.GetParam("CHILD_NUMBER"));

        //airMaterial.Profile.SetParam("ADULT_NUMBER",adultNumber);
        //airMaterial.Profile.SetParam("CHILD_NUMBER",childNumber);
        airMaterial.Profile = SelectedAirMerchandise.Profile;

        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);
        }
    }