예제 #1
0
        public GetAllDataPointsHistoryDataResponse GetAllDataPointsHistoryData()
        {
            GetAllDataPointsHistoryDataResponse response = new GetAllDataPointsHistoryDataResponse();

            try
            {
                IEnumerable <DataPointHistoryData> dataPointHistoryDatas =
                    dataPointHistoryDataRepository.FindAll();

                response.DataPointHistoryDataView =
                    dataPointHistoryDatas.ConvetToDataPointHistoryDataView();
            }
            catch (Exception ex)
            {
                string message = "查询失败!错误信息:/n" + ex.Message;
                response = new GetAllDataPointsHistoryDataResponse()
                {
                    ResponseSucceed = false,
                    Message         = "查询失败"
                };
                LoggingFactory.GetLogger().WriteDebugLogger(message);

                return(response);
            }

            return(response);
        }
예제 #2
0
        public void TestGetAllDataPointsHistoryData()
        {
            IUnitOfWork                     unitOfWork                     = new AdoUnitOfWork();
            IDataPointRepository            dataPointRepository            = new DataPointRepository(unitOfWork);
            IDataPointHistoryDataRepository dataPointHistoryDataRepository = new DataPointHistoryDataRepository(unitOfWork);
            IModuleRepository               moduleRepository               = new ModuleRepository(unitOfWork);

            DataPointHistoryDataService dataPointHistoryDataService
                = new DataPointHistoryDataService(dataPointHistoryDataRepository,
                                                  unitOfWork);

            GetAllDataPointsHistoryDataResponse response = new GetAllDataPointsHistoryDataResponse();

            response = dataPointHistoryDataService.GetAllDataPointsHistoryData();

            Assert.True(response.ResponseSucceed);
        }