0892632f666feaf0d6a74e9950240f171e67e21c.svn-base 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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 System.Collections;
  10. using CoreFS.CA06;
  11. using Infragistics.Win.UltraWinGrid;
  12. using Infragistics.Win;
  13. using Newtonsoft.Json;
  14. using Newtonsoft.Json.Linq;
  15. namespace Core.LZMes.Client.QCM
  16. {
  17. public partial class QCM0208 : FrmBase
  18. {
  19. public QCM0208()
  20. {
  21. InitializeComponent();
  22. }
  23. private void QCM0208_Load(object sender, EventArgs e)
  24. {
  25. dateTimePicker1.Value = DateTime.Now.Date.AddDays(-1);
  26. dateTimePicker2.Value = DateTime.Now.Date.AddDays(1);
  27. ValueList v = new ValueList();
  28. v.ValueListItems.Add("0", "未发送");
  29. v.ValueListItems.Add("2", "已接收");
  30. v.ValueListItems.Add("3", "已完成");
  31. v.ValueListItems.Add("7", "确认接收");
  32. this.ultraGrid1.DisplayLayout.Bands[0].Columns["STATUS"].ValueList = v.Clone();
  33. this.ultraGrid2.DisplayLayout.Bands[0].Columns["STATUS"].ValueList = v.Clone();
  34. }
  35. public override void ToolBar_Click(object sender, string ToolbarKey)
  36. {
  37. switch (ToolbarKey)
  38. {
  39. case "Query":
  40. this.DoQuery();
  41. break;
  42. case "InExport":
  43. break;
  44. }
  45. }
  46. #region 查询按钮
  47. private void button1_Click(object sender, EventArgs e)
  48. {
  49. this.DoQuery();
  50. }
  51. #endregion
  52. #region 查询
  53. private void DoQuery()
  54. {
  55. try
  56. {
  57. String STARTTIME = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");
  58. String ENDTIME = this.dateTimePicker2.Value.ToString("yyyy-MM-dd");
  59. String BATCH_NO = this.textBox1.Text.Trim();
  60. String SPECIMEN_NO = this.textBox2.Text.Trim();
  61. if (this.checkBox2.Checked)
  62. {
  63. STARTTIME = "";
  64. ENDTIME = "";
  65. }
  66. else
  67. {
  68. BATCH_NO = "";
  69. }
  70. if (this.checkBox1.Checked)
  71. {
  72. STARTTIME = "";
  73. ENDTIME = "";
  74. }
  75. else
  76. {
  77. SPECIMEN_NO = "";
  78. }
  79. Hashtable ht = new Hashtable();
  80. ht.Add("STARTTIME", STARTTIME);//
  81. ht.Add("ENDTIME", ENDTIME);//
  82. ht.Add("BATCH_NO", BATCH_NO);//
  83. ht.Add("SPECIMEN_NO", SPECIMEN_NO);//
  84. CoreClientParam ccp = new CoreClientParam();
  85. this.dataSet1.Clear();
  86. ccp.ServerName = "QCM.JHY01.JHY0102.QuerryJhyQtly";
  87. ccp.MethodName = "getZHBLRA";
  88. ccp.SourceDataTable = this.dataSet1.Tables[0];
  89. ccp.ServerParams = new object[] { ht };
  90. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  91. ClsControlPack.RefreshAndAutoSize(ultraGrid1);
  92. }
  93. catch (Exception ex)
  94. {
  95. System.Diagnostics.Debug.WriteLine(ex.ToString());
  96. MessageBox.Show("查询异常!", "警告");
  97. }
  98. }
  99. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  100. {
  101. try
  102. {
  103. int num = this.ultraGrid1.Rows.Count();
  104. if (num >= 1)
  105. {
  106. String SPECIMEN_NO = this.ultraGrid1.ActiveRow.Cells["SPECIMEN_NO"].Value.ToString();
  107. Hashtable ht = new Hashtable();
  108. ht.Add("SPECIMEN_NO", SPECIMEN_NO);
  109. CoreClientParam ccp = new CoreClientParam();
  110. this.dataSet2.Clear();
  111. ccp.ServerName = "QCM.JHY01.JHY0102.QuerryJhyQtly";
  112. ccp.MethodName = "getZHBLRAITEM";
  113. ccp.SourceDataTable = this.dataSet2.Tables[0];
  114. ccp.ServerParams = new object[] { ht };
  115. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  116. ClsControlPack.RefreshAndAutoSize(ultraGrid2);
  117. }
  118. else
  119. {
  120. this.dataSet1.Clear();
  121. this.dataSet2.Clear();
  122. }
  123. }
  124. catch (Exception ex)
  125. {
  126. System.Diagnostics.Debug.WriteLine(ex.ToString());
  127. MessageBox.Show("查询异常!", "警告");
  128. }
  129. }
  130. #endregion
  131. #region 修改
  132. private void button2_Click(object sender, EventArgs e)
  133. {
  134. try
  135. {
  136. int num = 0;
  137. String SPECIMEN_NO_CK = "";
  138. //判断勾选了几个轧批
  139. foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
  140. {
  141. if (ugr.Cells["CHECK"].Value.ToString().ToLower() == "true")
  142. {
  143. String BATCH_NO = ugr.Cells["BATCH_NO"].Value.ToString();
  144. String STATUS = ugr.Cells["STATUS"].Value.ToString();
  145. if (!"0".Equals(STATUS))
  146. {
  147. this.alert("轧批[" + BATCH_NO +"]已下发委托不能修改为这个轧批,请先撤销委托再操作或换成其它未下发的轧批!");
  148. return;
  149. }
  150. num = num + 1;
  151. SPECIMEN_NO_CK = ugr.Cells["SPECIMEN_NO"].Value.ToString();
  152. }
  153. }
  154. if (num != 1)
  155. {
  156. this.alert("加做冲击只能勾选一个轧批做为送样的LRA,不可勾选多条数据请核实数据!");
  157. return;
  158. }
  159. String SPECIMEN_NO = this.ultraGrid1.ActiveRow.Cells["SPECIMEN_NO"].Value.ToString();
  160. Hashtable ht = new Hashtable();
  161. ht.Add("SPECIMEN_NO", SPECIMEN_NO);
  162. ht.Add("SPECIMEN_NO_CK", SPECIMEN_NO_CK);
  163. ht.Add("USER_ID", this.UserInfo.GetUserID());
  164. ht.Add("USER_NAME", this.UserInfo.GetUserName());
  165. CoreClientParam ccp = new CoreClientParam();
  166. ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
  167. ccp.MethodName = "UPZHBLRA";
  168. ccp.ServerParams = new object[] { ht };
  169. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  170. if (ccp.ReturnCode != -1)
  171. {
  172. MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  173. }
  174. }
  175. catch (Exception ex)
  176. {
  177. System.Diagnostics.Debug.WriteLine(ex.ToString());
  178. MessageBox.Show("查询异常!", "警告");
  179. }
  180. }
  181. #endregion
  182. private void checkBox2_Click(object sender, EventArgs e)
  183. {
  184. if (this.checkBox2.Checked)
  185. {
  186. this.dateTimePicker1.Enabled = false;
  187. this.dateTimePicker2.Enabled = false;
  188. this.textBox1.Enabled = true;
  189. }
  190. else
  191. {
  192. if (!this.checkBox1.Checked && !this.checkBox2.Checked )
  193. {
  194. this.dateTimePicker1.Enabled = true;
  195. this.dateTimePicker2.Enabled = true;
  196. }
  197. this.textBox1.Enabled = false;
  198. }
  199. }
  200. private void checkBox1_Click(object sender, EventArgs e)
  201. {
  202. if (this.checkBox1.Checked)
  203. {
  204. this.dateTimePicker1.Enabled = false;
  205. this.dateTimePicker2.Enabled = false;
  206. this.textBox2.Enabled = true;
  207. }
  208. else
  209. {
  210. if (!this.checkBox1.Checked && !this.checkBox2.Checked)
  211. {
  212. this.dateTimePicker1.Enabled = true;
  213. this.dateTimePicker2.Enabled = true;
  214. }
  215. this.textBox2.Enabled = false;
  216. }
  217. }
  218. }
  219. }