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); }
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); }
private static GetMaterialMasterListResponseDto MaterialMasterListMapper(List <MaterialMasterListForDropDown> list, GetMaterialMasterListResponseDto GetMaterialMasterListResponseDto) { Mapper.CreateMap <MaterialMasterListForDropDown, MaterialMasterList>(); GetMaterialMasterListResponseDto.MaterialMasterList = Mapper.Map <List <MaterialMasterListForDropDown>, List <MaterialMasterList> >(list); return(GetMaterialMasterListResponseDto); }