8dc6e9854a5cdcb39a63167966d74b1a0ba53b94.svn-base 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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. namespace Core.LZMes.Client.QCM
  13. {
  14. public partial class QCM030710 : FrmBase
  15. {
  16. public QCM030710()
  17. {
  18. InitializeComponent();
  19. }
  20. public string prodline = "";
  21. public string steelname = "";
  22. public string steel = "";
  23. public string material_no = "";
  24. public string prod_name = "";
  25. private void QCM0307_Load(object sender, EventArgs e)
  26. {
  27. try
  28. {
  29. this.dataSet7.Clear();
  30. string surface_id = "";
  31. CoreClientParam ccp = new CoreClientParam();
  32. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  33. ccp.MethodName = "GetGpSteel";
  34. ccp.ServerParams = new object[] {prodline,steel };
  35. ccp.SourceDataTable = this.dataSet7.Tables[0];
  36. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  37. }
  38. catch (Exception ex)
  39. {
  40. System.Diagnostics.Debug.WriteLine(ex.ToString());
  41. MessageBox.Show("系统出错,请联系管理人员", "警告");
  42. }
  43. }
  44. private void button2_Click(object sender, EventArgs e)
  45. {
  46. try
  47. {
  48. this.Close();
  49. }
  50. catch (System.Exception ex)
  51. {
  52. System.Diagnostics.Debug.WriteLine(ex.ToString());
  53. }
  54. }
  55. private void button1_Click(object sender, EventArgs e)
  56. {
  57. foreach(UltraGridRow ugr in this.ultraGrid6.Rows)
  58. {
  59. if(ugr.Cells["CHECK"].Text.ToString() == "True")
  60. {
  61. this.steelname = ugr.Cells["STEELNAME"].Value.ToString();
  62. }
  63. }
  64. if (this.steelname == "")
  65. {
  66. MessageBox.Show("请选择改判订单!");
  67. return;
  68. }
  69. this.Close();
  70. }
  71. private void button3_Click(object sender, EventArgs e)
  72. {
  73. try
  74. {
  75. this.dataSet7.Clear();
  76. string steelname = this.textBox1.Text.ToString();
  77. string prodline = "";
  78. //if(prod_line == "")
  79. //{
  80. // MessageBox.Show("请选择产线!");
  81. // return;
  82. //}
  83. //if (prod_line == "一炼钢")
  84. //{
  85. // prodline = "4001LG0";
  86. //}
  87. //else
  88. //{
  89. // prodline = "4001LGX";
  90. //}
  91. CoreClientParam ccp = new CoreClientParam();
  92. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  93. ccp.MethodName = "GetGpSteel";
  94. ccp.ServerParams = new object[] { prodline, steelname };
  95. ccp.SourceDataTable = this.dataSet7.Tables[0];
  96. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  97. }
  98. catch (Exception ex)
  99. {
  100. System.Diagnostics.Debug.WriteLine(ex.ToString());
  101. MessageBox.Show("系统出错,请联系管理人员", "警告");
  102. }
  103. }
  104. private void textBox1_KeyDown(object sender, KeyEventArgs e)
  105. {
  106. try
  107. {
  108. if (e.KeyCode != Keys.Enter) return;//回车时
  109. this.dataSet7.Clear();
  110. string steelname = this.textBox1.Text.ToString();
  111. string prod_line = "";
  112. //if(prod_line == "")
  113. //{
  114. // MessageBox.Show("请选择产线!");
  115. // return;
  116. //}
  117. //if (prod_line == "一炼钢")
  118. //{
  119. // prodline = "4001LG0";
  120. //}
  121. //else
  122. //{
  123. // prodline = "4001LGX";
  124. //}
  125. CoreClientParam ccp = new CoreClientParam();
  126. ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
  127. ccp.MethodName = "GetGpSteel";
  128. ccp.ServerParams = new object[] { prodline, steelname };
  129. ccp.SourceDataTable = this.dataSet7.Tables[0];
  130. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  131. }
  132. catch (Exception ex)
  133. {
  134. System.Diagnostics.Debug.WriteLine(ex.ToString());
  135. MessageBox.Show("系统出错,请联系管理人员", "警告");
  136. }
  137. }
  138. private void ultraGrid6_CellChange(object sender, CellEventArgs e)
  139. {
  140. this.dataSet4.Clear();
  141. if (e.Cell.Column.Key.ToString() == "CHECK" && e.Cell.Row.Cells["CHECK"].Text.ToString() == "True")
  142. {
  143. try
  144. {
  145. CoreClientParam ccp = new CoreClientParam();
  146. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  147. ccp.MethodName = "GetSteelChemInfo";
  148. ccp.ServerParams = new object[] { material_no, prod_name, prodline, e.Cell.Row.Cells["STEELNAME"].Value.ToString() };
  149. ccp.SourceDataTable = this.dataSet4.Tables[0];
  150. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  151. if (this.ultraGrid5.DisplayLayout.Bands[0].Columns.Contains("CHECKBOXS"))
  152. {
  153. ultraGrid5.DisplayLayout.Bands[0].Columns["CHECKBOXS"].Hidden = true;
  154. }
  155. UltraGridRow judge_row = null;
  156. int count1 = 0;
  157. List<string> s = new List<string>();
  158. foreach (UltraGridRow ugst in this.ultraGrid5.Rows)
  159. {
  160. if (!ugst.Cells["STD_TYPE"].Text.ToString().Contains("标准") && !ugst.Cells["STD_TYPE"].Text.ToString().Contains("要求"))
  161. {
  162. judge_row = ugst;
  163. }
  164. if (judge_row != null)
  165. {
  166. foreach (UltraGridRow ugs in this.ultraGrid5.Rows)
  167. {
  168. if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && ugs.Cells["STD_TYPE"].Text.ToString() == "放行标准(熔炼)")
  169. {
  170. for (int i = 0; i < ugs.Cells.Count; i++)
  171. {
  172. if (!string.IsNullOrEmpty(ugs.Cells[i].Text) && ugs.Cells[i].Text.ToString().Contains(" "))
  173. {
  174. string[] str_arr = ugs.Cells[i].Text.ToString().Replace(" ", "#").Split('#');
  175. if (str_arr.Length == 1)
  176. {
  177. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  178. {
  179. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  180. {
  181. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  182. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  183. if (!s.Contains(judge_row.Cells[i].ToString()))
  184. {
  185. s.Add(judge_row.Cells[i].ToString());
  186. count1++;
  187. }
  188. }
  189. }
  190. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  191. {
  192. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  193. {
  194. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  195. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  196. if (!s.Contains(judge_row.Cells[i].ToString()))
  197. {
  198. s.Add(judge_row.Cells[i].ToString());
  199. count1++;
  200. }
  201. }
  202. }
  203. }
  204. else if (str_arr.Length == 2)
  205. {
  206. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  207. {
  208. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  209. {
  210. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  211. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  212. if (!s.Contains(judge_row.Cells[i].ToString()))
  213. {
  214. s.Add(judge_row.Cells[i].ToString());
  215. count1++;
  216. }
  217. }
  218. }
  219. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  220. {
  221. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  222. {
  223. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  224. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  225. if (!s.Contains(judge_row.Cells[i].ToString()))
  226. {
  227. s.Add(judge_row.Cells[i].ToString());
  228. count1++;
  229. }
  230. }
  231. }
  232. if (str_arr[1].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  233. {
  234. if (double.Parse(str_arr[1].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  235. {
  236. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  237. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  238. if (!s.Contains(judge_row.Cells[i].ToString()))
  239. {
  240. s.Add(judge_row.Cells[i].ToString());
  241. count1++;
  242. }
  243. }
  244. }
  245. else if (str_arr[1].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  246. {
  247. if (double.Parse(str_arr[1].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  248. {
  249. judge_row.Cells[i].Appearance.BackColor = Color.Red;
  250. judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  251. if (!s.Contains(judge_row.Cells[i].ToString()))
  252. {
  253. s.Add(judge_row.Cells[i].ToString());
  254. count1++;
  255. }
  256. }
  257. }
  258. }
  259. }
  260. }
  261. }
  262. }
  263. }
  264. }
  265. }
  266. catch (Exception ex)
  267. {
  268. System.Diagnostics.Debug.WriteLine(ex.ToString());
  269. MessageBox.Show("系统出错,请联系管理人员", "警告");
  270. }
  271. }
  272. }
  273. private void ultraGrid6_BeforeCellActivate(object sender, CancelableCellEventArgs e)
  274. {
  275. foreach (UltraGridRow ugr in this.ultraGrid6.Rows.Where(p => p.IsFilteredOut == false).ToList())
  276. {
  277. ugr.Cells["CHECK"].Value = "False";
  278. }
  279. }
  280. }
  281. }