示例#1
0
        public static GetDataPointInfoResponse ConvetToGetDataPointInfoResponse(this DataPoint dataPoint)
        {
            GetDataPointInfoResponse getDataPointInfoResponse = new GetDataPointInfoResponse();

            getDataPointInfoResponse.DataPointInfoView = dataPoint.ConvertToDataPoinntInfoView();

            return(getDataPointInfoResponse);
        }
        public GetDataPointInfoResponse GetDataPointInfo(GetDataPointInfoRequest request)
        {
            GetDataPointInfoResponse response = new GetDataPointInfoResponse();

            try
            {
                DataPoint dataPoint = _dataPointRepository.FindBy(request.DataPointId);
                response.DataPointInfoView = dataPoint.ConvertToDataPoinntInfoView();
            }
            catch (Exception ex)
            {
                string message = "查询失败!错误信息:/n" + ex.Message;
                response = new GetDataPointInfoResponse()
                {
                    ResponseSucceed = false,
                    Message         = "查询失败"
                };
                LoggingFactory.GetLogger().WriteDebugLogger(message);

                return(response);
            }

            return(response);
        }