duheng
2024-09-06 caf0bf69009cdaee31f2e1cfdac647077aff340d
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
using DevExpress.XtraEditors.Controls;
 
namespace HStation.WinFrmUI.Xhs
{
    public partial class PumpMainCurveForm : DevExpress.XtraEditors.XtraUserControl
    {
        public PumpMainCurveForm()
        {
            InitializeComponent();
        }
 
        public event Action<long> SelectEventReload = null;
 
        private readonly Lazy<BLL.XhsPumpMainPhartMappingExtensions> _bll_ex = new();
 
        public void SetBindingData(Vmo.PumpMain pumpMain)
        {
            this.TextEditErosion.Text = pumpMain.Erosion.ToString();
            this.TextEditName.Text = pumpMain.Name;
            this.TextEditRatedFlow.Text = pumpMain.RatedFlow.ToString();
            this.TextEditD2.Text = pumpMain.D2.ToString();
            this.TextEditDescription.Text = pumpMain.Description;
            this.TextEditRatedSpeed.Text = pumpMain.RatedSpeed.ToString();
            this.TextEditRatedPower.Text = pumpMain.RatedPower.ToString();
            CurveComoboxSetBindingData(pumpMain.ID);
        }
 
        private async void CurveComoboxSetBindingData(long pump_main_id)
        {
            comboBoxPumpCurve.Properties.Items.Clear();
            var list = await _bll_ex.Value.GetByPumpMainID(pump_main_id);
            if (list != null && list.Any())
            {
                foreach (var item in list)
                {
                    var image = new ImageComboBoxItem();
                    image.Value = item.ID;
                    image.Description = item.OtherName;
                    comboBoxPumpCurve.Properties.Items.Add(image);
                }
            }
        }
 
        //曲线选择变化
        private void comboBoxPumpCurve_SelectedIndexChanged(object sender, EventArgs e)
        {
            SelectEventReload.Invoke(Convert.ToInt64(comboBoxPumpCurve.EditValue));
        }
    }
}