duheng
2024-03-27 dc97e187c607119bbd2945b9a277db8da15f8dc0
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
using DevExpress.XtraEditors;
using System;
using System.Windows.Forms;
 
namespace IStation.WinFrmUI.Basic
{
    public partial class QueryQDlg : XtraForm
    {
        public QueryQDlg()
        {
            InitializeComponent();
            this.IconOptions.Icon = WinFrmUI.Properties.Resources.App;
            this.dataLayoutControl1.SetupLayoutControl();
        }
 
 
 
        /// <summary>
        /// 流量点
        /// </summary>
        public double Q { get; set; }
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        public void SetBindingData(string name)
        {
            this.txtQ.EditValue = name;
        }
 
        //验证
        private bool Valid()
        {
            this.dxErrorProvider1.ClearErrors();
            if (string.IsNullOrEmpty(this.txtQ.Text.Trim()))
            {
                this.dxErrorProvider1.SetError(this.txtQ, "必填项");
                return false;
            }
            return true;
        }
 
        //确定
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!Valid())
                return;
            this.Q = double.Parse(this.txtQ.Text);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
 
    }
}