public GetAllDataPointsInfoResponse GetAllDataPointInfo() { GetAllDataPointsInfoResponse response = new GetAllDataPointsInfoResponse(); try { IEnumerable <DataPoint> allDataPoints = _dataPointRepository.FindAll(); response.DataPointInfoViews = allDataPoints.ConverToDataPointInfoViews(); } catch (Exception ex) { string message = "查询失败!\n错误信息:\n" + ex.Message; response = new GetAllDataPointsInfoResponse() { ResponseSucceed = false, Message = "查询失败" }; LoggingFactory.GetLogger().WriteDebugLogger(message); return(response); } return(response); }
private void ShowDataPionInformation() { GetAllDataPointsInfoResponse getAllDataPointsInfoResponse = this.dataPointService.GetAllDataPointInfo(); if (getAllDataPointsInfoResponse != null && getAllDataPointsInfoResponse.ResponseSucceed) { this.dgDataPiontInformation.ItemsSource = getAllDataPointsInfoResponse.DataPointInfoViews; //分组 ICollectionView view = CollectionViewSource.GetDefaultView(this.dgDataPiontInformation.ItemsSource); view.GroupDescriptions.Add(new PropertyGroupDescription("ModuleId")); //排序 ICollectionView sortView = CollectionViewSource.GetDefaultView(this.dgDataPiontInformation.ItemsSource); sortView.SortDescriptions.Add(new SortDescription("Number", ListSortDirection.Ascending)); } }