public GetMaterialMasterListResponseDto GetMaterialMasterList()
        {
            GetMaterialMasterListResponseDto GetMaterialMasterListResponseDto;

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

            return(GetMaterialMasterListResponseDto);
        }
Beispiel #2
0
        public GetMaterialMasterListResponseDto GetMaterialMasterList()
        {
            var response = new GetMaterialMasterListResponseDto();
            var cModel   = new GetMaterialMasterListCM
            {
                //PageIndex = getMaterialMasterListRequestDto.PageIndex,
                //PageSize = getMaterialMasterListRequestDto.PageSize
            };
            var model = materialMastersRepository.GetMaterialMasterList();

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

            return(response);
        }
Beispiel #3
0
        private static GetMaterialMasterListResponseDto MaterialMasterListMapper(List <MaterialMasterListForDropDown> list, GetMaterialMasterListResponseDto GetMaterialMasterListResponseDto)
        {
            Mapper.CreateMap <MaterialMasterListForDropDown, MaterialMasterList>();
            GetMaterialMasterListResponseDto.MaterialMasterList =
                Mapper.Map <List <MaterialMasterListForDropDown>, List <MaterialMasterList> >(list);

            return(GetMaterialMasterListResponseDto);
        }