lixiaojun
2024-10-23 549b9ad0a143b6fbd86ce02ddfa470b5556126e7
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
61
namespace Yw.WinFrmUI
{
    public partial class SetHydroWaterboxCalcuPrefixCtrl : DevExpress.XtraEditors.XtraUserControl
    {
        public SetHydroWaterboxCalcuPrefixCtrl()
        {
            InitializeComponent();
            this.layoutControl1.SetupLayoutControl();
        }
 
        /// <summary>
        /// 查看事件
        /// </summary>
        public event Action<Yw.Model.HydroWaterboxInfo> ViewEvent;
 
        //水箱
        private Yw.Model.HydroWaterboxInfo _waterbox = null;
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        public void SetBindingData(Yw.Model.HydroWaterboxInfo waterbox)
        {
            _waterbox = waterbox;
            if (_waterbox == null)
            {
                return;
            }
            this.layoutGroupCaption.Text = "水箱";
            if (!string.IsNullOrEmpty(_waterbox.Name))
            {
                this.layoutGroupCaption.Text = _waterbox.Name;
            }
            this.txtInitLevel.EditValue = _waterbox.InitLevel;
        }
 
        /// <summary>
        /// 更新绑定数据
        /// </summary>
        public void UpdateBindingData()
        {
            if (_waterbox == null)
            {
                return;
            }
            _waterbox.InitLevel = double.Parse(this.txtInitLevel.EditValue.ToString());
        }
 
        //查看部件
        private void layoutGroupCaption_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e)
        {
            if (_waterbox == null)
            {
                return;
            }
            this.ViewEvent?.Invoke(_waterbox);
        }
 
 
    }
}