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