using DevExpress.XtraEditors;
namespace HStation.WinFrmUI
{
public partial class ImportExchangerPerform2dByExcelDlg : XtraForm
{
public ImportExchangerPerform2dByExcelDlg()
{
InitializeComponent();
}
///
/// 回调事件
///
public event Func> ReloadDataEvent;
public void SetBindingData(string x, string y)
{
this.importCurveByExcelCtrl1.SetBindingData(x, y);
}
//确定
private async void btnOk_Click(object sender, EventArgs e)
{
var bol = this.importCurveByExcelCtrl1.Get(out List pt_list);
if (!bol)
{
return;
}
var json = Yw.JsonHelper.Object2Json(pt_list);
var result = await this.ReloadDataEvent?.Invoke(json);
if (!result)
{
XtraMessageBox.Show("导入失败!");
return;
}
XtraMessageBox.Show("导入成功!");
this.DialogResult = DialogResult.OK;
this.Close();
}
}
}