/// <summary> /// 数据量统计方式呈现数据 /// </summary> private void StatView() { string categoryName = ""; string databaseName = ""; var databasePrefix = GetDatabasePrefix(ref categoryName, ref databaseName); if (databasePrefix != null) { var tableNames = GetTableNames(false); if (tableNames != null) { if (tableNames.Count > 10) { MessageBox.Show("对于数据量统计方式呈现最多只能选择10个表"); return; } var beginTime = GetBeginTime(); if (beginTime != null) { var endTime = GetEndTime(); if (endTime != null) { var filters = GetFilters(); var sc = new SearchCondition { DatabasePrefix = databasePrefix, TableNames = tableNames, Filters = filters, BeginTime = beginTime.Value, EndTime = endTime.Value, }; ShowStatView(sc, categoryName, databaseName); } } } } }
private void ShowStatView(SearchCondition sc, string categoryName, string databaseName) { var root = Application.Current.RootVisual as FrameworkElement; ViewStatData c = new ViewStatData(); c.SearchCondition = sc; c.Width = root.ActualWidth * 0.98; c.Height = root.ActualHeight * 0.98; c.HorizontalAlignment = HorizontalAlignment.Center; c.VerticalAlignment = VerticalAlignment.Center; c.Show(); foreach (var tableName in sc.TableNames) { service.LogAsync(new OperationLog { AccountName = Data.AdminConfigurationItem.UserName, AccountRealName = Data.AdminConfigurationItem.RealName, CategoryName = categoryName, DatabaseName = databaseName, TableName = tableName, Action = "查看统计视图", ActionMemo = string.Format("开始时间:{0} 结束时间:{1} 过滤条件:{2}", sc.BeginTime, sc.EndTime, sc.Filters.GetFilterText()) }); } }
/// <summary> /// 分组统计方式呈现数据 /// </summary> private void GroupView() { string categoryName = ""; string databaseName = ""; var databasePrefix = GetDatabasePrefix(ref categoryName, ref databaseName); if (databasePrefix != null) { var tableNames = GetTableNames(false); if (tableNames != null) { var beginTime = GetBeginTime(); if (beginTime != null) { var endTime = GetEndTime(); if (endTime != null) { var filters = GetFilters(); var sc = new SearchCondition { DatabasePrefix = databasePrefix, TableNames = tableNames, Filters = filters, BeginTime = beginTime.Value, EndTime = endTime.Value, }; ShowGroupView(sc, categoryName, databaseName); } } } } }