Shuxia Ning
2024-08-12 d81b5157ae73e05f62e82d245c19a7063a4a1d20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using DevExpress.XtraEditors;
using System;
using System.Windows.Forms;
 
namespace Yw.WinFrmUI.Phart
{
    /// <summary>
    /// 设置排序码
    /// </summary>
    public partial class PickEqupPointDlg : XtraForm
    {
        public PickEqupPointDlg()
        {
            InitializeComponent();
        }
 
        /// <summary>
        /// 回调事件
        /// </summary>
        public event Func<double, bool> ReloadDataEvent;
 
 
        //验证
        private bool Valid()
        {
            this.dxErrorProvider1.ClearErrors();
            if (string.IsNullOrEmpty(this.txtEta.Text.Trim()))
            {
                this.dxErrorProvider1.SetError(this.txtEta, "必填项");
                return false;
            }
            return true;
        }
 
        //确定
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!Valid())
                return;
            this.ReloadDataEvent.Invoke(double.Parse(this.txtEta.Text));
            /*if (this.ReloadDataEvent != null)
            {
                var result = this.ReloadDataEvent.Invoke(int.Parse(this.txEta.Text));
                if (result)
                {
                    XtraMessageBox.Show("设置成功!");
                }
                else
                {
                    XtraMessageBox.Show("设置失败!");
                    return;
                }
            }*/
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
 
    }
}