Esempio n. 1
0
        private void BtnSeek_Click(object sender, RoutedEventArgs e) //查询按钮处理
        {
            // Wait wait = new Wait();

            ObservableCollection <ParaListory> paraResultList = new ObservableCollection <ParaListory>();
            /* ((this.FindName("DATA_GRIDpp")) as DataGrid)*/

            MainHandle handle = new MainHandle();
            DateTime   t1     = this.SelectedStartTime.SelectDateTime;
            DateTime   t2     = this.SelectedStopTime.SelectDateTime;


            TextBlock textBlock  = DataGridHelper.GetVisualChild <TextBlock>(dataGrid, v => v.Name == "tb_ParaCode");
            string    tbParaCode = textBlock.Text;

            if (null != textBlock)
            {
                //   MessageBox.Show(textBlock.Text);
            }
            paraResultList = handle.Handle(t1, t2, tbParaCode);

            //  wait.ShowDialog();
            if (paraResultList.Count > 0)
            {
                DisplayValues.ItemsSource = paraResultList;  //显示查询结果
            }
            else
            {
                MessageBox.Show("查询不到数据...");
            }
        }
        public void GetTelemetryData() //for 遥测数据 page显示
        {
            ObservableCollection <ParaListory> paraResultList = new ObservableCollection <ParaListory>();
            /* ((this.FindName("DATA_GRIDpp")) as DataGrid)*/

            MainHandle handle = new MainHandle();

            // MainWindow2 parentWindow = new MainWindow2();

            // string ParaCode = ParentWindow.tBPara.Text;
            string   ParaCode = ParentWindow.ComboxPara.Text.Split('-')[0];
            DateTime t1       = ParentWindow.SelectedStartTime.SelectDateTime;
            DateTime t2       = this.parentWindow.SelectedStopTime.SelectDateTime;

            paraResultList = handle.Handle(t1, t2, ParaCode);
            if (paraResultList.Count > 0)
            {
                DisplayValues.ItemsSource = paraResultList;  //显示查询结果
            }
            else
            {
                MessageBox.Show("查询不到数据...");
            }
        }