FrmVacuumTankManage.cs 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using System.Collections;
  9. using CoreFS.CA06;
  10. using Core.Mes.Client.Common;
  11. namespace Core.LgMes.Client.LgDeviceManager
  12. {
  13. public partial class FrmVacuumTankManage : Core.Mes.Client.Common.frmStyleBase
  14. {
  15. public FrmVacuumTankManage()
  16. {
  17. InitializeComponent();
  18. }
  19. private void FrmVacuumTankManage_Load(object sender, EventArgs e)
  20. {
  21. udteFrom.DateTime = DateTime.Today;
  22. udteTo.DateTime = DateTime.Today;
  23. proc_LoadCLID();
  24. proc_GetBaseInfo("", "");
  25. }
  26. private string ConvertShift(string strFlag, string strShift)
  27. {
  28. if (strFlag == "1")
  29. {
  30. switch (strShift.Substring(0, 1))
  31. {
  32. case "1":
  33. return "白";
  34. case "2":
  35. return "中";
  36. case "3":
  37. return "夜";
  38. default:
  39. return "";
  40. }
  41. }
  42. else if (strFlag == "2")
  43. {
  44. switch (strShift.Substring(1, 1))
  45. {
  46. case "1":
  47. return "甲";
  48. case "2":
  49. return "乙";
  50. case "3":
  51. return "丙";
  52. case "4":
  53. return "丁";
  54. default:
  55. return "";
  56. }
  57. }
  58. else if (strFlag == "3")
  59. {
  60. switch (strShift.Trim())
  61. {
  62. case "白":
  63. return "1";
  64. case "中":
  65. return "2";
  66. case "夜":
  67. return "3";
  68. default:
  69. return "";
  70. }
  71. }
  72. else if (strFlag == "4")
  73. {
  74. switch (strShift.Trim())
  75. {
  76. case "甲":
  77. return "1";
  78. case "乙":
  79. return "2";
  80. case "丙":
  81. return "3";
  82. case "丁":
  83. return "4";
  84. default:
  85. return "";
  86. }
  87. }
  88. return "";
  89. }
  90. private void SetLeftTableRowColor()
  91. {
  92. for (int i = 0; i < this.ugrdBaseInfo.Rows.Count; i++)
  93. {
  94. switch (this.ugrdBaseInfo.Rows[i].Cells["状态"].Text.Trim())
  95. {
  96. case "上线"://上线
  97. this.ugrdBaseInfo.Rows[i].Appearance.BackColor = Color.LightGreen;
  98. break;
  99. case "烘烤"://烘烤
  100. this.ugrdBaseInfo.Rows[i].Appearance.BackColor = Color.LightBlue;
  101. break;
  102. default:
  103. this.ugrdBaseInfo.Rows[i].Appearance.BackColor = Color.LightYellow;
  104. break;
  105. }
  106. }
  107. }
  108. private void SetRightTableRowColor()
  109. {
  110. for (int i = 0; i < this.ugrdUseInfo.Rows.Count; i++)
  111. {
  112. switch (this.ugrdUseInfo.Rows[i].Cells["状态"].Text.Trim())
  113. {
  114. case "上线"://上线
  115. this.ugrdUseInfo.Rows[i].Appearance.BackColor = Color.LightGreen;
  116. break;
  117. case "烘烤"://烘烤
  118. this.ugrdUseInfo.Rows[i].Appearance.BackColor = Color.LightBlue;
  119. break;
  120. default:
  121. this.ugrdUseInfo.Rows[i].Appearance.BackColor = Color.LightYellow;
  122. break;
  123. }
  124. }
  125. }
  126. private void proc_ResetEditArea()
  127. {
  128. try
  129. {
  130. txtID.Clear();
  131. ucmeCCM.Text = "";
  132. ucmeStatus.Text = "";
  133. txtLJCS.Clear();
  134. txtDQCS.Clear();
  135. txtOBCS.Clear();
  136. txtNO1.Clear();
  137. txtCS1.Clear();
  138. txtNO2.Clear();
  139. txtCS2.Clear();
  140. txtNO3.Clear();
  141. txtCS3.Clear();
  142. udteOnTime.Text = "";
  143. udteNextTime.Text = "";
  144. txtMemo.Clear();
  145. }
  146. catch (Exception ex)
  147. {
  148. MessageBox.Show(ex.Message);
  149. }
  150. }
  151. private void proc_ResetRepairArea()
  152. {
  153. try
  154. {
  155. txtID1.Clear();
  156. txtBegin1.Clear();
  157. txtEnd1.Clear();
  158. txtPeriod1.Clear();
  159. txtMemo1.Clear();
  160. }
  161. catch (Exception ex)
  162. {
  163. MessageBox.Show(ex.Message);
  164. }
  165. }
  166. private void proc_Edit()
  167. {
  168. try
  169. {
  170. if (ugrdUseInfo.Rows.Count == 0)
  171. return;
  172. if (ugrdUseInfo.ActiveRow == null)
  173. {
  174. MessageBox.Show("请选择要修改的使用记录!", "提示");
  175. return;
  176. }
  177. string strID = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["ID"].Value);
  178. string strNO = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["槽车编号"].Value);
  179. string strRHS = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["RH炉号"].Value);
  180. string strCYCID = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["周期编号"].Value);
  181. if (MessageBox.Show("确定要修改[" + strRHS + "]槽车[" + strNO + "]的当前使用记录吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  182. return;
  183. string strErr = "";
  184. ArrayList arry = new ArrayList();
  185. arry.Add("FrmVacuumTankManage_Query5");
  186. arry.Add(strID);
  187. arry.Add(strCYCID);
  188. CommonClientToServer ccs = new CommonClientToServer();
  189. ccs.ob = this.ob;
  190. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  191. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  192. {
  193. MessageBox.Show("[" + strRHS + "]槽车[" + strNO + "]的当前使用记录修改失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  194. return;
  195. }
  196. int iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  197. if (iCnt == 0)
  198. {
  199. MessageBox.Show("[" + strRHS + "]槽车[" + strNO + "]的当前使用记录不存在,无法修改!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  200. proc_GetBaseInfo(strRHS, strNO);
  201. return;
  202. }
  203. string strReturn = "";
  204. strErr = "";
  205. arry.Clear();
  206. ccs.ob = ob;
  207. arry.Add("FrmVacuumTankManage_Update.1");
  208. arry.Add(txtLJCS.Text.Trim());
  209. arry.Add(txtDQCS.Text.Trim());
  210. arry.Add(txtOBCS.Text.Trim());
  211. arry.Add(txtCS1.Text.Trim());
  212. arry.Add(txtCS2.Text.Trim());
  213. arry.Add(txtCS3.Text.Trim());
  214. arry.Add(udteOnTime.Text);
  215. arry.Add(udteNextTime.Text);
  216. arry.Add(txtMemo.Text.Trim());
  217. arry.Add(strID);
  218. arry.Add(strCYCID);
  219. strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
  220. if (!(strErr == null || strErr == ""))
  221. {
  222. MessageBox.Show("[" + strRHS + "]槽车[" + strNO + "]的当前使用记录修改失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  223. return;
  224. }
  225. proc_GetBaseInfo(strRHS, strNO);
  226. MessageBox.Show("[" + strRHS + "]槽车[" + strNO + "]的当前使用记录修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  227. }
  228. catch (Exception ex)
  229. {
  230. MessageBox.Show(ex.Message, "提示");
  231. }
  232. }
  233. private void proc_Del()
  234. {
  235. try
  236. {
  237. if (ugrdUseInfo.Rows.Count == 0)
  238. return;
  239. if (ugrdUseInfo.ActiveRow == null)
  240. {
  241. MessageBox.Show("请选择要删除的使用记录!", "提示");
  242. return;
  243. }
  244. string strID = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["ID"].Value);
  245. string strNO = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["槽车编号"].Value);
  246. string strRHS = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["RH炉号"].Value);
  247. string strCYCID = Convert.ToString(ugrdUseInfo.ActiveRow.Cells["周期编号"].Value);
  248. if (MessageBox.Show("确定要删除[" + strRHS + "]槽车[" + strNO + "]的当前使用记录吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  249. return;
  250. string strErr = "";
  251. ArrayList arry = new ArrayList();
  252. arry.Add("FrmVacuumTankManage_Query6");
  253. arry.Add(strID);
  254. arry.Add(strCYCID);
  255. CommonClientToServer ccs = new CommonClientToServer();
  256. ccs.ob = this.ob;
  257. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  258. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  259. {
  260. MessageBox.Show("[" + strRHS + "]槽车[" + strNO + "]的当前使用记录删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  261. return;
  262. }
  263. int iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  264. if (iCnt == 0)
  265. {
  266. MessageBox.Show("[" + strRHS + "]槽车[" + strNO + "]的当前使用记录不存在,无法删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  267. proc_GetBaseInfo(strRHS, strNO);
  268. return;
  269. }
  270. ds = null;
  271. strErr = "";
  272. arry.Clear();
  273. ccs.ob = ob;
  274. arry.Add("FrmVacuumTankManage_Query7");
  275. arry.Add(strID);
  276. arry.Add(strCYCID);
  277. ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  278. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  279. {
  280. MessageBox.Show("[" + strRHS + "]槽车[" + strNO + "]的当前使用记录删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  281. return;
  282. }
  283. if (Convert.ToString(ds.Tables[0].Rows[0]["NOWSTATUS"]) != "1") //1代表上线
  284. {
  285. MessageBox.Show("[" + strRHS + "]槽车[" + strNO + "]的当前使用记录已经结束,不能删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  286. return;
  287. }
  288. string strReturn = "";
  289. strErr = "";
  290. arry.Clear();
  291. ccs.ob = ob;
  292. arry.Add("FrmVacuumTankManage_Del");
  293. arry.Add(strID);
  294. arry.Add(strCYCID);
  295. strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
  296. if (!(strErr == null || strErr == ""))
  297. {
  298. MessageBox.Show("[" + strRHS + "]槽车[" + strNO + "]的当前使用记录删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  299. return;
  300. }
  301. strReturn = "";
  302. strErr = "";
  303. arry.Clear();
  304. arry.Add("FrmVacuumTankManage_Update.2");
  305. arry.Add(strID);
  306. ccs.ob = ob;
  307. strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
  308. if (!(strErr == null || strErr == ""))
  309. {
  310. MessageBox.Show("[" + strRHS + "]槽车[" + strNO + "]的当前使用记录删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  311. return;
  312. }
  313. proc_GetBaseInfo(strRHS, strNO);
  314. MessageBox.Show("[" + strRHS + "]槽车[" + strNO + "]的当前使用记录删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  315. }
  316. catch (Exception ex)
  317. {
  318. MessageBox.Show(ex.Message, "提示");
  319. }
  320. }
  321. /// <summary>
  322. /// 真空槽信息加载
  323. /// </summary>
  324. private void proc_LoadCLID()
  325. {
  326. try
  327. {
  328. string strErr = "";
  329. string strSql = "";
  330. if (chkRHS.Checked && ucmeRHS.SelectedIndex > -1)
  331. strSql="where RHS_ID = '" + ucmeRHS.Text.Trim() + "'";
  332. else
  333. strSql="";
  334. ArrayList arry = new ArrayList();
  335. ArrayList sqlList = new ArrayList();
  336. arry.Add("FrmVacuumTankManage_Query1");
  337. sqlList.Add(strSql);
  338. CoreClientParam CCP_LgEts = new CoreClientParam();
  339. DataTable dt = new DataTable();
  340. CCP_LgEts.ServerName = "Core.LgMes.Server.Common.ComDBQuery";
  341. CCP_LgEts.MethodName = "doQuery";
  342. CCP_LgEts.ServerParams = new object[] { arry, sqlList };
  343. CCP_LgEts.SourceDataTable = dt;
  344. this.ExecuteQueryToDataTable(CCP_LgEts, CoreInvokeType.Internal);
  345. DataSet ds = new DataSet();
  346. ds.Tables.Add(dt);
  347. strErr = CCP_LgEts.ReturnInfo;
  348. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  349. {
  350. MessageBox.Show("真空槽信息加载失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  351. if (MessageBox.Show("是否重新加载真空槽信息?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
  352. proc_LoadCLID();
  353. return;
  354. }
  355. ucmeID.DataSource = ds.Tables[0];
  356. ucmeID.DisplayMember = "TANKCARID";
  357. }
  358. catch (Exception ex)
  359. {
  360. MessageBox.Show(ex.Message, "提示");
  361. }
  362. }
  363. /// <summary>
  364. /// 基础信息查询
  365. /// </summary>
  366. /// <param name="strRHSID"></param>
  367. /// <param name="strVTKNO"></param>
  368. public void proc_GetBaseInfo(string strRHSID, string strVTKNO)
  369. {
  370. try
  371. {
  372. string strErr = "";
  373. string strWhere = "";
  374. if (chkRHS.Checked && ucmeRHS.Text.Trim().Length > 0)
  375. strWhere = "and t.RHS_ID = '" + ucmeRHS.Text.Trim() + "' ";
  376. if (chkID.Checked && ucmeID.Text.Length > 0)
  377. strWhere += "and t.TANKCARID = '" + ucmeID.Text.Trim() + "'";
  378. ArrayList arry = new ArrayList();
  379. ArrayList sqlList = new ArrayList();
  380. arry.Add("FrmVacuumTankManage_Query2");
  381. sqlList.Add(strWhere);
  382. CoreClientParam CCP_LgEts = new CoreClientParam();
  383. DataTable dt = new DataTable();
  384. CCP_LgEts.ServerName = "Core.LgMes.Server.Common.ComDBQuery";
  385. CCP_LgEts.MethodName = "doQuery";
  386. CCP_LgEts.ServerParams = new object[] { arry, sqlList };
  387. CCP_LgEts.SourceDataTable = dt;
  388. this.ExecuteQueryToDataTable(CCP_LgEts, CoreInvokeType.Internal);
  389. DataSet ds = new DataSet();
  390. ds.Tables.Add(dt);
  391. strErr= CCP_LgEts.ReturnInfo;
  392. //try
  393. //{
  394. // ((DataTable)ugrdBaseInfo.DataSource).Rows.Clear();
  395. //}
  396. //catch (Exception)
  397. //{
  398. //}
  399. if (ds != null && ds.Tables[0].Rows.Count > 0)
  400. {
  401. ugrdBaseInfo.DataSource = ds.Tables[0];
  402. }
  403. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  404. {
  405. MessageBox.Show("槽车信息查询失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  406. return;
  407. }
  408. SetLeftTableRowColor();
  409. if (ds.Tables[0].Rows.Count == 0)
  410. {
  411. proc_ResetRepairArea();
  412. return;
  413. }
  414. if (strRHSID.Length > 0) //定位记录
  415. {
  416. for (int i = 0; i < ugrdBaseInfo.Rows.Count; i++)
  417. {
  418. if (Convert.ToString(ugrdBaseInfo.Rows[i].Cells["RH炉号"].Value) == strRHSID)
  419. {
  420. if (strVTKNO.Length > 0)
  421. {
  422. if (Convert.ToString(ugrdBaseInfo.Rows[i].Cells["槽车编号"].Value) == strVTKNO)
  423. {
  424. ugrdBaseInfo.ActiveRow = ugrdBaseInfo.Rows[i];
  425. ugrdBaseInfo.Rows[i].Selected = true;
  426. return;
  427. }
  428. }
  429. else
  430. {
  431. ugrdBaseInfo.ActiveRow = ugrdBaseInfo.Rows[i];
  432. ugrdBaseInfo.Rows[i].Selected = true;
  433. return;
  434. }
  435. }
  436. }
  437. }
  438. }
  439. catch (Exception ex)
  440. {
  441. MessageBox.Show(ex.Message, "提示");
  442. }
  443. }
  444. /// <summary>
  445. /// 使用信息
  446. /// </summary>
  447. /// <param name="strID"></param>
  448. private void proc_GetUseInfo(string strID)
  449. {
  450. try
  451. {
  452. string strErr = "";
  453. string strWhere = "";
  454. if (strID.Length > 0)
  455. strWhere = "and T.TANKCARID = '" + strID + "' ";
  456. if (chkDate.Checked)
  457. {
  458. strWhere += "and to_char(T.BEGINTIME,'yyyy-MM-dd') between '" + udteFrom.DateTime.ToString("yyyy-MM-dd") + "' and '" + udteTo.DateTime.ToString("yyyy-MM-dd") + "'";
  459. }
  460. else
  461. {
  462. strWhere += "and (T.TANKCARID, T.CYCID) in (select TANKCARID, CYCID from "
  463. + "(select row_number() over (partition by x.TANKCARID order by x.CYCID desc) xh, x.* "
  464. + "from DEV_ZKC_USE_DETAIL x) where xh < 3)";
  465. }
  466. ArrayList arry = new ArrayList();
  467. ArrayList sqlList = new ArrayList();
  468. arry.Add("FrmVacuumTankManage_Query3");
  469. sqlList.Add(strWhere);
  470. CoreClientParam CCP_LgEts = new CoreClientParam();
  471. DataTable dt = new DataTable();
  472. CCP_LgEts.ServerName = "Core.LgMes.Server.Common.ComDBQuery";
  473. CCP_LgEts.MethodName = "doQuery";
  474. CCP_LgEts.ServerParams = new object[] { arry, sqlList };
  475. CCP_LgEts.SourceDataTable = dt;
  476. this.ExecuteQueryToDataTable(CCP_LgEts, CoreInvokeType.Internal);
  477. DataSet ds = new DataSet();
  478. ds.Tables.Add(dt);
  479. strErr = CCP_LgEts.ReturnInfo;
  480. try
  481. {
  482. ((DataSet)ugrdUseInfo.DataSource).Tables[0].Rows.Clear();
  483. }
  484. catch (Exception)
  485. {
  486. }
  487. if (ds != null && ds.Tables[0].Rows.Count > 0)
  488. {
  489. ugrdUseInfo.DataSource = ds;
  490. }
  491. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  492. {
  493. MessageBox.Show("槽车[" + strID + "]使用信息查询失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  494. return;
  495. }
  496. SetRightTableRowColor();
  497. if (ds.Tables[0].Rows.Count == 0)
  498. proc_ResetEditArea();
  499. }
  500. catch (Exception ex)
  501. {
  502. MessageBox.Show(ex.Message, "提示");
  503. }
  504. }
  505. /// <summary>
  506. /// 烘烤信息查询
  507. /// </summary>
  508. /// <param name="strID"></param>
  509. private void proc_GetHotInfo(string strID)
  510. {
  511. try
  512. {
  513. if (strID.Length == 0) return;
  514. string strErr = "";
  515. ArrayList arry = new ArrayList();
  516. arry.Add("FrmVacuumTankManage_Query4");
  517. arry.Add(strID);
  518. arry.Add(strID);
  519. CommonClientToServer ccs = new CommonClientToServer();
  520. ccs.ob = this.ob;
  521. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  522. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  523. {
  524. MessageBox.Show("真空槽[" + strID + "]烘烤信息查询失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  525. return;
  526. }
  527. if (ds.Tables[0].Rows.Count > 0)
  528. {
  529. txtID1.Text = Convert.ToString(ds.Tables[0].Rows[0]["槽车编号"]);
  530. txtBegin1.Text = Convert.ToString(ds.Tables[0].Rows[0]["烘烤开始时刻"]);
  531. txtEnd1.Text = Convert.ToString(ds.Tables[0].Rows[0]["烘烤结束时刻"]);
  532. txtPeriod1.Text = Convert.ToString(ds.Tables[0].Rows[0]["烘烤时间"]);
  533. txtMemo1.Text = Convert.ToString(ds.Tables[0].Rows[0]["备注"]);
  534. }
  535. else
  536. proc_ResetRepairArea();
  537. }
  538. catch (Exception ex)
  539. {
  540. MessageBox.Show(ex.Message, "提示");
  541. }
  542. }
  543. /// <summary>
  544. /// 菜单
  545. /// </summary>
  546. /// <param name="sender"></param>
  547. /// <param name="ToolbarKey"></param>
  548. public override void ToolBar_Click(object sender, string ToolbarKey)
  549. {
  550. switch (ToolbarKey)
  551. {
  552. case "HotDetail":
  553. {
  554. FrmVTHotDetail frm = new FrmVTHotDetail(ob);//真空槽烘烤记录
  555. frm.ShowDialog();
  556. break;
  557. }
  558. case "PLUGIN":
  559. {
  560. FrmVTPluginInfo frm = new FrmVTPluginInfo(ob);//真空槽信息
  561. frm.ShowDialog();
  562. break;
  563. }
  564. case "BaseInfo":
  565. {
  566. FrmVTBaseInfo frm = new FrmVTBaseInfo(ob);//基础信息
  567. frm.Tag = this;
  568. if (ugrdBaseInfo.ActiveRow != null)
  569. {
  570. frm.strRHS = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["RH炉号"].Value);
  571. frm.strNo = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["槽车编号"].Value);
  572. }
  573. frm.ShowDialog();
  574. break;
  575. }
  576. case "VanHot":
  577. {
  578. FrmVTHot frm = new FrmVTHot(ob);//真空槽烘烤
  579. frm.Tag = this;
  580. if (ugrdBaseInfo.ActiveRow != null)
  581. {
  582. frm.strRHS = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["RH炉号"].Value);
  583. frm.strNo = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["槽车编号"].Value);
  584. }
  585. frm.ShowDialog();
  586. }
  587. break;
  588. case "Query":
  589. {
  590. proc_GetBaseInfo("", "");
  591. break;
  592. }
  593. case "Exit":
  594. {
  595. this.Close();
  596. break;
  597. }
  598. case "Update":
  599. {
  600. proc_Edit();
  601. break;
  602. }
  603. case "Delete":
  604. {
  605. proc_Del();
  606. break;
  607. }
  608. }
  609. }
  610. private void ulgridBaseInfo_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
  611. {
  612. try
  613. {
  614. if (ugrdBaseInfo.ActiveRow == null)
  615. return;
  616. FrmVT frm = new FrmVT(ob);
  617. frm.Tag = this;
  618. frm.strID = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["ID"].Value);
  619. frm.strNO = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["槽车编号"].Value);
  620. frm.strRHS = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["RH炉号"].Value);
  621. frm.strSTATUS = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["状态"].Value);
  622. frm.ShowDialog();
  623. }
  624. catch (Exception ex)
  625. {
  626. MessageBox.Show(ex.Message, "提示");
  627. }
  628. }
  629. private void ulgridBaseInfo_AfterRowActivate(object sender, EventArgs e)
  630. {
  631. try
  632. {
  633. if (ugrdBaseInfo.ActiveRow == null)
  634. return;
  635. string strID = Convert.ToString(ugrdBaseInfo.ActiveRow.Cells["ID"].Value);
  636. proc_GetUseInfo(strID);
  637. proc_GetHotInfo(strID);
  638. }
  639. catch (Exception ex)
  640. {
  641. MessageBox.Show(ex.Message, "提示");
  642. }
  643. }
  644. private void ulgridUseInfo_AfterRowActivate(object sender, EventArgs e)
  645. {
  646. try
  647. {
  648. if (ugrdUseInfo.ActiveRow == null)
  649. return;
  650. Infragistics.Win.UltraWinGrid.UltraGridRow ulRow = ugrdUseInfo.ActiveRow;
  651. txtID.Text = Convert.ToString(ulRow.Cells["槽车编号"].Value);
  652. ucmeCCM.Text = Convert.ToString(ulRow.Cells["RH炉号"].Value);
  653. ucmeStatus.Text = Convert.ToString(ulRow.Cells["状态"].Value);
  654. txtLJCS.Text = Convert.ToString(ulRow.Cells["累计使用炉数"].Value);
  655. txtDQCS.Text = Convert.ToString(ulRow.Cells["本次使用炉数"].Value);
  656. txtOBCS.Text = Convert.ToString(ulRow.Cells["累计真空处理时间"].Value);
  657. txtNO1.Text = Convert.ToString(ulRow.Cells["ID1"].Value);
  658. txtCS1.Text = Convert.ToString(ulRow.Cells["CS1"].Value);
  659. txtNO2.Text = Convert.ToString(ulRow.Cells["ID2"].Value);
  660. txtCS2.Text = Convert.ToString(ulRow.Cells["CS2"].Value);
  661. txtNO3.Text = Convert.ToString(ulRow.Cells["ID3"].Value);
  662. txtCS3.Text = Convert.ToString(ulRow.Cells["CS3"].Value);
  663. udteOnTime.Text = Convert.ToString(ulRow.Cells["上线时间"].Value);
  664. udteNextTime.Text = Convert.ToString(ulRow.Cells["下线时间"].Value);
  665. txtMemo.Text = Convert.ToString(ulRow.Cells["备注"].Value);
  666. }
  667. catch (Exception ex)
  668. {
  669. MessageBox.Show(ex.Message, "提示");
  670. }
  671. }
  672. private void chkID_CheckedChanged(object sender, EventArgs e)
  673. {
  674. ucmeID.Enabled = chkID.Checked;
  675. }
  676. private void cbCCM_CheckedChanged(object sender, EventArgs e)
  677. {
  678. ucmeRHS.Enabled = chkRHS.Checked;
  679. proc_LoadCLID();
  680. }
  681. private void cbbZJH_SelectedIndexChanged(object sender, EventArgs e)
  682. {
  683. proc_LoadCLID();
  684. }
  685. private void cbDate_CheckedChanged(object sender, EventArgs e)
  686. {
  687. udteFrom.Enabled = chkDate.Checked;
  688. udteTo.Enabled = chkDate.Checked;
  689. }
  690. private void NumberEditor_KeyPress(object sender, KeyPressEventArgs e)
  691. {
  692. if (!(Char.IsNumber(e.KeyChar) || e.KeyChar == '\b' || e.KeyChar == '.') ||
  693. (((TextBox)(sender)).Text.Trim().Contains(".") && e.KeyChar == '.') ||
  694. (((TextBox)(sender)).Text.Trim().Length == 0 && e.KeyChar == '.'))
  695. {
  696. e.Handled = true;
  697. }
  698. }
  699. }
  700. }