public GetInstrumentMasterResponseDto GetInstrumentMaster()
        {
            GetInstrumentMasterResponseDto getInstrumentMasterResponseDto;

            try
            {
                getInstrumentMasterResponseDto = rInstrumentMasterProvider.GetInstrumentMaster();
                getInstrumentMasterResponseDto.ServiceResponseStatus = 1;
            }
            catch (SSException applicationException)
            {
                getInstrumentMasterResponseDto = new GetInstrumentMasterResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorMessage          = applicationException.Message,
                    ErrorCode             = applicationException.ExceptionCode
                };
            }
            catch (Exception exception)
            {
                getInstrumentMasterResponseDto = new GetInstrumentMasterResponseDto
                {
                    ServiceResponseStatus = 0,
                    ErrorCode             = ExceptionAttributes.ExceptionCodes.InternalServerError,
                    ErrorMessage          = exception.Message
                };
            }

            return(getInstrumentMasterResponseDto);
        }
Esempio n. 2
0
        public GetInstrumentMasterResponseDto GetInstrumentMaster()
        {
            var response = new GetInstrumentMasterResponseDto();

            var cModel = new GetInstrumentMasterCM()
            {
                //PageIndex = getInstrumentMasterRequestDto.PageIndex,
                //PageSize = getInstrumentMasterRequestDto.PageSize,
                //InstrumentCode = getInstrumentMasterRequestDto.InstrumentCode
            };

            var model = instrumentMastersRepository.GetInstrumentMaster();

            if (model != null && model.GetInstrumentMasterList.Any())
            {
                response             = InstrumentMasterMapper((List <InstrumentMasterModel>)model.GetInstrumentMasterList, response);
                response.RecordCount = model.RecordCount;
            }

            return(response);
        }
Esempio n. 3
0
        private GetInstrumentMasterResponseDto InstrumentMasterMapper(List <InstrumentMasterModel> list, GetInstrumentMasterResponseDto response)
        {
            Mapper.CreateMap <InstrumentMasterModel, InstrumentMasterList>();
            response.InstrumentMasterList =
                Mapper.Map <List <InstrumentMasterModel>, List <InstrumentMasterList> >(list);

            return(response);
        }