Example #1
0
        private void List_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
            ViewListData c    = new ViewListData();
            var          root = Application.Current.RootVisual as FrameworkElement;

            c.SearchCondition = new SearchCondition
            {
                DatabasePrefix = SearchCondition.DatabasePrefix,
                BeginTime      = SearchCondition.BeginTime,
                EndTime        = SearchCondition.EndTime,
                Filters        = SearchCondition.Filters,
                TableNames     = SearchCondition.TableNames,
            };
            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),
                Action          = "查看列表视图",
                ActionMemo      = string.Format("开始时间:{0} 结束时间:{1} 过滤条件:{2}",
                                                SearchCondition.BeginTime,
                                                SearchCondition.EndTime,
                                                SearchCondition.Filters)
            });
        }
Example #2
0
        /// <summary>
        /// 点击了点
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ls_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var ls = sender as LineSeries;

            if (ls != null)
            {
                var si = ls.SelectedItem as StatisticsItem;
                if (si != null)
                {
                    //弹出列表视图
                    ViewListData c    = new ViewListData();
                    var          root = Application.Current.RootVisual as FrameworkElement;
                    c.SearchCondition = new SearchCondition
                    {
                        DatabasePrefix = SearchCondition.DatabasePrefix,
                        TableNames     = new List <string> {
                            ls.Tag.ToString()
                        },
                        Filters   = SearchCondition.Filters,
                        BeginTime = si.BeginTime,
                        EndTime   = si.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       = ls.Tag.ToString(),
                        Action          = "查看列表视图",
                        ActionMemo      = string.Format("开始时间:{0} 结束时间:{1} 过滤条件:{2}",
                                                        si.BeginTime,
                                                        si.EndTime,
                                                        SearchCondition.Filters.GetFilterText())
                    });
                }
            }
            ls.SelectedItem = null;
        }
Example #3
0
        private void List_Click(object sender, RoutedEventArgs e)
        {
            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)
            {
                //弹出列表视图
                ViewListData c = new ViewListData();
                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();
                ViewListData c = new ViewListData();
                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)
                });
            }
        }
Example #4
0
 private void SearchListOnlyByContextId_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(ContextId.Text))
     {
         MessageBox.Show("请填写ID");
         ContextId.Focus();
         return;
     }
     var root = Application.Current.RootVisual as FrameworkElement;
     ViewListData c = new ViewListData();
     //参数传递
     c.SearchCondition = new SearchCondition
     {
         ContextId = ContextId.Text,
     };
     //设置子窗口的宽度和长度
     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 = "",
         DatabaseName = "",
         TableName = "",
         Action = "根据上下文ID查看",
         ActionMemo = string.Format("ID:{0}", ContextId.Text),
     });
 }
Example #5
0
 private void ShowListView(SearchCondition sc, string categoryName, string databaseName)
 {
     var root = Application.Current.RootVisual as FrameworkElement;
     ViewListData c = new ViewListData();
     //参数传递
     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())
         });
     }
 }
Example #6
0
 private void List_Click(object sender, RoutedEventArgs e)
 {
     this.Close();
     ViewListData c = new ViewListData();
     var root = Application.Current.RootVisual as FrameworkElement;
     c.SearchCondition = new SearchCondition
     {
         DatabasePrefix = SearchCondition.DatabasePrefix,
         BeginTime = SearchCondition.BeginTime,
         EndTime = SearchCondition.EndTime,
         Filters = SearchCondition.Filters,
         TableNames = SearchCondition.TableNames,
     };
     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),
         Action = "查看列表视图",
         ActionMemo = string.Format("开始时间:{0} 结束时间:{1} 过滤条件:{2}",
           SearchCondition.BeginTime,
           SearchCondition.EndTime,
           SearchCondition.Filters)
     });
 }
Example #7
0
        /// <summary>
        /// 点击了点
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ls_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var ls = sender as LineSeries;
            if (ls != null)
            {
                var si = ls.SelectedItem as StatisticsItem;
                if (si != null)
                {
                    //弹出列表视图
                    ViewListData c = new ViewListData();
                    var root = Application.Current.RootVisual as FrameworkElement;
                    c.SearchCondition = new SearchCondition
                    {
                        DatabasePrefix = SearchCondition.DatabasePrefix,
                        TableNames = new List<string> { ls.Tag.ToString() },
                        Filters = SearchCondition.Filters,
                        BeginTime = si.BeginTime,
                        EndTime = si.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 = ls.Tag.ToString(),
                        Action = "查看列表视图",
                        ActionMemo = string.Format("开始时间:{0} 结束时间:{1} 过滤条件:{2}",
                          si.BeginTime,
                          si.EndTime,
                          SearchCondition.Filters.GetFilterText())
                    });
                }
            }
            ls.SelectedItem = null;
        }
Example #8
0
        private void List_Click(object sender, RoutedEventArgs e)
        {
            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)
            {
                //弹出列表视图
                ViewListData c         = new ViewListData();
                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();
                ViewListData c         = new ViewListData();
                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)
                });
            }
        }