QcmZbsInfoInput.cs 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800
  1. using Core.Mes.Client.Comm;
  2. using Core.Mes.Client.Comm.Control;
  3. using Core.Mes.Client.Comm.Server;
  4. using Core.Mes.Client.Comm.Tool;
  5. using Core.StlMes.Client.Judge.Controls;
  6. using CoreFS.CA06;
  7. using Infragistics.Win;
  8. using Infragistics.Win.UltraWinGrid;
  9. using System;
  10. using System.Collections;
  11. using System.Collections.Generic;
  12. using System.ComponentModel;
  13. using System.Data;
  14. using System.Drawing;
  15. using System.Linq;
  16. using System.Text;
  17. using System.Windows.Forms;
  18. namespace Core.StlMes.Client.Judge.Forms
  19. {
  20. public partial class QcmZbsInfoInput : FrmBase
  21. {
  22. public QcmZbsInfoInput()
  23. {
  24. InitializeComponent();
  25. }
  26. public override void ToolBar_Click(object sender, string ToolbarKey)
  27. {
  28. switch (ToolbarKey)
  29. {
  30. case "Query":
  31. Query();
  32. break;
  33. case "Add":
  34. Add();
  35. break;
  36. case "Update":
  37. Update();
  38. break;
  39. case "Delete":
  40. Delete();
  41. break;
  42. case "savePhyInfo":
  43. savePhyInfo();
  44. break;
  45. case "DeletePhyInfo":
  46. DeletePhyInfo();
  47. break;
  48. case "saveChemInfo":
  49. saveChemInfo();
  50. break;
  51. case "DeleteChemInfo":
  52. DeleteChemInfo();
  53. break;
  54. case "Close":
  55. this.Close();
  56. break;
  57. }
  58. }
  59. private void Query()
  60. {
  61. string judgeNo = "";
  62. string orderStart = "";
  63. string orderEnd = "";
  64. if (ckJudgeNo.Checked)
  65. judgeNo = utJudgeNo.Text.Trim();
  66. if (uchkDate.Checked)
  67. {
  68. orderStart = udtStart.DateTime.ToString("yyyy-MM-dd") + " 00:00:01";
  69. orderEnd = udtEnd.DateTime.ToString("yyyy-MM-dd") + " 23:59:59";
  70. }
  71. else
  72. {
  73. orderStart = "1000-01-01 00:00:01";
  74. orderEnd = "9999-12-31 23:59:59";
  75. }
  76. DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.ZbsInfoInput.getZbsInfo", new Object[] { judgeNo, orderStart, orderEnd }, this.ob);
  77. GridHelper.CopyDataToDatatable(ref dt, ref this.zbsInfo, true);
  78. GridHelper.RefreshAndAutoSize(this.ultraGrid1);
  79. }
  80. private void Add()
  81. {
  82. ZbsChooseBillInfo choose = new ZbsChooseBillInfo(this.ob);
  83. choose.ShowDialog();
  84. if (choose.CloseEvent.Equals("Add"))
  85. {
  86. this.Query();
  87. }
  88. }
  89. private void Update()
  90. {
  91. try
  92. {
  93. ultraGrid1.UpdateData();
  94. if (ultraGrid1.ActiveRow == null)
  95. return;
  96. UltraGridRow row = ultraGrid1.ActiveRow;
  97. if ("".Equals(row.Cells["JUDGE_STOVE_NO"].Value.ToString()))
  98. {
  99. MessageUtil.ShowTips("判定炉号不能为空");
  100. return;
  101. }
  102. if ("".Equals(row.Cells["BATCH_NO"].Value.ToString()))
  103. {
  104. MessageUtil.ShowTips("批号不能为空");
  105. return;
  106. }
  107. DateTime date = new DateTime();
  108. if (!DateTime.TryParse(row.Cells["CREATE_TIME"].Value.ToString(), out date))
  109. {
  110. MessageUtil.ShowTips("创建时间错误");
  111. return;
  112. }
  113. ArrayList list = new ArrayList();
  114. list.Add(row.Cells["ACT_COUNT"].Value.ToString());
  115. list.Add(row.Cells["ACT_THEORY_WEIGHT"].Value.ToString());
  116. list.Add(row.Cells["ACT_WEIGHT"].Value.ToString());
  117. list.Add(row.Cells["BATCH_NO"].Value.ToString());
  118. list.Add(row.Cells["CHEM_RESULT"].Value.ToString());
  119. list.Add(row.Cells["CREATE_NAME"].Value.ToString());
  120. list.Add(row.Cells["CREATE_TIME"].Value.ToString());
  121. list.Add(row.Cells["CUSTM_ORDER_NO"].Value.ToString());
  122. list.Add(row.Cells["CUSTOMER_NM"].Value.ToString());
  123. list.Add(row.Cells["CUSTOMER_NO"].Value.ToString());
  124. list.Add(row.Cells["CUT_NUM"].Value.ToString());
  125. list.Add(row.Cells["DELIVERY_STATE_CODE"].Value.ToString());
  126. list.Add(row.Cells["DELIVERY_STATE_NAME"].Value.ToString());
  127. list.Add(row.Cells["DETECT_RESULT"].Value.ToString());
  128. list.Add(row.Cells["DETECT_RESULT2"].Value.ToString());
  129. list.Add(row.Cells["FACE_RESULT"].Value.ToString());
  130. list.Add(row.Cells["FLAG"].Value.ToString());
  131. list.Add(row.Cells["GRADECODE"].Value.ToString());
  132. list.Add(row.Cells["GRADENAME"].Value.ToString());
  133. list.Add(row.Cells["JUDGE_RESULT"].Value.ToString());
  134. list.Add(row.Cells["JUDGE_STOVE_NO"].Value.ToString());
  135. list.Add(row.Cells["LEN_DESC"].Value.ToString());
  136. list.Add(row.Cells["LEN_MAX"].Value.ToString());
  137. list.Add(row.Cells["LEN_MIN"].Value.ToString());
  138. list.Add(row.Cells["LEN_MIN_MAX_UNIT"].Value.ToString());
  139. list.Add(row.Cells["LEN_NO"].Value.ToString());
  140. list.Add(row.Cells["LEN_UNIT"].Value.ToString());
  141. list.Add(row.Cells["LOT_NO"].Value.ToString());
  142. list.Add(row.Cells["LOT_NO_GROUP"].Value.ToString());
  143. list.Add(row.Cells["MEMO"].Value.ToString());
  144. list.Add(row.Cells["MODEL_CODE"].Value.ToString());
  145. list.Add(row.Cells["MODEL_DESC"].Value.ToString());
  146. list.Add(row.Cells["ORDER_NO"].Value.ToString());
  147. list.Add(row.Cells["ORDER_SEQ"].Value.ToString());
  148. list.Add(row.Cells["ORDER_SPEC_CODE"].Value.ToString());
  149. list.Add(row.Cells["ORDER_SPEC_DESC"].Value.ToString());
  150. list.Add(row.Cells["ORD_LN_DLY_PK"].Value.ToString());
  151. list.Add(row.Cells["ORD_LN_PK"].Value.ToString());
  152. list.Add(row.Cells["OUTPUT_STD_NO"].Value.ToString());
  153. list.Add(row.Cells["PHY_RESULT"].Value.ToString());
  154. list.Add(row.Cells["PLINE_CODE"].Value.ToString());
  155. list.Add(row.Cells["PROCESS_DESC"].Value.ToString());
  156. list.Add(row.Cells["PROCESS_DESC"].Text);
  157. list.Add(row.Cells["PROCESS_RESULT"].Value.ToString());
  158. list.Add(row.Cells["PRODUCCODE"].Value.ToString());
  159. list.Add(row.Cells["PRODUCNAME"].Value.ToString());
  160. list.Add(row.Cells["RECEIV_NM"].Value.ToString());
  161. list.Add(row.Cells["RECEIV_NO"].Value.ToString());
  162. list.Add(row.Cells["SPEC_CODE"].Value.ToString());
  163. list.Add(row.Cells["SPEC_NAME"].Value.ToString());
  164. list.Add(row.Cells["SPEC_RESULT"].Value.ToString());
  165. list.Add(row.Cells["STD_CODE"].Value.ToString());
  166. list.Add(row.Cells["STD_NAME"].Value.ToString());
  167. list.Add(row.Cells["STD_STYLE"].Value.ToString());
  168. list.Add(row.Cells["STD_STYLE_DESC"].Value.ToString());
  169. list.Add(row.Cells["STEELCODE"].Value.ToString());
  170. list.Add(row.Cells["STEELNAME"].Value.ToString());
  171. list.Add(row.Cells["STOVE_NO"].Value.ToString());
  172. list.Add(row.Cells["USE_CODE"].Value.ToString());
  173. list.Add(row.Cells["USE_DESC"].Value.ToString());
  174. list.Add(row.Cells["WATER_RESULT"].Value.ToString());
  175. list.Add(row.Cells["WO_ID"].Value.ToString());
  176. list.Add(row.Cells["ZBS_ADD_ASK_DESC"].Value.ToString());
  177. list.Add(row.Cells["ZBS_MEMO"].Value.ToString());
  178. list.Add(row.Cells["ZBS_MEMO_JG"].Value.ToString());
  179. list.Add(row.Cells["ZBS_ID"].Value.ToString());
  180. CoreClientParam ccp = new CoreClientParam();
  181. ccp.ServerName = "com.steering.pss.judge.DAL.ZbsInfoInput";
  182. ccp.MethodName = "saveZbsInfo";
  183. ccp.ServerParams = new object[] { list };
  184. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  185. if (ccp != null)
  186. {
  187. if (ccp.ReturnCode == -1)
  188. {
  189. MessageUtil.ShowWarning(ccp.ReturnInfo);
  190. return;
  191. }
  192. }
  193. else
  194. {
  195. return;
  196. }
  197. MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  198. Query();
  199. }
  200. catch (Exception ex)
  201. {
  202. MessageBox.Show("保存失败,原因:" + ex.Message);
  203. }
  204. Query();
  205. }
  206. private void Delete()
  207. {
  208. if (ultraGrid1.ActiveRow==null)
  209. return;
  210. CoreClientParam ccp = new CoreClientParam();
  211. ccp.ServerName = "com.steering.pss.judge.DAL.ZbsInfoInput";
  212. ccp.MethodName = "doDeleteZbsInfo";
  213. ccp.ServerParams = new object[] { ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString() };
  214. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  215. if (ccp != null)
  216. {
  217. if (ccp.ReturnCode == -1)
  218. {
  219. MessageUtil.ShowWarning(ccp.ReturnInfo);
  220. return;
  221. }
  222. }
  223. else
  224. {
  225. return;
  226. }
  227. MessageBox.Show("删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  228. Query();
  229. }
  230. private void QueryChemInfo()
  231. {
  232. if (ultraGrid1.ActiveRow == null)
  233. return;
  234. DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.ZbsInfoInput.getChemInfo", new Object[] { ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString() }, this.ob);
  235. GridHelper.CopyDataToDatatable(ref dt, ref this.zbsChem, true);
  236. GridHelper.RefreshAndAutoSize(this.ultraGrid3);
  237. }
  238. private void saveChemInfo()
  239. {
  240. try
  241. {
  242. ultraGrid3.UpdateData();
  243. if (ultraGrid1.ActiveRow == null)
  244. return;
  245. if (ultraGrid3.Rows.Count <= 0)
  246. return;
  247. ArrayList parm = new ArrayList();
  248. foreach (UltraGridRow row in ultraGrid3.Rows)
  249. {
  250. ArrayList list = new ArrayList();
  251. list.Add(ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString());
  252. list.Add(ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString());
  253. list.Add(row.Cells["SAMPLE_NO"].Value.ToString());
  254. list.Add(row.Cells["PROCESS_CODE"].Value.ToString());
  255. list.Add(row.Cells["CHEM_TYPE"].Value.ToString());
  256. list.Add(row.Cells["CHEM_NAME"].Value.ToString());
  257. list.Add(row.Cells["CHEM_VALUE"].Value.ToString());
  258. list.Add(row.Cells["NK_MIN"].Value.ToString());
  259. list.Add(row.Cells["NK_MAX"].Value.ToString());
  260. list.Add("1");
  261. list.Add(row.Cells["JF_MIN"].Value.ToString());
  262. list.Add(row.Cells["JF_MAX"].Value.ToString());
  263. list.Add("1");
  264. list.Add(row.Cells["ROUND"].Value.ToString());
  265. list.Add(row.Cells["SAMPLE_ID"].Value.ToString());
  266. list.Add(ultraGrid1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString());
  267. parm.Add(list);
  268. }
  269. CoreClientParam ccp = new CoreClientParam();
  270. ccp.ServerName = "com.steering.pss.judge.DAL.ZbsInfoInput";
  271. ccp.MethodName = "saveChemInfo";
  272. ccp.ServerParams = new object[] { parm, ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString() };
  273. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  274. if (ccp != null)
  275. {
  276. if (ccp.ReturnCode == -1)
  277. {
  278. MessageUtil.ShowWarning(ccp.ReturnInfo);
  279. return;
  280. }
  281. }
  282. else
  283. {
  284. return;
  285. }
  286. MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  287. Query();
  288. }
  289. catch (Exception ex)
  290. {
  291. MessageBox.Show("保存失败,原因:" + ex.Message);
  292. }
  293. }
  294. private void DeleteChemInfo()
  295. {
  296. if (ultraGrid1.ActiveRow == null)
  297. return;
  298. CoreClientParam ccp = new CoreClientParam();
  299. ccp.ServerName = "com.steering.pss.judge.DAL.ZbsInfoInput";
  300. ccp.MethodName = "DeleteChemInfo";
  301. ccp.ServerParams = new object[] { ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString(),
  302. ultraGrid3.ActiveRow.Cells["ZBS_SEQ"].Value.ToString()};
  303. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  304. if (ccp != null)
  305. {
  306. if (ccp.ReturnCode == -1)
  307. {
  308. MessageUtil.ShowWarning(ccp.ReturnInfo);
  309. return;
  310. }
  311. }
  312. else
  313. {
  314. return;
  315. }
  316. MessageBox.Show("删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  317. Query();
  318. }
  319. private void QueryPhyInfo()
  320. {
  321. if (ultraGrid1.ActiveRow == null)
  322. return;
  323. DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.ZbsInfoInput.getPhyInfo", new Object[] { ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString() }, this.ob);
  324. GridHelper.CopyDataToDatatable(ref dt, ref this.zbsPhy, true);
  325. GridHelper.RefreshAndAutoSize(this.ultraGrid2);
  326. }
  327. private void savePhyInfo()
  328. {
  329. try
  330. {
  331. ultraGrid2.UpdateData();
  332. if (ultraGrid1.ActiveRow == null)
  333. return;
  334. if (ultraGrid2.Rows.Count <= 0)
  335. return;
  336. ArrayList parm = new ArrayList();
  337. foreach (UltraGridRow row in ultraGrid2.Rows)
  338. {
  339. if ("".Equals(row.Cells["SAMPLE_NO"].Value.ToString()))
  340. {
  341. MessageUtil.ShowTips("试样号不能为空");
  342. return;
  343. }
  344. if ("".Equals(row.Cells["PROCESS_CODE"].Value.ToString()))
  345. {
  346. MessageUtil.ShowTips("工序代码不能为空");
  347. return;
  348. }
  349. if ("".Equals(row.Cells["PHY_CODE_MAX"].Value.ToString()))
  350. {
  351. MessageUtil.ShowTips("检验大项不能为空");
  352. return;
  353. }
  354. if ("".Equals(row.Cells["PHY_CODE_MIN"].Value.ToString()))
  355. {
  356. MessageUtil.ShowTips("试样组不能为空");
  357. return;
  358. }
  359. if ("".Equals(row.Cells["PHY_CODE"].Value.ToString()))
  360. {
  361. MessageUtil.ShowTips("检验项不能为空");
  362. return;
  363. }
  364. ArrayList list = new ArrayList();
  365. list.Add(ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString());
  366. list.Add(ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString());
  367. list.Add(row.Cells["AUDIT_NAME"].Value.ToString());
  368. //list.Add(row.Cells["AUDIT_TIME"].Value.ToString());
  369. list.Add(row.Cells["AVERAGE"].Value.ToString());
  370. list.Add(row.Cells["AVERAGE_VALUE_F"].Value.ToString());
  371. list.Add(row.Cells["CHECK_NAME"].Value.ToString());
  372. list.Add(row.Cells["CHECK_TEMP"].Value.ToString());
  373. //list.Add(row.Cells["CHECK_TIME"].Value.ToString());
  374. list.Add(row.Cells["DEVICE_NAME"].Value.ToString());
  375. list.Add(row.Cells["DEVICE_NO"].Value.ToString());
  376. list.Add(row.Cells["FORMUAL_NAME"].Value.ToString());
  377. list.Add(row.Cells["FORMUAL_NO"].Value.ToString());
  378. list.Add(row.Cells["HARDNESS_TYPE"].Value.ToString());
  379. list.Add(row.Cells["ISRCL"].Value.ToString());
  380. list.Add("");
  381. list.Add("");
  382. //list.Add(row.Cells["IS_DEFECT"].Value.ToString());
  383. //list.Add(row.Cells["IS_GOOD"].Value.ToString());
  384. list.Add(row.Cells["ITEM_CODE_F"].Value.ToString());
  385. list.Add(row.Cells["ITEM_CODE_S"].Value.ToString());
  386. list.Add(row.Cells["ITEM_CODE_W"].Value.ToString());
  387. list.Add(row.Cells["ITEM_NAME_F"].Value.ToString());
  388. list.Add(row.Cells["ITEM_NAME_S"].Value.ToString());
  389. list.Add(row.Cells["ITEM_NAME_W"].Value.ToString());
  390. list.Add(row.Cells["JF_ADD_CONDITION"].Value.ToString());
  391. list.Add(row.Cells["JF_ADD_JUDGE_BASIS"].Value.ToString());
  392. list.Add(row.Cells["JF_ADD_MAX"].Value.ToString());
  393. list.Add(row.Cells["JF_ADD_MIN"].Value.ToString());
  394. list.Add(row.Cells["JF_JUDGE_BASIS"].Value.ToString());
  395. list.Add(row.Cells["JF_MAX"].Value.ToString());
  396. list.Add(row.Cells["JF_MIN"].Value.ToString());
  397. list.Add("1");
  398. //list.Add(row.Cells["JF_TOL_QUALIFIED"].Value.ToString());
  399. list.Add(row.Cells["NK_ADD_CONDITION"].Value.ToString());
  400. list.Add(row.Cells["NK_ADD_JUDGE_BASIS"].Value.ToString());
  401. list.Add(row.Cells["NK_ADD_MAX"].Value.ToString());
  402. list.Add(row.Cells["NK_ADD_MIN"].Value.ToString());
  403. list.Add(row.Cells["NK_JUDGE_BASIS"].Value.ToString());
  404. list.Add(row.Cells["NK_MAX"].Value.ToString());
  405. list.Add(row.Cells["NK_MIN"].Value.ToString());
  406. list.Add("1");
  407. //list.Add(row.Cells["NK_TOL_QUALIFIED"].Value.ToString());
  408. list.Add(row.Cells["PHY_CODE"].Value.ToString());
  409. list.Add(row.Cells["PHY_CODE_DIR"].Value.ToString());
  410. list.Add(row.Cells["PHY_CODE_MAX"].Value.ToString());
  411. list.Add(row.Cells["PHY_CODE_MIN"].Value.ToString());
  412. list.Add(row.Cells["PHY_NAME"].Value.ToString());
  413. list.Add(row.Cells["PHY_NAME_DIR"].Value.ToString());
  414. list.Add(row.Cells["PHY_NAME_MAX"].Value.ToString());
  415. list.Add(row.Cells["PHY_NAME_MIN"].Value.ToString());
  416. list.Add(row.Cells["PROCESS_CODE"].Value.ToString());
  417. list.Add(row.Cells["REMARK"].Value.ToString());
  418. list.Add(row.Cells["SAMPLE_ID"].Value.ToString());
  419. list.Add(row.Cells["SAMPLE_NO"].Value.ToString());
  420. list.Add(row.Cells["SAMPLE_SIZE"].Value.ToString());
  421. list.Add(row.Cells["SAMPLE_STYLE"].Value.ToString());
  422. list.Add(row.Cells["SIZE_DESC"].Value.ToString());
  423. list.Add(row.Cells["VALUE1"].Value.ToString());
  424. list.Add(row.Cells["VALUE10"].Value.ToString());
  425. list.Add(row.Cells["VALUE11"].Value.ToString());
  426. list.Add(row.Cells["VALUE12"].Value.ToString());
  427. list.Add(row.Cells["VALUE13"].Value.ToString());
  428. list.Add(row.Cells["VALUE14"].Value.ToString());
  429. list.Add(row.Cells["VALUE15"].Value.ToString());
  430. list.Add(row.Cells["VALUE2"].Value.ToString());
  431. list.Add(row.Cells["VALUE3"].Value.ToString());
  432. list.Add(row.Cells["VALUE4"].Value.ToString());
  433. list.Add(row.Cells["VALUE5"].Value.ToString());
  434. list.Add(row.Cells["VALUE6"].Value.ToString());
  435. list.Add(row.Cells["VALUE7"].Value.ToString());
  436. list.Add(row.Cells["VALUE8"].Value.ToString());
  437. list.Add(row.Cells["VALUE9"].Value.ToString());
  438. list.Add(row.Cells["VALUE_F2"].Value.ToString());
  439. list.Add(row.Cells["VALUE_F3"].Value.ToString());
  440. list.Add(row.Cells["VALUE_KSI"].Value.ToString());
  441. list.Add(row.Cells["VALUE_PSI"].Value.ToString());
  442. parm.Add(list);
  443. }
  444. CoreClientParam ccp = new CoreClientParam();
  445. ccp.ServerName = "com.steering.pss.judge.DAL.ZbsInfoInput";
  446. ccp.MethodName = "savePhyInfo";
  447. ccp.ServerParams = new object[] { parm, ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString() };
  448. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  449. if (ccp != null)
  450. {
  451. if (ccp.ReturnCode == -1)
  452. {
  453. MessageUtil.ShowWarning(ccp.ReturnInfo);
  454. return;
  455. }
  456. }
  457. else
  458. {
  459. return;
  460. }
  461. MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  462. Query();
  463. }
  464. catch (Exception ex)
  465. {
  466. MessageBox.Show("保存失败,原因:" + ex.Message);
  467. }
  468. }
  469. private void DeletePhyInfo()
  470. {
  471. if (ultraGrid1.ActiveRow == null)
  472. return;
  473. CoreClientParam ccp = new CoreClientParam();
  474. ccp.ServerName = "com.steering.pss.judge.DAL.ZbsInfoInput";
  475. ccp.MethodName = "DeletePhyInfo";
  476. ccp.ServerParams = new object[] { ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString() ,
  477. ultraGrid2.ActiveRow.Cells["ZBS_SEQ"].Value.ToString()};
  478. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  479. if (ccp != null)
  480. {
  481. if (ccp.ReturnCode == -1)
  482. {
  483. MessageUtil.ShowWarning(ccp.ReturnInfo);
  484. return;
  485. }
  486. }
  487. else
  488. {
  489. return;
  490. }
  491. MessageBox.Show("删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  492. Query();
  493. }
  494. private void QcmZbsInfoInput_Load(object sender, EventArgs e)
  495. {
  496. //默认查询当前日期-1月——当前日期数据。
  497. udtStart.DateTime = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToShortDateString());
  498. udtEnd.DateTime = Convert.ToDateTime(DateTime.Now.ToShortDateString());
  499. ValueList list1 = new ValueList();
  500. ValueListItem[] items1 = new ValueListItem[] {
  501. new ValueListItem("0", "熔炼成分"),
  502. new ValueListItem("1", "成品成分"),
  503. };
  504. list1.ValueListItems.AddRange(items1);
  505. ultraGrid3.DisplayLayout.Bands[0].Columns["CHEM_TYPE"].ValueList = list1;
  506. ValueList list2 = new ValueList();
  507. ValueListItem[] items2 = new ValueListItem[] {
  508. new ValueListItem("0", "否"),
  509. new ValueListItem("1", "是"),
  510. };
  511. list2.ValueListItems.AddRange(items2);
  512. ultraGrid2.DisplayLayout.Bands[0].Columns["ISRCL"].ValueList = list2;
  513. ValueList list3 = new ValueList();
  514. ValueListItem[] items3 = new ValueListItem[] {
  515. new ValueListItem("A", "炼钢"),
  516. new ValueListItem("D", "轧制"),
  517. new ValueListItem("A", "热处理"),
  518. new ValueListItem("G", "加工"),
  519. };
  520. list3.ValueListItems.AddRange(items3);
  521. ultraGrid1.DisplayLayout.Bands[0].Columns["PROCESS_DESC"].ValueList = list3;
  522. DataTable dtChem = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407401" }, this.ob);
  523. ultraGrid1.DisplayLayout.Bands[0].Columns["CHEM_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtChem);
  524. DataTable dtPhy = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407402" }, this.ob);
  525. ultraGrid1.DisplayLayout.Bands[0].Columns["PHY_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtPhy);
  526. DataTable dtFace = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407406" }, this.ob);
  527. ultraGrid1.DisplayLayout.Bands[0].Columns["FACE_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtFace);
  528. DataTable dtSpec = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407403" }, this.ob);
  529. ultraGrid1.DisplayLayout.Bands[0].Columns["SPEC_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtSpec);
  530. DataTable dtDetect = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407404" }, this.ob);
  531. ultraGrid1.DisplayLayout.Bands[0].Columns["DETECT_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtDetect);
  532. DataTable dtWater = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407405" }, this.ob);
  533. ultraGrid1.DisplayLayout.Bands[0].Columns["WATER_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtWater);
  534. DataTable dtProcess = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407408" }, this.ob);
  535. ultraGrid1.DisplayLayout.Bands[0].Columns["PROCESS_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtProcess);
  536. DataTable dtJudge = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407407" }, this.ob);
  537. ultraGrid1.DisplayLayout.Bands[0].Columns["JUDGE_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtJudge);
  538. DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.ZbsInfoInput.getPlineInfo", new Object[] { }, this.ob);
  539. ValueListItem[] items4 = new ValueListItem[dt.Rows.Count];
  540. for (int i = 0; i < dt.Rows.Count; i++)
  541. {
  542. ValueListItem item = new ValueListItem();
  543. item.DataValue = dt.Rows[i]["pline_code"].ToString();
  544. item.DisplayText = dt.Rows[i]["pline_name"].ToString();
  545. items4[i] = item;
  546. }
  547. ValueList valueList = new ValueList();
  548. valueList.ValueListItems.AddRange(items4);
  549. ultraGrid1.DisplayLayout.Bands[0].Columns["PLINE_CODE"].ValueList = valueList;
  550. }
  551. private void ckJudgeNo_CheckedChanged(object sender, EventArgs e)
  552. {
  553. if (ckJudgeNo.Checked)
  554. utJudgeNo.ReadOnly = false;
  555. else
  556. utJudgeNo.ReadOnly = true;
  557. }
  558. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  559. {
  560. zbsChem.Clear();
  561. zbsPhy.Clear();
  562. QueryChemInfo();
  563. QueryPhyInfo();
  564. }
  565. private void ultraTextEditor3_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  566. {
  567. if (ultraGrid2.ActiveCell.Column.Key == "PHY_NAME_MAX")
  568. {
  569. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.ComBaseQuery.geComBasePhyRStd", null, ob);
  570. dt.Columns["PHY_TYPE"].Caption = "检验大项";
  571. BaseInfoPopup baseInfoPopup = new BaseInfoPopup(dt, "PHY_TYPE", "PHY_CODE");
  572. baseInfoPopup.Text = "检验大项";
  573. baseInfoPopup.LabelTextBox1.Caption = "检验大项";
  574. baseInfoPopup.Shown += new EventHandler((c, d) =>
  575. {
  576. IQueryable<UltraGridRow> rows = baseInfoPopup.ultraGrid1.Rows.AsQueryable().Where(
  577. a => a.GetValue("PHY_CODE") == ultraGrid2.ActiveRow.GetValue("PHY_CODE_MAX"));
  578. if (rows.Count() > 0)
  579. {
  580. rows.First().Activate();
  581. }
  582. });
  583. if (baseInfoPopup.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  584. {
  585. ultraGrid2.ActiveRow.SetValue("PHY_NAME_MAX", baseInfoPopup.ChoicedRow.GetValue("PHY_TYPE"));
  586. ultraGrid2.ActiveRow.SetValue("PHY_CODE_MAX", baseInfoPopup.ChoicedRow.GetValue("PHY_CODE"));
  587. ultraGrid2.ActiveRow.SetValue("PHY_NAME_MIN", "");
  588. ultraGrid2.ActiveRow.SetValue("PHY_CODE_MIN", "");
  589. ultraGrid2.ActiveRow.SetValue("PHY_NAME", "");
  590. ultraGrid2.ActiveRow.SetValue("PHY_CODE", "");
  591. ultraGrid2.ActiveRow.SetValue("ITEM_NAME_F", "");
  592. ultraGrid2.ActiveRow.SetValue("ITEM_CODE_F", "");
  593. ultraGrid2.ActiveRow.SetValue("ITEM_NAME_W", "");
  594. ultraGrid2.ActiveRow.SetValue("ITEM_CODE_W", "");
  595. ultraGrid2.ActiveRow.SetValue("ITEM_NAME_S", "");
  596. ultraGrid2.ActiveRow.SetValue("ITEM_CODE_S", "");
  597. }
  598. }
  599. else if (ultraGrid2.ActiveCell.Column.Key == "PHY_NAME_MIN")
  600. {
  601. string phyCodeMax = ultraGrid2.ActiveRow.GetValue("PHY_CODE_MAX");
  602. if (phyCodeMax == "")
  603. {
  604. MessageUtil.ShowWarning("请选检验大项!");
  605. return;
  606. }
  607. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.ComBaseQuery.geComBasePhyC", new object[] { phyCodeMax }, ob);
  608. dt.Columns["PHY_TYPE"].Caption = "试样组";
  609. BaseInfoPopup baseInfoPopup = new BaseInfoPopup(dt, "PHY_TYPE", "PHY_CODE");
  610. baseInfoPopup.Text = "试样组";
  611. baseInfoPopup.LabelTextBox1.Caption = "试样组";
  612. baseInfoPopup.Shown += new EventHandler((c, d) =>
  613. {
  614. IQueryable<UltraGridRow> rows = baseInfoPopup.ultraGrid1.Rows.AsQueryable().Where(
  615. a => a.GetValue("PHY_CODE") == ultraGrid2.ActiveRow.GetValue("PHY_CODE_MIN"));
  616. if (rows.Count() > 0)
  617. {
  618. rows.First().Activate();
  619. }
  620. });
  621. if (baseInfoPopup.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  622. {
  623. ultraGrid2.ActiveRow.SetValue("PHY_NAME_MIN", baseInfoPopup.ChoicedRow.GetValue("PHY_TYPE"));
  624. ultraGrid2.ActiveRow.SetValue("PHY_CODE_MIN", baseInfoPopup.ChoicedRow.GetValue("PHY_CODE"));
  625. ultraGrid2.ActiveRow.SetValue("PHY_NAME", "");
  626. ultraGrid2.ActiveRow.SetValue("PHY_CODE", "");
  627. ultraGrid2.ActiveRow.SetValue("ITEM_NAME_F", "");
  628. ultraGrid2.ActiveRow.SetValue("ITEM_CODE_F", "");
  629. ultraGrid2.ActiveRow.SetValue("ITEM_NAME_S", "");
  630. ultraGrid2.ActiveRow.SetValue("ITEM_CODE_S", "");
  631. ultraGrid2.ActiveRow.SetValue("ITEM_NAME_W", "");
  632. ultraGrid2.ActiveRow.SetValue("ITEM_CODE_W", "");
  633. }
  634. }
  635. else if (ultraGrid2.ActiveCell.Column.Key == "PHY_NAME")
  636. {
  637. string phyCodeMax = ultraGrid2.ActiveRow.GetValue("PHY_CODE_MAX");
  638. string phyCodeMin = ultraGrid2.ActiveRow.GetValue("PHY_CODE_MIN");
  639. if (phyCodeMax == "")
  640. {
  641. MessageUtil.ShowWarning("请选择检验大项");
  642. ultraGrid2.ActiveRow.Cells["PHY_NAME_MAX"].Activate();
  643. return;
  644. }
  645. else if (phyCodeMin == "")
  646. {
  647. MessageUtil.ShowWarning("请选择试样组");
  648. ultraGrid2.ActiveRow.Cells["PHY_NAME_MIN"].Activate();
  649. return;
  650. }
  651. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.ComBaseQuery.geComBasePhy", new object[] { phyCodeMax, phyCodeMin }, ob);
  652. dt.Columns["PHY_NAME"].Caption = "检验项";
  653. BaseInfoPopup baseInfoPopup = new BaseInfoPopup(dt, "PHY_NAME", "PHY_CODE");
  654. baseInfoPopup.Text = "检验项";
  655. baseInfoPopup.LabelTextBox1.Caption = "检验项";
  656. baseInfoPopup.Shown += new EventHandler((c, d) =>
  657. {
  658. IQueryable<UltraGridRow> rows = baseInfoPopup.ultraGrid1.Rows.AsQueryable().Where(
  659. a => a.GetValue("PHY_CODE") == ultraGrid2.ActiveRow.GetValue("PHY_CODE"));
  660. if (rows.Count() > 0)
  661. {
  662. rows.First().Activate();
  663. }
  664. });
  665. if (baseInfoPopup.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  666. {
  667. ultraGrid2.ActiveRow.SetValue("PHY_NAME", baseInfoPopup.ChoicedRow.GetValue("PHY_NAME"));
  668. ultraGrid2.ActiveRow.SetValue("PHY_CODE", baseInfoPopup.ChoicedRow.GetValue("PHY_CODE"));
  669. ultraGrid2.ActiveRow.SetValue("ITEM_NAME_W", "");
  670. ultraGrid2.ActiveRow.SetValue("ITEM_CODE_W", "");
  671. }
  672. if (baseInfoPopup.ChoicedRow.GetValue("PHY_CODE") == "P0618" || baseInfoPopup.ChoicedRow.GetValue("PHY_CODE") == "P0619")
  673. {
  674. ultraGrid2.ActiveRow.SetValue("STDMIN_SIGN", "=");
  675. ultraGrid2.ActiveRow.SetValue("STDMIN", "否");
  676. }
  677. }
  678. else if (ultraGrid2.ActiveCell.Column.Key == "ITEM_NAME_F")
  679. {
  680. string phyTypeC = ultraGrid2.ActiveRow.GetValue("PHY_CODE_MIN");
  681. if (phyTypeC == "")
  682. {
  683. MessageUtil.ShowWarning("请选择试样组");
  684. ultraGrid2.ActiveRow.Cells["PHY_NAME_MIN"].Activate();
  685. return;
  686. }
  687. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.ComBaseQuery.geComBasePhyRItem",
  688. new object[] { phyTypeC }, ob);
  689. dt.Columns["ITEM_NAME_F"].Caption = "试验方向";
  690. dt.Columns["ITEM_NAME_C"].Caption = "试验尺寸";
  691. if (ultraGrid2.ActiveRow.GetValue("PHY_CODE_MAX") == "R0001")
  692. {
  693. dt.DefaultView.RowFilter = "ITEM_CODE_F IS NOT NULL";
  694. }
  695. if (ultraGrid2.ActiveRow.GetValue("PHY_CODE_MAX") == "R0002")
  696. {
  697. dt.DefaultView.RowFilter = "ITEM_CODE_C IS NOT NULL AND ITEM_CODE_F IS NOT NULL";
  698. }
  699. BaseInfoPopup baseInfoPopup = new BaseInfoPopup(dt, "ITEM_NAME_F", "ITEM_CODE_F", "ITEM_CODE_C");
  700. baseInfoPopup.Text = "试验选择";
  701. baseInfoPopup.LabelTextBox1.Caption = "试验方向";
  702. baseInfoPopup.Shown += new EventHandler((c, d) =>
  703. {
  704. IQueryable<UltraGridRow> rows = baseInfoPopup.ultraGrid1.Rows.AsQueryable().Where(
  705. a => a.GetValue("ITEM_CODE_F") == ultraGrid2.ActiveRow.GetValue("ITEM_CODE_F")
  706. && a.GetValue("ITEM_CODE_C") == ultraGrid2.ActiveRow.GetValue("ITEM_CODE_S"));
  707. if (rows.Count() > 0)
  708. {
  709. rows.First().Activate();
  710. }
  711. });
  712. if (baseInfoPopup.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  713. {
  714. ultraGrid2.ActiveRow.SetValue("ITEM_NAME_F", baseInfoPopup.ChoicedRow.GetValue("ITEM_NAME_F"));
  715. ultraGrid2.ActiveRow.SetValue("ITEM_CODE_F", baseInfoPopup.ChoicedRow.GetValue("ITEM_CODE_F"));
  716. ultraGrid2.ActiveRow.SetValue("ITEM_NAME_S", baseInfoPopup.ChoicedRow.GetValue("ITEM_NAME_C"));
  717. ultraGrid2.ActiveRow.SetValue("ITEM_CODE_S", baseInfoPopup.ChoicedRow.GetValue("ITEM_CODE_C"));
  718. }
  719. }
  720. else if (ultraGrid2.ActiveCell.Column.Key == "ITEM_NAME_W")
  721. {
  722. string phyCode = ultraGrid2.ActiveRow.GetValue("PHY_CODE");
  723. if (phyCode == "")
  724. {
  725. MessageUtil.ShowWarning("请选择检验项");
  726. ultraGrid2.ActiveRow.Cells["PHY_NAME"].Activate();
  727. return;
  728. }
  729. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.ComBaseQuery.geComBasePhyRPos",
  730. new object[] { phyCode }, ob);
  731. dt.Columns["ITEM_NAME_W"].Caption = "试验温度";
  732. if (ultraGrid2.ActiveRow.GetValue("PHY_CODE_MAX") == "R0001")
  733. {
  734. dt.DefaultView.RowFilter = "ITEM_CODE_W IS NOT NULL";
  735. }
  736. BaseInfoPopup baseInfoPopup = new BaseInfoPopup(dt, "ITEM_NAME_W", "ITEM_CODE_W");
  737. baseInfoPopup.Text = "试验选择";
  738. baseInfoPopup.LabelTextBox1.Caption = "试验温度";
  739. baseInfoPopup.Shown += new EventHandler((c, d) =>
  740. {
  741. IQueryable<UltraGridRow> rows = baseInfoPopup.ultraGrid1.Rows.AsQueryable().Where(
  742. a => a.GetValue("ITEM_CODE_W") == ultraGrid2.ActiveRow.GetValue("ITEM_CODE_W"));
  743. if (rows.Count() > 0)
  744. {
  745. rows.First().Activate();
  746. }
  747. });
  748. if (baseInfoPopup.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  749. {
  750. ultraGrid2.ActiveRow.SetValue("ITEM_NAME_W", baseInfoPopup.ChoicedRow.GetValue("ITEM_NAME_W"));
  751. ultraGrid2.ActiveRow.SetValue("ITEM_CODE_W", baseInfoPopup.ChoicedRow.GetValue("ITEM_CODE_W"));
  752. }
  753. }
  754. }
  755. private void ultraGrid2_AfterRowInsert(object sender, RowEventArgs e)
  756. {
  757. ultraGrid2.ActiveRow.SetValue("ISRCL", "0");
  758. }
  759. }
  760. }