Пример #1
0
        public GetDcDetailsForInvoiceResponseDto GetDcDetailsForInvoice(string DcNumber)
        {
            GetDcDetailsForInvoiceResponseDto response = new GetDcDetailsForInvoiceResponseDto();

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

            return(response);
        }
Пример #2
0
        public GetDcDetailsForInvoiceResponseDto GetDcDetailsForInvoice(string DcNumber)
        {
            var response = new GetDcDetailsForInvoiceResponseDto();

            var model = invoiceRepository.GetDcDetailsForInvoice(DcNumber);

            if (model != null)
            {
                response = DcDetailsForInvoiceMapper((List <GetDcDetailsForInvoiceModel>)model.GetDcDetailsForInvoiceModel, response);
            }

            return(response);
        }
Пример #3
0
        private static GetDcDetailsForInvoiceResponseDto DcDetailsForInvoiceMapper(List <GetDcDetailsForInvoiceModel> list, GetDcDetailsForInvoiceResponseDto getDcDetailsForInvoiceResponseDto)
        {
            Mapper.CreateMap <GetDcDetailsForInvoiceModel, GetDcDetailsForInvoiceList>();
            getDcDetailsForInvoiceResponseDto.GetDcDetailsForInvoiceList =
                Mapper.Map <List <GetDcDetailsForInvoiceModel>, List <GetDcDetailsForInvoiceList> >(list);

            return(getDcDetailsForInvoiceResponseDto);
        }