258f90d040ca32391a68531e5ec088aa6ed49be1.svn-base 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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.Windows.Forms;
  9. using CoreFS.CA06;
  10. using System.Collections;
  11. using Infragistics.Win.UltraWinGrid;
  12. using System.Diagnostics;
  13. namespace Core.LZMes.Client.QCM
  14. {
  15. public partial class QCM030806 : FrmBase
  16. {
  17. public QCM030806()
  18. {
  19. InitializeComponent();
  20. }
  21. public override void ToolBar_Click(object sender, string ToolbarKey)
  22. {
  23. switch (ToolbarKey)
  24. {
  25. case"Query":
  26. this.DoQuery();
  27. break;
  28. case "Affirm":
  29. this.affirm();
  30. break;
  31. case "Export":
  32. this.DoExport();
  33. break;
  34. }
  35. }
  36. private void affirm()
  37. {
  38. try
  39. {
  40. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  41. if (ugr == null)
  42. return;
  43. string heat_no = ugr.Cells["HEAT_NO"].Value.ToString();
  44. string assay_no = ugr.Cells["ASSAY_NO"].Value.ToString();
  45. string pline_code = ugr.Cells["pline_code"].Value.ToString();
  46. ArrayList list1 = new ArrayList();
  47. list1.Add(heat_no);
  48. list1.Add(assay_no);
  49. list1.Add(pline_code);
  50. list1.Add(this.UserInfo.GetUserName());
  51. CoreClientParam ccp = new CoreClientParam();
  52. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  53. ccp.MethodName = "UpdateChemeInfo";
  54. ccp.ServerParams = new object[] { list1 };
  55. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  56. if (ccp.ReturnCode == -1)
  57. {
  58. return;
  59. }
  60. DoQuery();
  61. MessageBox.Show("修改成功!");
  62. }
  63. catch(Exception EX)
  64. {
  65. MessageBox.Show(EX.ToString());
  66. }
  67. }
  68. private void DoQuery()
  69. {
  70. DoQueryMe();
  71. }
  72. //查询待判信息
  73. private void DoQueryMe()
  74. {
  75. try
  76. {
  77. this.dataSet3.Clear();
  78. string heatno = this.textBox1.Text.Trim();
  79. CoreClientParam ccp = new CoreClientParam();
  80. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  81. ccp.MethodName = "GetElement";
  82. ccp.SourceDataTable = this.dataSet3.Tables[0];
  83. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), heatno};
  84. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  85. }
  86. catch (Exception ex)
  87. {
  88. System.Diagnostics.Debug.WriteLine(ex.ToString());
  89. MessageBox.Show("系统出错,请联系管理人员", "警告");
  90. }
  91. }
  92. private void QCM030803_Load(object sender, EventArgs e)
  93. {
  94. this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  95. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3);
  96. }
  97. private void DoExport()
  98. {
  99. try
  100. {
  101. if (this.ultraGrid2.Rows.Count == 0)
  102. {
  103. MessageBox.Show("没有可以导出的数据", "提示");
  104. return;
  105. }
  106. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  107. {
  108. string fName = this.saveFileDialog1.FileName;
  109. this.ultraGridExcelExporter1.Export(this.ultraGrid2, fName);
  110. Process.Start(fName);
  111. }
  112. }
  113. catch (Exception ex)
  114. {
  115. System.Diagnostics.Debug.WriteLine(ex.ToString());
  116. }
  117. }
  118. }
  119. }