lixiaojun
2024-10-26 dd4da9a651330fabe210618581299ac3536bda2f
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
60
namespace Yw.WinFrmUI
{
    public partial class SetHydroNozzleCalcuPrefixCtrl : DevExpress.XtraEditors.XtraUserControl
    {
        public SetHydroNozzleCalcuPrefixCtrl()
        {
            InitializeComponent();
            this.layoutControl1.SetupLayoutControl();
        }
 
        /// <summary>
        /// 查看事件
        /// </summary>
        public event Action<Yw.Model.HydroNozzleInfo> ViewParterEvent;
 
        //喷嘴
        private Yw.Model.HydroNozzleInfo _nozzle = null;
 
        /// <summary>
        /// 
        /// </summary>
        public void SetBindingData(Yw.Model.HydroNozzleInfo nozzle)
        {
            _nozzle = nozzle;
            if (_nozzle == null)
            {
                return;
            }
            this.layoutGroupCaption.Text = "喷嘴";
            if (!string.IsNullOrEmpty(_nozzle.Name))
            {
                this.layoutGroupCaption.Text = _nozzle.Name;
            }
            this.txtCoefficient.EditValue = _nozzle.Coefficient;
        }
 
        /// <summary>
        /// 更新绑定数据
        /// </summary>
        public void UpdateBindingData()
        {
            if (_nozzle == null)
            {
                return;
            }
            _nozzle.Coefficient = double.Parse(this.txtCoefficient.EditValue?.ToString());
        }
 
        //查看
        private void layoutGroupCaption_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e)
        {
            if (_nozzle == null)
            {
                return;
            }
            this.ViewParterEvent?.Invoke(_nozzle);
        }
 
    }
}