DownloadDemoFrom.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Linq;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using DevExpress.XtraEditors;
  11. namespace Uninpho.Tools.components.SomethingSetting
  12. {
  13. public partial class DownloadDemoFrom : DevExpress.XtraEditors.XtraForm
  14. {
  15. public DownloadDemoFrom()
  16. {
  17. InitializeComponent();
  18. }
  19. private void comboBoxEdit1_SelectedIndexChanged(object sender, EventArgs e)
  20. {
  21. }
  22. private void simpleButton1_Click(object sender, EventArgs e)
  23. {
  24. SaveFileDialog ofd = new SaveFileDialog();
  25. ofd.FileName = comboBoxEdit1.Text;
  26. ofd.Title = "请选择保存位置";
  27. ofd.Filter = "Excel文件(*.xls)|*.xls|All files(*.*)|*.*";
  28. if (ofd.ShowDialog() == DialogResult.OK)
  29. {
  30. string saveurl = ofd.FileName;
  31. switch (comboBoxEdit1.Text)
  32. {
  33. case "曲线台账模板":
  34. DataAnalysis.DACommon.FileCopy(Application.StartupPath + "//demoF//曲线台账.xls",saveurl);
  35. break;
  36. case "道岔台账模板":
  37. DataAnalysis.DACommon.FileCopy(Application.StartupPath + "//demoF//道岔台账.xls", saveurl);
  38. break;
  39. case "管界台账模板":
  40. DataAnalysis.DACommon.FileCopy(Application.StartupPath + "//demoF//管界台账.xls", saveurl);
  41. break;
  42. default:
  43. break;
  44. }
  45. XtraMessageBox.Show("下载完成!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  46. }
  47. }
  48. }
  49. }