コード例 #1
0
        public GetMachineMasterResponseDto GetMachineMaster()
        {
            GetMachineMasterResponseDto getMachineMasterResponseDto;

            try
            {
                getMachineMasterResponseDto = rMachineMasterProvider.GetMachineMaster();
                getMachineMasterResponseDto.ServiceResponseStatus = 1;
            }
            catch (SSException applicationException)
            {
                getMachineMasterResponseDto = new GetMachineMasterResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorMessage          = applicationException.Message,
                    ErrorCode             = applicationException.ExceptionCode
                };
            }
            catch (Exception exception)
            {
                getMachineMasterResponseDto = new GetMachineMasterResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorCode             = ExceptionAttributes.ExceptionCodes.InternalServerError,
                    ErrorMessage          = exception.Message
                };
            }

            return(getMachineMasterResponseDto);
        }
コード例 #2
0
        public GetMachineMasterResponseDto GetMachineMaster()
        {
            var response = new GetMachineMasterResponseDto();

            var cModel = new GetMachineMasterCM()
            {
                //PageIndex = getMachineMasterRequestDto.PageIndex,
                //PageSize = getMachineMasterRequestDto.PageSize,
                //MachineCode = getMachineMasterRequestDto.MachineCode
            };

            var model = machineMastersRepository.GetMachineMaster();

            if (model != null && model.GetMachineMasterList.Any())
            {
                response             = MachineMasterMapper((List <MachineMasterModel>)model.GetMachineMasterList, response);
                response.RecordCount = model.RecordCount;
            }

            return(response);
        }
コード例 #3
0
        private GetMachineMasterResponseDto MachineMasterMapper(List <MachineMasterModel> list, GetMachineMasterResponseDto response)
        {
            Mapper.CreateMap <MachineMasterModel, MachineMasterList>();
            response.MachineMasterList =
                Mapper.Map <List <MachineMasterModel>, List <MachineMasterList> >(list);

            return(response);
        }