51649e21d789a7e000fdaab3df476bc24c899de1.svn-base 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  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 QCM030807 : FrmBase
  16. {
  17. public QCM030807()
  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 "Add":
  32. this.Declare();
  33. break;
  34. case "UnAdd":
  35. this.UnDeclare();
  36. break;
  37. case "Export":
  38. this.DoExport();
  39. break;
  40. case "Examine":
  41. this.Examine();
  42. break;
  43. case "Input":
  44. this.Input();
  45. break;
  46. }
  47. }
  48. private void affirm()
  49. {
  50. try
  51. {
  52. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  53. if (ugr == null)
  54. return;
  55. string heat_no = ugr.Cells["HEAT_NO"].Value.ToString();
  56. string assay_no = ugr.Cells["ASSAY_NO"].Value.ToString();
  57. string pline_code = ugr.Cells["pline_code"].Value.ToString();
  58. ArrayList list1 = new ArrayList();
  59. list1.Add(heat_no);
  60. list1.Add(assay_no);
  61. list1.Add(pline_code);
  62. list1.Add(this.UserInfo.GetUserName());
  63. CoreClientParam ccp = new CoreClientParam();
  64. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  65. ccp.MethodName = "UpdateChemeInfo";
  66. ccp.ServerParams = new object[] { list1 };
  67. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  68. if (ccp.ReturnCode == -1)
  69. {
  70. return;
  71. }
  72. DoQuery();
  73. MessageBox.Show("修改成功!");
  74. }
  75. catch(Exception EX)
  76. {
  77. MessageBox.Show(EX.ToString());
  78. }
  79. }
  80. private void Declare()
  81. {
  82. try
  83. {
  84. string prod_type = "";
  85. string tslx = "";
  86. string prod_line1 = "";
  87. QCM030608 frm = new QCM030608();
  88. frm.ob = this.ob;
  89. if (frm.ShowDialog() == DialogResult.OK)
  90. {
  91. prod_type = frm.prod_type;
  92. prod_line1 = frm.prod_line;
  93. tslx = frm.tslx;
  94. }
  95. string optman;
  96. string slab_no;
  97. string opttype = "1";
  98. string prod_line = "";
  99. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  100. {
  101. if (ugr.Cells["CHK"].Text.ToString() == "True")
  102. {
  103. //string opttype = "1";
  104. /*string prod_type = this.comboBox1.Text.ToString();
  105. string tslx = this.comboBox2.Text.ToString();*/
  106. //string prod_line = "";
  107. if (comboBox3.Text.ToString() == "一炼钢")
  108. {
  109. prod_line = "4001LG0";
  110. }
  111. else if (comboBox3.Text.ToString() == "二炼钢")
  112. {
  113. prod_line = "4001LGX";
  114. }
  115. else
  116. {
  117. prod_line = "";
  118. }
  119. optman = this.UserInfo.GetUserName().ToString();
  120. slab_no = ugr.Cells["BILLETNO"].Value.ToString();
  121. CoreClientParam ccp = new CoreClientParam();
  122. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  123. ccp.MethodName = "doApplyJudge";
  124. ccp.ServerParams = new object[] { opttype, prod_type, tslx, prod_line, slab_no, optman };
  125. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  126. if (ccp.ReturnCode == -1)
  127. {
  128. return;
  129. }
  130. MessageBox.Show(ugr.Cells["BILLETNO"].Value.ToString() + "特殊放行申报成功");
  131. }
  132. //UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  133. }
  134. }
  135. catch (Exception ex)
  136. {
  137. System.Diagnostics.Debug.WriteLine(ex.ToString());
  138. MessageBox.Show("系统出错,请联系管理人员", "警告");
  139. }
  140. }
  141. private void UnDeclare()
  142. {
  143. try
  144. {
  145. string prod_type = "";
  146. string tslx = "";
  147. string prod_line1 = "";
  148. QCM030608 frm = new QCM030608();
  149. frm.ob = this.ob;
  150. if (frm.ShowDialog() == DialogResult.OK)
  151. {
  152. prod_type = frm.prod_type;
  153. prod_line1 = frm.prod_line;
  154. tslx = frm.tslx;
  155. }
  156. if (prod_type == "" || prod_line1 == "" || tslx == "")
  157. {
  158. return;
  159. }
  160. string optman;
  161. string slab_no;
  162. string opttype = "2";
  163. string prod_line = "";
  164. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  165. {
  166. if (ugr.Cells["CHK"].Text.ToString() == "True")
  167. {
  168. //UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  169. /*string prod_type = this.comboBox1.Text.ToString();
  170. string tslx = this.comboBox2.Text.ToString();*/
  171. if (comboBox3.Text.ToString() == "一炼钢")
  172. {
  173. prod_line = "4001LG0";
  174. }
  175. else if (comboBox3.Text.ToString() == "二炼钢")
  176. {
  177. prod_line = "4001LGX";
  178. }
  179. else
  180. {
  181. prod_line = "";
  182. }
  183. optman = this.UserInfo.GetUserName().ToString();
  184. slab_no = ugr.Cells["BILLETNO"].Value.ToString();
  185. CoreClientParam ccp = new CoreClientParam();
  186. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  187. ccp.MethodName = "doApplyJudge";
  188. ccp.ServerParams = new object[] { opttype, prod_type, tslx, prod_line, slab_no, optman };
  189. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  190. if (ccp.ReturnCode == -1)
  191. {
  192. return;
  193. }
  194. MessageBox.Show(ugr.Cells["BILLETNO"].Value.ToString() + "特殊放行撤销申报成功");
  195. }
  196. }
  197. }
  198. catch (Exception ex)
  199. {
  200. System.Diagnostics.Debug.WriteLine(ex.ToString());
  201. MessageBox.Show("系统出错,请联系管理人员", "警告");
  202. }
  203. }
  204. private void Examine()
  205. {
  206. try{
  207. string flag1 = "";
  208. QCM030609 frm = new QCM030609();
  209. frm.ob = this.ob;
  210. if (frm.ShowDialog() == DialogResult.OK)
  211. {
  212. flag1 = frm.flag;
  213. }
  214. if (flag1=="")
  215. {
  216. return;
  217. }
  218. string optman;
  219. string slab_no;
  220. string flag ="";
  221. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  222. {
  223. if (ugr.Cells["CHK"].Text.ToString() == "True")
  224. {
  225. if (flag1 == "通过")
  226. {
  227. flag = "Y";
  228. }
  229. else if (flag1 == "不通过")
  230. {
  231. flag = "N";
  232. }
  233. optman = this.UserInfo.GetUserName().ToString();
  234. slab_no = ugr.Cells["BILLETNO"].Value.ToString();
  235. CoreClientParam ccp = new CoreClientParam();
  236. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  237. ccp.MethodName = "ApplyJudgeCheck";//doApplyJudge
  238. ccp.ServerParams = new object[] { slab_no, flag, optman };
  239. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  240. if (ccp.ReturnCode == -1)
  241. {
  242. return;
  243. }
  244. MessageBox.Show(ugr.Cells["BILLETNO"].Value.ToString() + "特殊放行审核成功");
  245. }
  246. }
  247. }
  248. catch (Exception ex)
  249. {
  250. System.Diagnostics.Debug.WriteLine(ex.ToString());
  251. MessageBox.Show("系统出错,请联系管理人员", "警告");
  252. }
  253. }
  254. private void DoQuery()
  255. {
  256. DoQueryMe();
  257. }
  258. //查询待判信息
  259. private void DoQueryMe()
  260. {
  261. try
  262. {
  263. this.dataSet1.Clear();
  264. string heatno = this.textBox1.Text.Trim();
  265. string prod_line = "";
  266. CoreClientParam ccp = new CoreClientParam();
  267. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  268. ccp.MethodName = "GetApplyJudgeInfo";
  269. ccp.SourceDataTable = this.dataSet1.Tables[0];
  270. if (comboBox3.Text.ToString() == "一炼钢")
  271. {
  272. prod_line = "4001LG0";
  273. }
  274. else if (comboBox3.Text.ToString() == "二炼钢")
  275. {
  276. prod_line = "4001LGX";
  277. }
  278. else
  279. {
  280. prod_line = "";
  281. }
  282. ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), heatno, prod_line };
  283. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  284. }
  285. catch (Exception ex)
  286. {
  287. System.Diagnostics.Debug.WriteLine(ex.ToString());
  288. MessageBox.Show("系统出错,请联系管理人员", "警告");
  289. }
  290. }
  291. private void QCM030803_Load(object sender, EventArgs e)
  292. {
  293. this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
  294. this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3);
  295. }
  296. private void DoExport()
  297. {
  298. try
  299. {
  300. if (this.ultraGrid2.Rows.Count == 0)
  301. {
  302. MessageBox.Show("没有可以导出的数据", "提示");
  303. return;
  304. }
  305. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  306. {
  307. string fName = this.saveFileDialog1.FileName;
  308. this.ultraGridExcelExporter1.Export(this.ultraGrid2, fName);
  309. Process.Start(fName);
  310. }
  311. }
  312. catch (Exception ex)
  313. {
  314. System.Diagnostics.Debug.WriteLine(ex.ToString());
  315. }
  316. }
  317. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  318. {
  319. try
  320. {
  321. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  322. this.textBox2.Text = ugr.Cells["JRYQ"].Value.ToString();
  323. this.textBox3.Text = ugr.Cells["ZJYQ"].Value.ToString();
  324. this.textBox4.Text = ugr.Cells["QYYQ"].Value.ToString();
  325. this.textBox5.Text = ugr.Cells["RCLYQ"].Value.ToString();
  326. this.textBox6.Text = ugr.Cells["BILLETNO"].Value.ToString();
  327. this.textBox7.Text = ugr.Cells["LGJUDGEYQ"].Value.ToString();
  328. this.textBox8.Text = ugr.Cells["CFPDYQ"].Value.ToString();
  329. this.dataSet2.Clear();
  330. string design_key = ugr.Cells["ORDERNO"].Value.ToString();
  331. string smp_no = ugr.Cells["HEATNO"].Value.ToString();
  332. string grade_name = ugr.Cells["LGPH"].Text.ToString();
  333. CoreClientParam ccp = new CoreClientParam();
  334. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  335. ccp.MethodName = "GetLgRChemeInfo";
  336. ccp.ServerParams = new object[] { design_key, smp_no, grade_name };
  337. ccp.SourceDataTable = this.dataSet2.Tables[0];
  338. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  339. UltraGridRow judge_row = null;
  340. int count1 = 0;
  341. List<string> s = new List<string>();
  342. foreach (UltraGridRow ugst in this.ultraGrid3.Rows)
  343. {
  344. if (!ugst.Cells["STD_TYPE"].Text.ToString().Contains("标准") && !ugst.Cells["STD_TYPE"].Text.ToString().Contains("要求"))
  345. {
  346. judge_row = ugst;
  347. }
  348. if (judge_row != null)
  349. {
  350. foreach (UltraGridRow ugs in this.ultraGrid3.Rows)
  351. {
  352. if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && ugs.Cells["STD_TYPE"].Text.ToString() == "放行标准(熔炼)")
  353. {
  354. for (int i = 0; i < ugs.Cells.Count; i++)
  355. {
  356. if (!string.IsNullOrEmpty(ugs.Cells[i].Text) && ugs.Cells[i].Text.ToString().Contains(" "))
  357. {
  358. string[] str_arr = ugs.Cells[i].Text.ToString().Replace(" ", "#").Split('#');
  359. if (str_arr.Length == 1)
  360. {
  361. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  362. {
  363. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  364. {
  365. //judge_row.Cells[i].Appearance.BackColor = Color.Red;
  366. //judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  367. if (!s.Contains(judge_row.Cells[i].ToString()))
  368. {
  369. s.Add(judge_row.Cells[i].ToString());
  370. count1++;
  371. }
  372. }
  373. }
  374. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  375. {
  376. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  377. {
  378. //judge_row.Cells[i].Appearance.BackColor = Color.Red;
  379. //judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  380. if (!s.Contains(judge_row.Cells[i].ToString()))
  381. {
  382. s.Add(judge_row.Cells[i].ToString());
  383. count1++;
  384. }
  385. }
  386. }
  387. }
  388. else if (str_arr.Length == 2)
  389. {
  390. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  391. {
  392. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  393. {
  394. //judge_row.Cells[i].Appearance.BackColor = Color.Red;
  395. //judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  396. if (!s.Contains(judge_row.Cells[i].ToString()))
  397. {
  398. s.Add(judge_row.Cells[i].ToString());
  399. count1++;
  400. }
  401. }
  402. }
  403. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  404. {
  405. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  406. {
  407. //judge_row.Cells[i].Appearance.BackColor = Color.Red;
  408. //judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  409. if (!s.Contains(judge_row.Cells[i].ToString()))
  410. {
  411. s.Add(judge_row.Cells[i].ToString());
  412. count1++;
  413. }
  414. }
  415. }
  416. if (str_arr[1].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  417. {
  418. if (double.Parse(str_arr[1].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  419. {
  420. //judge_row.Cells[i].Appearance.BackColor = Color.Red;
  421. //judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  422. if (!s.Contains(judge_row.Cells[i].ToString()))
  423. {
  424. s.Add(judge_row.Cells[i].ToString());
  425. count1++;
  426. }
  427. }
  428. }
  429. else if (str_arr[1].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  430. {
  431. if (double.Parse(str_arr[1].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  432. {
  433. //judge_row.Cells[i].Appearance.BackColor = Color.Red;
  434. //judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
  435. if (!s.Contains(judge_row.Cells[i].ToString()))
  436. {
  437. s.Add(judge_row.Cells[i].ToString());
  438. count1++;
  439. }
  440. }
  441. }
  442. }
  443. }
  444. }
  445. }
  446. }
  447. }
  448. }
  449. if (count1 > 0)
  450. {
  451. //this.label12.BackColor = Color.Red;
  452. //this.label12.Text = "" + smp_no + "有" + count1 + "条元素成分不合格!";
  453. //MessageBox.Show("" + smp_no + "有" + count1 + "条元素成分不合格!");
  454. }
  455. else
  456. {
  457. this.label12.Text = "";
  458. }
  459. }
  460. catch (Exception ex)
  461. {
  462. System.Diagnostics.Debug.WriteLine(ex.ToString());
  463. MessageBox.Show("系统出错,请联系管理人员", "警告");
  464. }
  465. }
  466. private void button1_Click(object sender, EventArgs e)
  467. {
  468. }
  469. private void Input()
  470. {
  471. try
  472. {
  473. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  474. {
  475. if (ugr.Cells["CHK"].Text.ToString() == "True")
  476. {
  477. string jryq = this.textBox2.Text.ToString();
  478. string zjyq = this.textBox3.Text.ToString();
  479. string qyyq = this.textBox4.Text.ToString();
  480. string rclyq = this.textBox5.Text.ToString();
  481. string slab_no = ugr.Cells["BILLETNO"].Value.ToString();
  482. string lgjudgeyq = this.textBox7.Text.ToString();
  483. string cfpdyq = this.textBox8.Text.ToString();
  484. CoreClientParam ccp = new CoreClientParam();
  485. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  486. ccp.MethodName = "ApplyJudgeInput";
  487. ccp.ServerParams = new object[] { slab_no, jryq, zjyq, qyyq, rclyq, lgjudgeyq, cfpdyq };
  488. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  489. if (ccp.ReturnCode == -1)
  490. {
  491. return;
  492. }
  493. MessageBox.Show(ugr.Cells["BILLETNO"].Value.ToString() + "特殊要求工艺录入成功");
  494. }
  495. }
  496. }
  497. catch (Exception ex)
  498. {
  499. System.Diagnostics.Debug.WriteLine(ex.ToString());
  500. MessageBox.Show("系统出错,请联系管理人员", "警告");
  501. }
  502. }
  503. private void splitContainer2_Panel2_Paint(object sender, PaintEventArgs e)
  504. {
  505. }
  506. private void panel2_Paint(object sender, PaintEventArgs e)
  507. {
  508. }
  509. }
  510. }