示例#1
0
        private void Stat_Click(object sender, RoutedEventArgs e)
        {
            if (SearchCondition.TableNames.Count > 10)
            {
                MessageBox.Show("对于数据量统计方式呈现最多只能选择10个表");
                return;
            }
            this.Close();
            ViewStatData c         = new ViewStatData();
            var          root      = Application.Current.RootVisual as FrameworkElement;
            var          tableName = (ListGridTab.SelectedItem as TabItem).Tag.ToString();

            c.SearchCondition = new SearchCondition
            {
                DatabasePrefix    = SearchCondition.DatabasePrefix,
                BeginTime         = SearchCondition.BeginTime,
                EndTime           = SearchCondition.EndTime,
                Filters           = SearchCondition.Filters,
                TableNames        = SearchCondition.TableNames,
                SelectedTableName = tableName,
            };
            c.Width  = root.ActualWidth * 0.98;
            c.Height = root.ActualHeight * 0.98;
            c.HorizontalAlignment = HorizontalAlignment.Center;
            c.VerticalAlignment   = VerticalAlignment.Center;
            c.Show();
            service.LogAsync(new OperationLog
            {
                AccountName     = Data.AdminConfigurationItem.UserName,
                AccountRealName = Data.AdminConfigurationItem.RealName,
                CategoryName    = SearchCondition.DatabasePrefix.Substring(0, SearchCondition.DatabasePrefix.IndexOf("__")),
                DatabaseName    = SearchCondition.DatabasePrefix.Substring(SearchCondition.DatabasePrefix.IndexOf("__") + 2),
                TableName       = tableName,
                Action          = "查看统计视图",
                ActionMemo      = string.Format("开始时间:{0} 结束时间:{1} 过滤条件:{2}",
                                                SearchCondition.BeginTime,
                                                SearchCondition.EndTime,
                                                SearchCondition.Filters)
            });
        }
示例#2
0
 private void Stat_Click(object sender, RoutedEventArgs e)
 {
     if (SearchCondition.TableNames.Count > 10)
     {
         MessageBox.Show("����������ͳ�Ʒ�ʽ�������ֻ��ѡ��10����");
         return;
     }
     this.Close();
     ViewStatData c = new ViewStatData();
     var root = Application.Current.RootVisual as FrameworkElement;
     var tableName = (ListGridTab.SelectedItem as TabItem).Tag.ToString();
     c.SearchCondition = new SearchCondition
     {
         DatabasePrefix = SearchCondition.DatabasePrefix,
         BeginTime = SearchCondition.BeginTime,
         EndTime = SearchCondition.EndTime,
         Filters = SearchCondition.Filters,
         TableNames = SearchCondition.TableNames,
         SelectedTableName = tableName,
     };
     c.Width = root.ActualWidth * 0.98;
     c.Height = root.ActualHeight * 0.98;
     c.HorizontalAlignment = HorizontalAlignment.Center;
     c.VerticalAlignment = VerticalAlignment.Center;
     c.Show();
     service.LogAsync(new OperationLog
     {
         AccountName = Data.AdminConfigurationItem.UserName,
         AccountRealName = Data.AdminConfigurationItem.RealName,
         CategoryName = SearchCondition.DatabasePrefix.Substring(0, SearchCondition.DatabasePrefix.IndexOf("__")),
         DatabaseName = SearchCondition.DatabasePrefix.Substring(SearchCondition.DatabasePrefix.IndexOf("__") + 2),
         TableName = tableName,
         Action = "�鿴ͳ����ͼ",
         ActionMemo = string.Format("��ʼʱ�䣺{0} ����ʱ�䣺{1} ����������{2}",
           SearchCondition.BeginTime,
           SearchCondition.EndTime,
           SearchCondition.Filters)
     });
 }
示例#3
0
 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())
         });
     }
 }
示例#4
0
        private void Stat_Click(object sender, RoutedEventArgs e)
        {
            if (SearchCondition.TableNames.Count > 10)
            {
                MessageBox.Show("对于数据量统计方式呈现最多只能选择10个表");
                return;
            }
            var count = 0;
            var tab = ListChartTab.SelectedItem as TabItem;
            if (tab != null)
            {
                var scroll = tab.Content as ScrollViewer;
                if (scroll != null)
                {
                    var grid = scroll.Content as Grid;
                    if (grid != null)
                    {
                        grid.Children.OfType<Chart>().ToList().ForEach(chart =>
                        {
                            var pieSeries = chart.Series.OfType<PieSeries>().FirstOrDefault();
                            if (pieSeries != null)
                            {
                                if (pieSeries.SelectedItem != null)
                                {
                                    count++;
                                }
                            }
                        });
                    }
                }
            }
            if (count == 1)
            {
                if (!SearchCondition.Filters.ContainsKey(chartkey))
                {
                    SearchCondition.Filters.Add(chartkey, chartvalue);
                }
                else
                {
                    SearchCondition.Filters.Remove(chartkey);
                    SearchCondition.Filters.Add(chartkey, chartvalue);
                }
                ViewStatData c = new ViewStatData();
                var root = Application.Current.RootVisual as FrameworkElement;
                var tableName = (ListChartTab.SelectedItem as TabItem).Tag.ToString();

                c.SearchCondition = new SearchCondition
                {
                    DatabasePrefix = SearchCondition.DatabasePrefix,
                    TableNames = new List<string> { tableName },
                    Filters = SearchCondition.Filters,
                    BeginTime = SearchCondition.BeginTime,
                    EndTime = SearchCondition.EndTime,
                };
                c.Width = root.ActualWidth * 0.98;
                c.Height = root.ActualHeight * 0.98;
                c.HorizontalAlignment = HorizontalAlignment.Center;
                c.VerticalAlignment = VerticalAlignment.Center;
                c.Show();
                service.LogAsync(new OperationLog
                {
                    AccountName = Data.AdminConfigurationItem.UserName,
                    AccountRealName = Data.AdminConfigurationItem.RealName,
                    CategoryName = SearchCondition.DatabasePrefix.Substring(0, SearchCondition.DatabasePrefix.IndexOf("__")),
                    DatabaseName = SearchCondition.DatabasePrefix.Substring(SearchCondition.DatabasePrefix.IndexOf("__") + 2),
                    TableName = ListChartTab.SelectedItem.ToString(),
                    Action = "查看统计视图",
                    ActionMemo = string.Format("开始时间:{0} 结束时间:{1} 过滤条件:{2}",
                      SearchCondition.BeginTime,
                      SearchCondition.EndTime,
                      SearchCondition.Filters.GetFilterText())
                });
            }


            if (count == 0)
            {
                this.Close();
                ViewStatData c = new ViewStatData();
                var root = Application.Current.RootVisual as FrameworkElement;
                var tableName = (ListChartTab.SelectedItem as TabItem).Tag.ToString();
                c.SearchCondition = new SearchCondition
                {
                    DatabasePrefix = SearchCondition.DatabasePrefix,
                    BeginTime = SearchCondition.BeginTime,
                    EndTime = SearchCondition.EndTime,
                    Filters = SearchCondition.Filters,
                    TableNames = SearchCondition.TableNames,
                    SelectedTableName = tableName,
                };
                c.Width = root.ActualWidth * 0.98;
                c.Height = root.ActualHeight * 0.98;
                c.HorizontalAlignment = HorizontalAlignment.Center;
                c.VerticalAlignment = VerticalAlignment.Center;
                c.Show();
                service.LogAsync(new OperationLog
                {
                    AccountName = Data.AdminConfigurationItem.UserName,
                    AccountRealName = Data.AdminConfigurationItem.RealName,
                    CategoryName = SearchCondition.DatabasePrefix.Substring(0, SearchCondition.DatabasePrefix.IndexOf("__")),
                    DatabaseName = SearchCondition.DatabasePrefix.Substring(SearchCondition.DatabasePrefix.IndexOf("__") + 2),
                    TableName = tableName,
                    Action = "查看统计视图",
                    ActionMemo = string.Format("开始时间:{0} 结束时间:{1} 过滤条件:{2}",
                      SearchCondition.BeginTime,
                      SearchCondition.EndTime,
                      SearchCondition.Filters)
                });
            }
        }
示例#5
0
        private void Stat_Click(object sender, RoutedEventArgs e)
        {
            if (SearchCondition.TableNames.Count > 10)
            {
                MessageBox.Show("对于数据量统计方式呈现最多只能选择10个表");
                return;
            }
            var count = 0;
            var tab   = ListChartTab.SelectedItem as TabItem;

            if (tab != null)
            {
                var scroll = tab.Content as ScrollViewer;
                if (scroll != null)
                {
                    var grid = scroll.Content as Grid;
                    if (grid != null)
                    {
                        grid.Children.OfType <Chart>().ToList().ForEach(chart =>
                        {
                            var pieSeries = chart.Series.OfType <PieSeries>().FirstOrDefault();
                            if (pieSeries != null)
                            {
                                if (pieSeries.SelectedItem != null)
                                {
                                    count++;
                                }
                            }
                        });
                    }
                }
            }
            if (count == 1)
            {
                if (!SearchCondition.Filters.ContainsKey(chartkey))
                {
                    SearchCondition.Filters.Add(chartkey, chartvalue);
                }
                else
                {
                    SearchCondition.Filters.Remove(chartkey);
                    SearchCondition.Filters.Add(chartkey, chartvalue);
                }
                ViewStatData c         = new ViewStatData();
                var          root      = Application.Current.RootVisual as FrameworkElement;
                var          tableName = (ListChartTab.SelectedItem as TabItem).Tag.ToString();

                c.SearchCondition = new SearchCondition
                {
                    DatabasePrefix = SearchCondition.DatabasePrefix,
                    TableNames     = new List <string> {
                        tableName
                    },
                    Filters   = SearchCondition.Filters,
                    BeginTime = SearchCondition.BeginTime,
                    EndTime   = SearchCondition.EndTime,
                };
                c.Width  = root.ActualWidth * 0.98;
                c.Height = root.ActualHeight * 0.98;
                c.HorizontalAlignment = HorizontalAlignment.Center;
                c.VerticalAlignment   = VerticalAlignment.Center;
                c.Show();
                service.LogAsync(new OperationLog
                {
                    AccountName     = Data.AdminConfigurationItem.UserName,
                    AccountRealName = Data.AdminConfigurationItem.RealName,
                    CategoryName    = SearchCondition.DatabasePrefix.Substring(0, SearchCondition.DatabasePrefix.IndexOf("__")),
                    DatabaseName    = SearchCondition.DatabasePrefix.Substring(SearchCondition.DatabasePrefix.IndexOf("__") + 2),
                    TableName       = ListChartTab.SelectedItem.ToString(),
                    Action          = "查看统计视图",
                    ActionMemo      = string.Format("开始时间:{0} 结束时间:{1} 过滤条件:{2}",
                                                    SearchCondition.BeginTime,
                                                    SearchCondition.EndTime,
                                                    SearchCondition.Filters.GetFilterText())
                });
            }


            if (count == 0)
            {
                this.Close();
                ViewStatData c         = new ViewStatData();
                var          root      = Application.Current.RootVisual as FrameworkElement;
                var          tableName = (ListChartTab.SelectedItem as TabItem).Tag.ToString();
                c.SearchCondition = new SearchCondition
                {
                    DatabasePrefix    = SearchCondition.DatabasePrefix,
                    BeginTime         = SearchCondition.BeginTime,
                    EndTime           = SearchCondition.EndTime,
                    Filters           = SearchCondition.Filters,
                    TableNames        = SearchCondition.TableNames,
                    SelectedTableName = tableName,
                };
                c.Width  = root.ActualWidth * 0.98;
                c.Height = root.ActualHeight * 0.98;
                c.HorizontalAlignment = HorizontalAlignment.Center;
                c.VerticalAlignment   = VerticalAlignment.Center;
                c.Show();
                service.LogAsync(new OperationLog
                {
                    AccountName     = Data.AdminConfigurationItem.UserName,
                    AccountRealName = Data.AdminConfigurationItem.RealName,
                    CategoryName    = SearchCondition.DatabasePrefix.Substring(0, SearchCondition.DatabasePrefix.IndexOf("__")),
                    DatabaseName    = SearchCondition.DatabasePrefix.Substring(SearchCondition.DatabasePrefix.IndexOf("__") + 2),
                    TableName       = tableName,
                    Action          = "查看统计视图",
                    ActionMemo      = string.Format("开始时间:{0} 结束时间:{1} 过滤条件:{2}",
                                                    SearchCondition.BeginTime,
                                                    SearchCondition.EndTime,
                                                    SearchCondition.Filters)
                });
            }
        }