public bool IsFullAvailability(HotelAvailabilityRS objHotelAvailabilityRS, StayCriteriaSelection objStayCriteriaSelection) { // Assumes objHotelAvailabilityRS does not contain alternate availability info. if (objHotelAvailabilityRS.HotelRoomAvailInfos.Length == objStayCriteriaSelection.RoomOccupantSelections.Length) { if (ConfigurationManager.AppSettings["EnableRoomRateDescriptionModel"] != "1") { return true; } else { for (int si = 0; si < objHotelAvailabilityRS.HotelRoomAvailInfos.Length; si++) { HotelRoomAvailInfo objHotelRoomAvailInfo = objHotelAvailabilityRS.HotelRoomAvailInfos[si]; bool bRatesAvailable = false; for (int i = 0; i < objHotelRoomAvailInfo.RoomRates.Length; i++) { if (objHotelRoomAvailInfo.RoomRates[i].DescriptionStatus == RoomRateDescriptionStatus.Active) { bRatesAvailable = true; break; } for (int j = 0; j < objHotelRoomAvailInfo.RatePlans.Length; j++) { if (objHotelRoomAvailInfo.RatePlans[j].Code == objHotelRoomAvailInfo.RoomRates[i].RatePlanCode) { if (objHotelRoomAvailInfo.RatePlans[j].Type == RatePlanType.Negotiated || objHotelRoomAvailInfo.RatePlans[j].Type == RatePlanType.Consortia) { bRatesAvailable = true; } break; } } if (bRatesAvailable) break; } if (!bRatesAvailable) { return false; } } } } return true; }
public bool IsCreditCardInfoRequired(HotelAvailabilityRS objHotelAvailabilityRS, RoomRateSelection[] objRoomRateSelections, PaymentGatewayInfo objPaymentGatewayInfo, bool bProfileGuaranteeRequested) { bool bRequired = false; for (int i = 0; i < objRoomRateSelections.Length; i++) { HotelRoomAvailInfo objHotelRoomAvailInfo = this.GetHotelRoomAvailInfo(objHotelAvailabilityRS.HotelRoomAvailInfos, objRoomRateSelections[i].RoomRefID); HotelAvailRatePlan objHotelAvailRatePlan = this.GetRatePlanInfo(objHotelRoomAvailInfo.RatePlans, objRoomRateSelections[i].RatePlanCode); if (objHotelAvailRatePlan.GuaranteeType == GuaranteeType.CCDCVoucher && !bProfileGuaranteeRequested) { bRequired = true; break; } else if (objHotelAvailRatePlan.GuaranteeType == GuaranteeType.Deposit || objHotelAvailRatePlan.GuaranteeType == GuaranteeType.PrePay) { if (objPaymentGatewayInfo == null || objPaymentGatewayInfo.Mode == PaymentGatewayMode.MerchantSiteCapturesCardDetails) { bRequired = true; break; } } } return bRequired; }