示例#1
0
        public HotelRateDescriptionRS GetPricing(HotelSelectDto searchCriteria)
        {
            Security1 sec = new Security1();
            HotelRateDescriptionRQ req = new HotelRateDescriptionRQ();
            HotelRateDescriptionRQAvailRequestSegment availSeg =
                new HotelRateDescriptionRQAvailRequestSegment();
            HotelRateDescriptionRQAvailRequestSegmentGuestCounts guests =
                new HotelRateDescriptionRQAvailRequestSegmentGuestCounts();
            HotelRateDescriptionRQAvailRequestSegmentHotelSearchCriteria searchCrit =
                new HotelRateDescriptionRQAvailRequestSegmentHotelSearchCriteria();
            HotelRateDescriptionRQAvailRequestSegmentHotelSearchCriteriaCriterion criterian =
                new HotelRateDescriptionRQAvailRequestSegmentHotelSearchCriteriaCriterion();
            HotelRateDescriptionRQAvailRequestSegmentHotelSearchCriteriaCriterionHotelRef hotelRef =
                new HotelRateDescriptionRQAvailRequestSegmentHotelSearchCriteriaCriterionHotelRef();
            HotelRateDescriptionRQAvailRequestSegmentTimeSpan journeyDate =
                new HotelRateDescriptionRQAvailRequestSegmentTimeSpan();
            HotelRateDescriptionRQAvailRequestSegmentRatePlanCandidates ratePlans =
                new HotelRateDescriptionRQAvailRequestSegmentRatePlanCandidates();
            HotelRateDescriptionRQAvailRequestSegmentRatePlanCandidatesRatePlanCandidate ratePlan =
                new HotelRateDescriptionRQAvailRequestSegmentRatePlanCandidatesRatePlanCandidate();

            var startDate = Convert.ToDateTime(searchCriteria.StartDate);
            var endDate = Convert.ToDateTime(searchCriteria.EndDate);
            journeyDate.Start = startDate.Month.ToString() + "-" + startDate.Day.ToString();
            journeyDate.End = endDate.Month.ToString() + "-" + endDate.Day.ToString(); ;

            hotelRef.HotelCode = searchCriteria.HotelCode;
            criterian.HotelRef = hotelRef;
            searchCrit.Criterion = criterian;

            guests.Count = searchCriteria.TotalTravellers;

            ratePlan.RateCode = "USD";
            ratePlan.RPH = searchCriteria.RPHNumber.TrimStart('0');
            ratePlans.RatePlanCandidate = ratePlan;

            /*availSeg.HotelSearchCriteria = searchCrit;
            availSeg.GuestCounts = guests;
            availSeg.TimeSpan = journeyDate;              */
            availSeg.RatePlanCandidates = ratePlans;

            req.AvailRequestSegment = availSeg;

            HotelRateDescriptionService client = new HotelRateDescriptionService();
            client.MessageHeaderValue = Get("HotelRateDescriptionLLSRQ", "HotelRateDescriptionRQ");
            sec.BinarySecurityToken = searchCriteria.SessionId;
            client.Security = sec;

            var result = client.HotelRateDescriptionRQ(req);

            var XML = Common.Utility.Serialize(result);
            return result;
        }
示例#2
0
 /// <remarks/>
 public void HotelRateDescriptionRQAsync(HotelRateDescriptionRQ HotelRateDescriptionRQ1, object userState) {
     if ((this.HotelRateDescriptionRQOperationCompleted == null)) {
         this.HotelRateDescriptionRQOperationCompleted = new System.Threading.SendOrPostCallback(this.OnHotelRateDescriptionRQOperationCompleted);
     }
     this.InvokeAsync("HotelRateDescriptionRQ", new object[] {
                 HotelRateDescriptionRQ1}, this.HotelRateDescriptionRQOperationCompleted, userState);
 }
示例#3
0
 /// <remarks/>
 public void HotelRateDescriptionRQAsync(HotelRateDescriptionRQ HotelRateDescriptionRQ1) {
     this.HotelRateDescriptionRQAsync(HotelRateDescriptionRQ1, null);
 }