Beispiel #1
0
        public GetInvoiceDetailsResponseDto GetInvoiceDetails(GetInvoiceDetailsRequestDto getInvoiceDetailsRequestDto)
        {
            GetInvoiceDetailsResponseDto response = new GetInvoiceDetailsResponseDto();

            try
            {
                response = rInvoiceProvider.GetInvoiceDetails(getInvoiceDetailsRequestDto);
                response.ServiceResponseStatus = 1;
            }
            catch (SSException applicationException)
            {
                response = new GetInvoiceDetailsResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorMessage          = applicationException.Message,
                    ErrorCode             = applicationException.ExceptionCode
                };
            }
            catch (Exception exception)
            {
                response = new GetInvoiceDetailsResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorCode             = ExceptionAttributes.ExceptionCodes.InternalServerError,
                    ErrorMessage          = exception.Message
                };
            }

            return(response);
        }
Beispiel #2
0
        public GetInvoiceDetailsResponseDto GetInvoiceDetails(GetInvoiceDetailsRequestDto getInvoiceDetailsRequestDto)
        {
            var response = new GetInvoiceDetailsResponseDto();

            var model = invoiceRepository.GetInvoiceDetails(getInvoiceDetailsRequestDto.InvoiceNumber);

            if (model != null)
            {
                response = InvoiceDetailsMapper((List <SavedInvoiceDetailsQMModel>)model.GetSavedInvoiceDetailsList, response);
            }

            return(response);
        }
Beispiel #3
0
        private static GetInvoiceDetailsResponseDto InvoiceDetailsMapper(List <SavedInvoiceDetailsQMModel> list, GetInvoiceDetailsResponseDto getInvoiceDetailsResponseDto)
        {
            Mapper.CreateMap <SavedInvoiceDetailsQMModel, SavedInvoiceDetails>();
            getInvoiceDetailsResponseDto.GetSavedInvoiceDetailsList =
                Mapper.Map <List <SavedInvoiceDetailsQMModel>, List <SavedInvoiceDetails> >(list);

            return(getInvoiceDetailsResponseDto);
        }