duheng
2024-08-01 df724e202d16eda69bf8a67c683e2b70ccaca4f7
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
using DevExpress.XtraEditors;
using System.Windows.Forms;
 
namespace Yw.WinFrmUI.Phart.Cubic
{
    public partial class ImportCurveByExcelDlg : XtraForm
    {
        public ImportCurveByExcelDlg()
        {
            InitializeComponent();
        }
 
        /// <summary>
        /// 回调事件
        /// </summary>
        public event Func<string,Yw.Pump.CurveQH, Yw.Pump.CurveQE, Yw.Pump.CurveQP, Task<bool>> ReloadDataEvent;
 
        //确定
        private async void btnOk_Click(object sender, EventArgs e)
        {
            var bol = this.importCurveByExcelCtrl1.Get(out string other_name, out Yw.Pump.CurveQH qh, out Yw.Pump.CurveQE qe, out Yw.Pump.CurveQP qp);
            if (!bol)
            {
                return;
            }
 
            var result = await this.ReloadDataEvent?.Invoke(other_name, qh, qe, qp);
            if (!result)
            {
                XtraMessageBox.Show("导入失败!");
                return;
            }
            XtraMessageBox.Show("导入成功!");
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
 
    }
}