Exemplo n.º 1
0
        public GetRoomPriceResponseDto GetRoomPriceByProperty(int propertyId)
        {
            if (propertyId <= 0)
            {
                throw new PmsException("Property id is not valid.");
            }

            var response = new GetRoomPriceResponseDto();

            if (!AppConfigReaderHelper.AppConfigToBool(AppSettingKeys.MockEnabled))
            {
                response.RoomPricing = _iPmsLogic.GetRoomPriceByProperty(propertyId);
            }
            else
            {
                //mock data
            }
            return(response);
        }
Exemplo n.º 2
0
        public GetRoomPriceResponseDto GetRoomPriceByRateType(int propertyId, int rateTypeId)
        {
            if (propertyId <= 0)
            {
                throw new PmsException("Property id is not valid.");
            }

            var response = new GetRoomPriceResponseDto();

            if (rateTypeId <= 0)
            {
                return(response);
            }
            var roomPricingResponseDto = GetRoomPriceByProperty(propertyId);

            if (roomPricingResponseDto == null || roomPricingResponseDto.RoomPricing == null || roomPricingResponseDto.RoomPricing.Count <= 0)
            {
                return(response);
            }

            response.RoomPricing = roomPricingResponseDto.RoomPricing.Where(x => x.RateType.Id.Equals(rateTypeId)).ToList();
            return(response);
        }