コード例 #1
0
        public GetJobCardGenerationResponseDto GetJobCardGeneration()
        {
            GetJobCardGenerationResponseDto response = new GetJobCardGenerationResponseDto();

            try
            {
                response = rJobCardProvider.GetJobCardGeneration();
                response.ServiceResponseStatus = 1;
            }
            catch (SSException applicationException)
            {
                response = new GetJobCardGenerationResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorMessage          = applicationException.Message,
                    ErrorCode             = applicationException.ExceptionCode
                };
            }
            catch (Exception exception)
            {
                response = new GetJobCardGenerationResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorCode             = ExceptionAttributes.ExceptionCodes.InternalServerError,
                    ErrorMessage          = exception.Message
                };
            }

            return(response);
        }
コード例 #2
0
        public GetJobCardGenerationResponseDto GetJobCardGeneration()
        {
            var response = new GetJobCardGenerationResponseDto();

            var model = jobCardGenerationRepository.GetJobCardGeneration();

            if (model != null)
            {
                response = GetJobCardGenerationMapper((List <GetJobCardGenerationModel>)model.GetJobCardGenerationModelList, response);
            }

            return(response);
        }
コード例 #3
0
        private static GetJobCardGenerationResponseDto GetJobCardGenerationMapper(List <GetJobCardGenerationModel> list, GetJobCardGenerationResponseDto getJobCardGenerationResponseDto)
        {
            Mapper.CreateMap <GetJobCardGenerationModel, GetJobCardGenerationResponse>();
            getJobCardGenerationResponseDto.GetJobCardGenerationResponseList =
                Mapper.Map <List <GetJobCardGenerationModel>, List <GetJobCardGenerationResponse> >(list);

            return(getJobCardGenerationResponseDto);
        }