示例#1
0
        private void Ani_Valid_gotFoc(object sender, RoutedEventArgs e) //验证处理器... 恢复输入逻辑
        {
            if (sender is TextBox)                                      //存在问题...
            {
                Ani_eqFault.BeginAnimation(SolidColorBrush.ColorProperty, null);
                Re_eqfault.GotFocus -= Ani_Valid_gotFoc;
            }

            if (sender is ComboBox)
            {
                ComboBox cbx = (ComboBox)sender;
                switch ((string)cbx.Tag)
                {
                case "Zn":
                    Ani_zn.BeginAnimation(SolidColorBrush.ColorProperty, null);
                    Re_zn.GotFocus -= Ani_Valid_gotFoc;
                    break;

                case "eqName":
                    Ani_eqName.BeginAnimation(SolidColorBrush.ColorProperty, null);
                    Re_eq.GotFocus -= Ani_Valid_gotFoc;
                    break;
                }
            }
        }
示例#2
0
        private void Record_Click(object sender, RoutedEventArgs e) //录入处理 按键事件
        {
            if (Rec_info.站名 == "" || Rec_info.站名 == null)
            {
                Valid_Ani va = new Valid_Ani();
                Ani_zn.BeginAnimation(SolidColorBrush.ColorProperty, va.color_Ani);
                Re_zn.GotFocus += Ani_Valid_gotFoc;
                return;
            }

            if (Rec_info.设备名称 == null || Rec_info.设备名称 == string.Empty)
            {
                Valid_Ani vd = new Valid_Ani();
                Ani_eqName.BeginAnimation(SolidColorBrush.ColorProperty, vd.color_Ani);
                Re_eq.GotFocus += Ani_Valid_gotFoc;
                return;
            }
            if (Rec_info.存在问题 == null || Rec_info.存在问题 == string.Empty)
            {
                Valid_Ani vc = new Valid_Ani();
                Ani_eqFault.BeginAnimation(SolidColorBrush.ColorProperty, vc.color_Ani);
                Re_eqfault.GotFocus += Ani_Valid_gotFoc;
                return;
            }
            if (Rec_info.发现时间 == null)
            {
                Valid_Ani vb = new Valid_Ani();
                dptx.Background.BeginAnimation(SolidColorBrush.ColorProperty, vb.color_Ani);
                dptx.GotFocus += PART_TextBox_GotFocus;
                return;
            }
            if (eq_name_count > 0 && Rec_info.销记 == false) //更新
            {
                wt_update();
            }
            else
            {
                wt_insert_new();
            }

            //GridUpdate("wt");
            AllWT = myFuc.LoadWts();
            mainGrid.ItemsSource = AllWT;

            init_zhname.ItemsSource = (from g in AllWT select g.站名).Distinct();
            init_unit.ItemsSource   = (from f in AllWT select f.受理单位).Distinct();
            Re_zn.ItemsSource       = (from g in AllWT select g.站名).Distinct();
            //插入或更新后, 全局记录器 重置!
            g_wt_info_rec.Re_reset(Rec_info.站名);
            Rec_info = g_wt_info_rec.getWtRec();

            Re_rows.DataContext = null;
            Re_rows.DataContext = Rec_info;

            edit_tips.Content    = "存在问题";
            edit_tips.Foreground = new SolidColorBrush(Colors.Black);
        }