SpectrumExportConfirmation.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace OTSIncAReportApp._1_UI.Control_Grids
  11. {
  12. public partial class SpectrumExportConfirmation : Form
  13. {
  14. bool m_SpectrumConfirmation = false;
  15. bool m_SpectrumData = false;
  16. bool m_Picture = false;
  17. string m_savepath = "";
  18. public bool SpectrumConfirmation
  19. {
  20. get
  21. {
  22. return m_SpectrumConfirmation;
  23. }
  24. set
  25. {
  26. m_SpectrumConfirmation = value;
  27. }
  28. }
  29. public bool SpectrumData
  30. {
  31. get
  32. {
  33. return m_SpectrumData;
  34. }
  35. set
  36. {
  37. m_SpectrumData = value;
  38. }
  39. }
  40. public bool Picture
  41. {
  42. get
  43. {
  44. return m_Picture;
  45. }
  46. set
  47. {
  48. m_Picture = value;
  49. }
  50. }
  51. public string FileName
  52. {
  53. get
  54. {
  55. return m_savepath;
  56. }
  57. set
  58. {
  59. m_savepath = value;
  60. }
  61. }
  62. public SpectrumExportConfirmation()
  63. {
  64. InitializeComponent();
  65. }
  66. private void bt_Path_Click(object sender, EventArgs e)
  67. {
  68. //将所有的数据导出到EXCEL中
  69. SaveFileDialog sfd = new SaveFileDialog();
  70. sfd.Filter = "Excel File(*.xlsx)|*.xlsx";
  71. //设置默认文件类型显示顺序
  72. sfd.FilterIndex = 1;
  73. sfd.FileName = "ParticlesInfo";
  74. //保存对话框是否记忆上次打开的目录
  75. sfd.RestoreDirectory = true;
  76. if (sfd.ShowDialog() == DialogResult.OK)
  77. {
  78. tBox1.Text = sfd.FileName;
  79. }
  80. }
  81. private void cB_SpectrumConfirmation_CheckedChanged(object sender, EventArgs e)
  82. {
  83. if(cB_SpectrumConfirmation.Checked)
  84. {
  85. m_SpectrumConfirmation = true;
  86. }
  87. else
  88. {
  89. m_SpectrumConfirmation = false;
  90. }
  91. }
  92. private void bt_Export_Click(object sender, EventArgs e)
  93. {
  94. if(tBox1.Text == "")
  95. {
  96. MessageBox.Show("save path can not be null!");
  97. }
  98. else
  99. {
  100. m_savepath = tBox1.Text;
  101. this.DialogResult = DialogResult.OK;
  102. this.Close();
  103. }
  104. }
  105. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  106. {
  107. }
  108. private void cB_SpectrumData_CheckedChanged(object sender, EventArgs e)
  109. {
  110. if (cB_SpectrumData.Checked)
  111. {
  112. m_SpectrumData = true;
  113. }
  114. else
  115. {
  116. m_SpectrumData = false;
  117. }
  118. }
  119. private void cB_Picture_CheckedChanged(object sender, EventArgs e)
  120. {
  121. if (cB_Picture.Checked)
  122. {
  123. m_Picture = true;
  124. }
  125. else
  126. {
  127. m_Picture = false;
  128. }
  129. }
  130. }
  131. }