lixiaojun
2024-10-18 217756094e1f22763edf2b18d3723403786c82fc
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
namespace Yw.WinFrmUI
{
    public partial class SetNozzleCalcuPrefixCtrl : DevExpress.XtraEditors.XtraUserControl
    {
        public SetNozzleCalcuPrefixCtrl()
        {
            InitializeComponent();
            this.layoutControl1.SetupLayoutControl();
        }
 
        private Yw.Model.HydroNozzleInfo _nozzle = null;
 
        /// <summary>
        /// 
        /// </summary>
        public void SetBindingData(Yw.Model.HydroNozzleInfo nozzle)
        {
            this.layoutGroupCaption.Text = "喷嘴";
            if (!string.IsNullOrEmpty(nozzle.Name))
            {
                this.layoutGroupCaption.Text = nozzle.Name;
            }
            this.txtElev.EditValue = nozzle.Elev;
            this.txtDemand.EditValue = nozzle.Demand;
            this.txtCoefficient.EditValue = nozzle.Coefficient;
            this.txtMinorLoss.EditValue = nozzle.MinorLoss;
        }
 
        /// <summary>
        /// 更新绑定数据
        /// </summary>
        public void UpdateBindingData()
        {
            if (_nozzle == null)
            {
                return;
            }
            _nozzle.Elev = double.Parse(this.txtElev.EditValue?.ToString());
            _nozzle.Demand = this.txtDemand.EditValue == null ? null : double.Parse(this.txtDemand.EditValue.ToString());
            _nozzle.Coefficient = double.Parse(this.txtCoefficient.EditValue?.ToString());
            _nozzle.MinorLoss = this.txtMinorLoss.EditValue == null ? null : double.Parse(this.txtMinorLoss.EditValue.ToString());
        }
 
 
    }
}