duheng
2024-12-20 3d69e0e8d953690b588c8a868bcf090f6119186b
WinFrmUI/HStation.WinFrmUI.Assets.Core/01-pump/07-PumpChart/01-import/01-excel/ImportPumpPerform2dByExcelDlg.cs
@@ -82,5 +82,31 @@
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        private void btnExcelFilePath_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (e.Button.Tag.ToString() == "Import")
            {
                var dlg = new System.Windows.Forms.OpenFileDialog();
                dlg.Filter = "EXCEL 文件(*.xls)|*.xls";
                dlg.CheckFileExists = true;
                if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK)
                    return;
                this.btnExcelFilePath.Text = dlg.FileName;
                this.pumpChartExcelImportCtrl1.SetBindingData(btnExcelFilePath.Text);
            }
            else if (e.Button.Tag.ToString() == "Download")
            {
                var dlg = new SaveFileDialog();
                dlg.Title = "模板导出路径";
                dlg.Filter = "Excel文件|*.xls";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    var fileName = dlg.FileName;
                    Yw.WinFrmUI.PhartExcelHelper.ExportPumpTemplate(fileName);
                    TipFormHelper.ShowSucceed("导出成功!");
                }
            }
        }
    }
}