コード例 #1
0
        public GetCategoryMasterResponseDto GetCategoryMaster()
        {
            GetCategoryMasterResponseDto response;

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

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

            var model = categoryMastersRepository.GetCategoryMaster();

            if (model != null)
            {
                response             = CategoryMasterMapper((List <CategoryMasterModel>)model.CategoryMasterList, response);
                response.RecordCount = model.RecordCount;
            }

            return(response);
        }
コード例 #3
0
        private static GetCategoryMasterResponseDto CategoryMasterMapper(List <CategoryMasterModel> list, GetCategoryMasterResponseDto getCategoryMasterResponseDto)
        {
            Mapper.CreateMap <CategoryMasterModel, CategoryMaster>();
            getCategoryMasterResponseDto.CategoryMasterList =
                Mapper.Map <List <CategoryMasterModel>, List <CategoryMaster> >(list);

            return(getCategoryMasterResponseDto);
        }