Пример #1
0
        public async Task <BaseResult <List <RoomTypeRatePlanResponse> > > GetRoomTypesAndRatePlans(RoomTypeByHotelAndChannelManger request)
        {
            DynamicParameters paramCollection = ChannelManagerRequestMapper.CreateChannelMangerValidationRequest(request);
            BaseResult <List <RoomTypesRatePlan> > roomRateResponse = await iRoomConnection.ExecuteStoredProcedure(Constants.StoredProcedure.GetRoomTypesAndRatePlans, paramCollection).ConfigureAwait(false);

            return(ChannelManagerResponseMapper.MapRoomTypeRatePlanResponse(roomRateResponse));// await iRoomConnection.ExecuteStoredProcedure(Constants.StoredProcedure.GetRoomTypesAndRatePlans, paramCollection).ConfigureAwait(false);
        }
Пример #2
0
        public async Task <BaseResult <bool> > ValidateRoomTypeRatePlanRequest(RoomTypeByHotelAndChannelManger request)
        {
            DynamicParameters paramCollection = ChannelManagerRequestMapper.CreateChannelMangerValidationRequest(request);
            BaseResult <List <ChannelManagerRequestValidationResponse> > validationResponse = new BaseResult <List <ChannelManagerRequestValidationResponse> >();

            switch (request.HotelCode)
            {
            case "TestCaseForException":
                try
                {
                    throw new Exception("Exception Thrown From Fake for Unit Test");
                }
                catch (Exception ex)
                {
                    validationResponse.IsError          = true;
                    validationResponse.ExceptionMessage = ex;
                }
                break;

            case "TestCaseForOkResponse":
                validationResponse.Result = new List <ChannelManagerRequestValidationResponse> {
                    new ChannelManagerRequestValidationResponse()
                };
                break;
            }
            // await iConnection.ExecuteStoredProcedure(Constants.StoredProcedure.ValidateChannelMangerRequest, paramCollection).ConfigureAwait(false);
            return(ChannelManagerResponseMapper.MapChannelManagerRequestValidationResponse(validationResponse));
        }
Пример #3
0
        public async Task <BaseResult <bool> > UpdateAllocationRates(UpdateAllocationRatesRequest request)
        {
            DynamicParameters paramCollection = ChannelManagerRequestMapper.CreateUpdateAllocationRatesRequest(request);
            BaseResult <List <ChannelManagerRequestValidationResponse> > validationResponse = new BaseResult <List <ChannelManagerRequestValidationResponse> >();

            //     await iConnection.ExecuteStoredProcedure(Constants.StoredProcedure.ValidateAllocationsRequest, paramCollection).ConfigureAwait(false);
            return(ChannelManagerResponseMapper.MapChannelManagerRequestValidationResponse(validationResponse));
        }
Пример #4
0
        //public async Task<BaseResult<bool>> IsHotelValid(string hotelId)
        //{
        //    BaseResult<bool> response = new BaseResult<bool>();

        //    BaseResult<List<Hotel>> hotelList = await this.ihotelConnection.GetListByPredicate(a => a.Code == hotelId);
        //    if (hotelList == null || hotelList.Result == null || !hotelList.Result.Any())
        //    {
        //        response.Result = false;
        //        return response;
        //    }
        //    return response;
        //}

        //public async Task<BaseResult<bool>> IsHotelActive(string hotelId)
        //{
        //    BaseResult<bool> response = new BaseResult<bool>();
        //    BaseResult<List<Hotel>> hotelList = await ihotelConnection.GetListByPredicate(h => h.Code == hotelId && h.IsActive == true);
        //    if (hotelList == null && hotelList.Result == null || !hotelList.Result.Any())
        //    {
        //        response.Result = false;
        //        return response;
        //    }
        //    return response;
        //}

        public async Task <BaseResult <bool> > ValidateRoomTypeRatePlanRequest(RoomTypeByHotelAndChannelManger request)
        {
            DynamicParameters paramCollection = ChannelManagerRequestMapper.CreateChannelMangerValidationRequest(request);
            BaseResult <List <ChannelManagerRequestValidationResponse> > validationResponse =
                await iConnection.ExecuteStoredProcedure(Constants.StoredProcedure.ValidateChannelMangerRequest, paramCollection).ConfigureAwait(false);

            return(ChannelManagerResponseMapper.MapChannelManagerRequestValidationResponse(validationResponse));
        }