コード例 #1
0
        public GetPartMasterResponseDto GetPartMaster(GetPartMasterRequestDto getPartMasterRequestDto)
        {
            GetPartMasterResponseDto getPartMasterResponseDto;

            try
            {
                getPartMasterResponseDto = rPartMasterProvider.GetPartMaster(getPartMasterRequestDto);
                getPartMasterResponseDto.ServiceResponseStatus = 1;
            }
            catch (SSException applicationException)
            {
                getPartMasterResponseDto = new GetPartMasterResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorMessage          = applicationException.Message,
                    ErrorCode             = applicationException.ExceptionCode
                };
            }
            catch (Exception exception)
            {
                getPartMasterResponseDto = new GetPartMasterResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorCode             = ExceptionAttributes.ExceptionCodes.InternalServerError,
                    ErrorMessage          = exception.Message
                };
            }

            return(getPartMasterResponseDto);
        }
コード例 #2
0
        public GetPartMasterResponseDto GetPartMaster(GetPartMasterRequestDto getPartMasterRequestDto)
        {
            var response = new GetPartMasterResponseDto();

            var cModel = new GetPartMasterCM()
            {
                //PageIndex = getPartMasterRequestDto.PageIndex,
                //PageSize = getPartMasterRequestDto.PageSize,
                VendorCode = getPartMasterRequestDto.VendorCode
            };

            var model = partMastersRepository.GetPartMaster(cModel);

            if (model != null && model.PartMasterList.Any())
            {
                response             = PartMasterMapper((List <PartMasterModel>)model.PartMasterList, response);
                response.RecordCount = model.RecordCount;
            }

            return(response);
        }
コード例 #3
0
        private static GetPartMasterResponseDto PartMasterMapper(List <PartMasterModel> list, GetPartMasterResponseDto getPartMasterResponseDto)
        {
            Mapper.CreateMap <PartMasterModel, PartMaster>();
            getPartMasterResponseDto.PartMasterList =
                Mapper.Map <List <PartMasterModel>, List <PartMaster> >(list);

            return(getPartMasterResponseDto);
        }