public GetMaterialMasterResponseDto GetMaterialMaster()
        {
            GetMaterialMasterResponseDto getMaterialMasterResponseDto;

            try
            {
                getMaterialMasterResponseDto = rMaterialMasterProvider.GetMaterialMaster();
                getMaterialMasterResponseDto.ServiceResponseStatus = 1;
            }
            catch (SSException applicationException)
            {
                getMaterialMasterResponseDto = new GetMaterialMasterResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorMessage          = applicationException.Message,
                    ErrorCode             = applicationException.ExceptionCode
                };
            }
            catch (Exception exception)
            {
                getMaterialMasterResponseDto = new GetMaterialMasterResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorCode             = ExceptionAttributes.ExceptionCodes.InternalServerError,
                    ErrorMessage          = exception.Message
                };
            }

            return(getMaterialMasterResponseDto);
        }
예제 #2
0
        public GetMaterialMasterResponseDto GetMaterialMaster()
        {
            var response = new GetMaterialMasterResponseDto();
            var cModel   = new GetMaterialMasterCM
            {
                //PageIndex = getMaterialMasterRequestDto.PageIndex,
                //PageSize = getMaterialMasterRequestDto.PageSize,
                //MaterialCode = getMaterialMasterRequestDto.MaterialCode
            };
            var model = materialMastersRepository.GetMaterialMaster();

            if (model != null && model.MaterialMasterList.Any())
            {
                response             = MaterialMasterMapper((List <MaterialMasterModel>)model.MaterialMasterList, response);
                response.RecordCount = model.RecordCount;
            }

            return(response);
        }
예제 #3
0
        private static GetMaterialMasterResponseDto MaterialMasterMapper(List <MaterialMasterModel> list, GetMaterialMasterResponseDto getMaterialMasterResponseDto)
        {
            Mapper.CreateMap <MaterialMasterModel, MaterialMaster>();
            getMaterialMasterResponseDto.MaterialMasterList =
                Mapper.Map <List <MaterialMasterModel>, List <MaterialMaster> >(list);

            return(getMaterialMasterResponseDto);
        }