public void WhenISubmitAnOnlineAvailabilityCheckForFromToWithAdultsAndChildren(string p0, string p1, string p2, int p3, int p4)
        {
            OnlineAvailabilitySearchCriteriaDto searchCriteria = new OnlineAvailabilitySearchCriteriaDto
                                                                     {
                                                                         BusinessShortNames = new List<string> { p0 },
                                                                         StartDate = new CalendarDateDto(GetDateFromFeatureString(p1)),
                                                                         EndDate = new CalendarDateDto(GetDateFromFeatureString(p2)),
                                                                         RoomSearchCriteria = new List<OnlineRoomRestrictionsDto>
                                                                         {
                                                                             new OnlineRoomRestrictionsDto
                                                                             {
                                                                                 NumberOfAdults = p3,
                                                                                 NumberOfChildren = p4
                                                                             }
                                                                         }
                                                                     };

            searchResults = searchService.CheckOnlineAvailability(searchCriteria);
        }
コード例 #2
0
        /// <summary>
        /// Convert the AvailabilitySearchResult Date Model to the Dto Object
        /// </summary>
        /// <param name="availabilitySearchResult">AvailabilitySearchResult to convert</param>
        /// <returns>AvailabilitySearchResultDto</returns>
        public static OnlineAvailabilitySearchResultDto ConvertAvailabilitySearchResultToOnlineDto(AvailabilitySearchResult availabilitySearchResult)
        {
            // Convert the main object
            var availabilitySearchResultDto = new OnlineAvailabilitySearchResultDto
            {
                StartDate = ConvertCalendarDateToDto(availabilitySearchResult.StartDate),
                EndDate = ConvertCalendarDateToDto(availabilitySearchResult.EndDate),
                NoOfAdults = availabilitySearchResult.NoOfAdults,
                NoOfChildren = availabilitySearchResult.NoOfChildren           
            };

            if (availabilitySearchResult.BusinessCandidates != null)
            {
                // Convert the sub objects
                availabilitySearchResultDto.BusinessCandidates = 
                    availabilitySearchResult.BusinessCandidates.ConvertAll(ConvertAvailabilityResultBusinessToOnlineDto);
            }

            availabilitySearchResultDto.UnavailabilityReasonCode = (UnavailabilityReasonCodeDto?)availabilitySearchResult.UnavailabilityReasonCode;
            return availabilitySearchResultDto;
        }