FrmCLRepair.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  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 CoreFS.CA06;
  9. using Core.Mes.Client.Common;
  10. namespace Core.LgMes.Client.LgDeviceManager
  11. {
  12. public partial class FrmCLRepair : frmModelFormStyle
  13. {
  14. bool bOK = false; //是否响应结晶器号选择改变事件
  15. public string strNo = "", strCCM = "";
  16. OpeBase ob = null;
  17. public FrmCLRepair(OpeBase oba)
  18. {
  19. InitializeComponent();
  20. ob = oba;
  21. }
  22. private void FrmCLRepair_Load(object sender, EventArgs e)
  23. {
  24. if (strCCM.Length > 0)
  25. {
  26. ucmbCCM.Text = strCCM;
  27. this.cbbCCM_SelectedIndexChanged(this, null);
  28. if (strNo.Length > 0)
  29. {
  30. ucmbID.Text = strNo;
  31. bOK = true;
  32. this.cbbID_SelectedIndexChanged(this, null);
  33. }
  34. }
  35. else
  36. {
  37. bOK = true;
  38. proc_ResetControl();
  39. btnBegin.Enabled = btnEnd.Enabled = false;
  40. }
  41. }
  42. private void NumberEditor_KeyPress(object sender, KeyPressEventArgs e)
  43. {
  44. if (!(Char.IsNumber(e.KeyChar) || e.KeyChar == '\b'))
  45. {
  46. e.Handled = true;
  47. }
  48. }
  49. /// <summary>
  50. /// 结晶器编号查询
  51. /// </summary>
  52. /// <param name="strCCM"></param>
  53. private void proc_GetID(string strCCM)
  54. {
  55. try
  56. {
  57. if (strCCM.Length == 0)
  58. return;
  59. string strErr = "";
  60. string strSql = "select CRYSTALLIZERID from DEV_JJQ_BASE_INFO where CCM_ID = '" + strCCM + "' order by length(CRYSTALLIZERID), CRYSTALLIZERID";
  61. CoreClientParam ccp = new CoreClientParam();
  62. ccp.ServerName = "Core.LgMes.Server.DEV.Methods.DEVPublicMethods";
  63. ccp.MethodName = "QueryMethods";
  64. ccp.ServerParams = new Object[] { strSql };
  65. DataTable dt = new DataTable();
  66. ccp.SourceDataTable = dt;
  67. ob.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  68. DataSet ds = new DataSet();
  69. ds.Tables.Add(dt);
  70. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  71. {
  72. MessageBox.Show("结晶器号加载失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  73. if (MessageBox.Show("是否重新加载结晶器号?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
  74. proc_GetID(strCCM);
  75. return;
  76. }
  77. ucmbID.Items.Clear();
  78. for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
  79. {
  80. ucmbID.Items.Add(ds.Tables[0].Rows[i][0]);
  81. }
  82. if (ds.Tables[0].Rows.Count == 0)
  83. {
  84. proc_ResetControl();
  85. btnBegin.Enabled = btnEnd.Enabled = false;
  86. }
  87. }
  88. catch (Exception ex)
  89. {
  90. MessageBox.Show(ex.Message);
  91. }
  92. }
  93. private void proc_ResetControl()
  94. {
  95. try
  96. {
  97. ucmbID.Text = "";
  98. ucmbType.SelectedIndex = -1;
  99. udteRepair.Text = "";
  100. udteRepairTime.Text = "";
  101. ucmbReason.Text = "";
  102. txtTGBHCurr.Clear();
  103. txtTGBHDest.Clear();
  104. txtTBCScurr.Clear();
  105. txtTBCSDest.Clear();
  106. txtMemo.Clear();
  107. }
  108. catch (Exception ex)
  109. {
  110. MessageBox.Show(ex.Message);
  111. }
  112. }
  113. /// <summary>
  114. /// 维修开始
  115. /// </summary>
  116. private void proc_Begin()
  117. {
  118. try
  119. {
  120. if (ucmbID.Items.Count == 0)
  121. return;
  122. string strCcm = ucmbCCM.Text.Trim();
  123. string strID = ucmbID.Text.Trim();
  124. if (strID.Length == 0)
  125. {
  126. MessageBox.Show("请选择需要维修的结晶器编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  127. ucmbID.Focus();
  128. return;
  129. }
  130. string strType = ucmbType.Text.Trim();
  131. if (strType.Length == 0)
  132. {
  133. MessageBox.Show("请选择维修类别!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  134. ucmbType.Focus();
  135. return;
  136. }
  137. if (udteRepair.Text.Trim().Length == 0)
  138. udteRepair.DateTime = DateTime.Now;
  139. if (MessageBox.Show("确定要维修[" + strCcm + "]的结晶器[" + strID + "]吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  140. {
  141. proc_GetID(strCcm);
  142. return;
  143. }
  144. string strErr = "";
  145. string strSql = "select count(1) from DEV_JJQ_BASE_INFO where CCM_ID = '" + strCcm + "' and CRYSTALLIZERID = '" + strID + "'";
  146. CoreClientParam ccp = new CoreClientParam();
  147. ccp.ServerName = "Core.LgMes.Server.DEV.Methods.DEVPublicMethods";
  148. ccp.MethodName = "QueryMethods";
  149. ccp.ServerParams = new Object[] { strSql };
  150. DataTable dt = new DataTable();
  151. ccp.SourceDataTable = dt;
  152. ob.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  153. DataSet ds = new DataSet();
  154. ds.Tables.Add(dt);
  155. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  156. {
  157. MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  158. return;
  159. }
  160. int iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  161. if (iCnt == 0)
  162. {
  163. MessageBox.Show("[" + strCcm + "]不存在结晶器[" + strID + "]信息,无法维修!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  164. proc_GetID(strCcm);
  165. ucmbID.Focus();
  166. return;
  167. }
  168. iCnt = 0;
  169. ds = null;
  170. dt = null;
  171. strErr = "";
  172. strSql = "select case NOWSTATUS when '0' then '下线' when '1' then '上线' when '2' then '维修' when '3' then '备用' end NOWSTATUS from DEV_JJQ_BASE_INFO where CCM_ID = '" + strCcm + "' and CRYSTALLIZERID = '" + strID + "'";
  173. CoreClientParam ccp1 = new CoreClientParam();
  174. ccp1.ServerName = "Core.LgMes.Server.DEV.Methods.DEVPublicMethods";
  175. ccp1.MethodName = "QueryMethods";
  176. ccp1.ServerParams = new Object[] { strSql };
  177. DataTable dtt = new DataTable();
  178. ccp1.SourceDataTable = dtt;
  179. ob.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
  180. DataSet dss = new DataSet();
  181. dss.Tables.Add(dtt);
  182. if (strErr != "" || !(dss != null && dss.Tables.Count > 0 && dss.Tables[0].Rows.Count > 0))
  183. {
  184. MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  185. return;
  186. }
  187. if (Convert.ToString(dss.Tables[0].Rows[0]["NOWSTATUS"]).ToString().Trim() != "下线")
  188. {
  189. MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]当前状态[" + Convert.ToString(dss.Tables[0].Rows[0]["NOWSTATUS"]) + "],只有在[下线]状态才能维修!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  190. ucmbID.Focus();
  191. return;
  192. }
  193. strErr = "";
  194. strSql = "insert into DEV_TOOL_REPAIR (REPAIRID, TOOLTYPEID, REPAIRTOOLID, REPAIRTYPE, REPAIRTIME, REASON, MEMO, RECORDER) "
  195. + "values "
  196. + "("
  197. + "(select nvl(max(REPAIRID),100000001) + 1 from DEV_TOOL_REPAIR),"
  198. + "'2',"
  199. + "(select ID from DEV_JJQ_BASE_INFO where CRYSTALLIZERID = '" + strID + "' and CCM_ID = '" + strCcm + "'),"
  200. + "'" + strType + "',"
  201. + "to_date('" + udteRepair.DateTime.ToString("yyyy-MM-dd HH:mm:ss") + "','yyyy-MM-dd HH24:mi:ss'),"
  202. + "'" + ucmbReason.Text.Trim() + "',"
  203. + "'" + txtMemo.Text.Trim() + "',"
  204. + "'" + CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName() + "' "
  205. + ")";
  206. CoreClientParam ccp_K = new CoreClientParam();
  207. ccp_K.ServerName = "Core.LgMes.Server.DEV.Methods.DEVPublicMethods";
  208. ccp_K.MethodName = "UpdateMethods";
  209. ccp_K.ServerParams = new Object[] { strSql };
  210. ob.ExecuteNonQuery(ccp_K, CoreInvokeType.Internal);
  211. if (!(strErr == null || strErr == ""))
  212. {
  213. MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  214. return;
  215. }
  216. strErr = "";
  217. strSql = "update DEV_JJQ_BASE_INFO set NOWSTATUS = '2', CCM_S_ID = null, "
  218. + "OUTERCOPPER = '" + txtTGBHDest.Text.Trim() + "', "
  219. + "CUPRUMCANALTIME = '" + txtTBCSDest.Text.Trim() + "' "
  220. + "where CCM_ID = '" + strCcm + "' and CRYSTALLIZERID = '" + strID + "'";
  221. CoreClientParam ccp_up = new CoreClientParam();
  222. ccp_up.ServerName = "Core.LgMes.Server.DEV.Methods.DEVPublicMethods";
  223. ccp_up.MethodName = "UpdateMethods";
  224. ccp_up.ServerParams = new Object[] { strSql };
  225. ob.ExecuteNonQuery(ccp_up, CoreInvokeType.Internal);
  226. FrmCrystallizerManage frm = (FrmCrystallizerManage)this.Tag;
  227. frm.proc_GetBaseInfo(strCcm, strID);
  228. proc_GetID(strCcm);
  229. MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  230. btnBegin.Enabled = false;
  231. btnEnd.Enabled = true;
  232. return;
  233. }
  234. catch (Exception ex)
  235. {
  236. MessageBox.Show(ex.Message);
  237. }
  238. }
  239. /// <summary>
  240. /// 维修结束
  241. /// </summary>
  242. private void proc_End()
  243. {
  244. try
  245. {
  246. if (ucmbID.Items.Count == 0)
  247. return;
  248. string strCcm = ucmbCCM.Text.Trim();
  249. string strID = ucmbID.Text.Trim();
  250. if (strID.Length == 0)
  251. {
  252. MessageBox.Show("请选择维修中的结晶器编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  253. ucmbID.Focus();
  254. return;
  255. }
  256. string strType = ucmbType.Text.Trim();
  257. if (strType.Length == 0)
  258. {
  259. MessageBox.Show("请选择维修类别!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  260. ucmbType.Focus();
  261. return;
  262. }
  263. if (udteRepairTime.Text.Trim().Length == 0)
  264. udteRepairTime.DateTime = DateTime.Now;
  265. if (udteRepair.DateTime > udteRepairTime.DateTime)
  266. {
  267. MessageBox.Show("送修时间不能大于修复时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
  268. udteRepairTime.Focus();
  269. return;
  270. }
  271. if (MessageBox.Show("确定[" + strCcm + "]结晶器[" + strID + "]维修结束吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  272. {
  273. proc_GetID(strCcm);
  274. return;
  275. }
  276. string strErr = "";
  277. string strSql = "select count(1) from DEV_JJQ_BASE_INFO where CCM_ID = '" + strCcm + "' and CRYSTALLIZERID = '" + strID + "'";
  278. CoreClientParam ccp = new CoreClientParam();
  279. ccp.ServerName = "Core.LgMes.Server.DEV.Methods.DEVPublicMethods";
  280. ccp.MethodName = "QueryMethods";
  281. ccp.ServerParams = new Object[] { strSql };
  282. DataTable dt = new DataTable();
  283. ccp.SourceDataTable = dt;
  284. ob.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  285. DataSet ds = new DataSet();
  286. ds.Tables.Add(dt);
  287. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  288. {
  289. MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  290. return;
  291. }
  292. int iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  293. if (iCnt == 0)
  294. {
  295. MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]信息不存在,无法保存维修信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  296. proc_GetID(strCcm);
  297. ucmbID.Focus();
  298. return;
  299. }
  300. iCnt = 0;
  301. ds = null;
  302. strErr = "";
  303. strSql = "select case NOWSTATUS when '0' then '下线' when '1' then '上线' when '2' then '维修' when '3' then '备用' end NOWSTATUS from DEV_JJQ_BASE_INFO where CCM_ID = '" + strCcm + "' and CRYSTALLIZERID = '" + strID + "'";
  304. CoreClientParam ccp1 = new CoreClientParam();
  305. ccp1.ServerName = "Core.LgMes.Server.DEV.Methods.DEVPublicMethods";
  306. ccp1.MethodName = "QueryMethods";
  307. ccp1.ServerParams = new Object[] { strSql };
  308. DataTable dtt = new DataTable();
  309. ccp1.SourceDataTable = dtt;
  310. ob.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
  311. DataSet dss = new DataSet();
  312. dss.Tables.Add(dtt);
  313. if (strErr != "" || !(dss != null && dss.Tables.Count > 0 && dss.Tables[0].Rows.Count > 0))
  314. {
  315. MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  316. return;
  317. }
  318. if (Convert.ToString(dss.Tables[0].Rows[0]["NOWSTATUS"]).Trim() != "维修")
  319. {
  320. MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]当前状态[" + Convert.ToString(dss.Tables[0].Rows[0]["NOWSTATUS"]) + "],只有在[维修]状态才能结束维修!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  321. ucmbID.Focus();
  322. return;
  323. }
  324. strErr = "";
  325. strSql = "update DEV_TOOL_REPAIR set "
  326. + "REPAIRTYPE = '" + strType + "',"
  327. + "REPAIRTIME = to_date('" + udteRepair.DateTime.ToString("yyyy-MM-dd HH:mm:ss") + "','yyyy-MM-dd HH24:mi:ss'),"
  328. + "REPAIREDTIME = to_date('" + udteRepairTime.DateTime.ToString("yyyy-MM-dd HH:mm:ss") + "','yyyy-MM-dd HH24:mi:ss'),"
  329. + "REASON = '" + ucmbReason.Text.Trim() + "',"
  330. + "MEMO = '" + txtMemo.Text.Trim() + "',"
  331. + "RECORDER = '" + CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName() + "' "
  332. + "where TOOLTYPEID = '2' and REPAIREDTIME is null and REPAIRTOOLID = "
  333. + "(select ID from DEV_JJQ_BASE_INFO where CRYSTALLIZERID = '" + strID + "' and CCM_ID = '" + strCcm + "')";
  334. CoreClientParam ccp_up = new CoreClientParam();
  335. ccp_up.ServerName = "Core.LgMes.Server.DEV.Methods.DEVPublicMethods";
  336. ccp_up.MethodName = "UpdateMethods";
  337. ccp_up.ServerParams = new Object[] { strSql };
  338. ob.ExecuteNonQuery(ccp_up, CoreInvokeType.Internal);
  339. if (!(strErr == null || strErr == ""))
  340. {
  341. MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  342. return;
  343. }
  344. strErr = "";
  345. strSql = "update DEV_JJQ_BASE_INFO set NOWSTATUS = '3', CCM_S_ID = null, "
  346. + "OUTERCOPPER = '" + txtTGBHDest.Text.Trim() + "', "
  347. + "CUPRUMCANALTIME = '" + txtTBCSDest.Text.Trim() + "' "
  348. + "where CCM_ID = '" + strCcm + "' and CRYSTALLIZERID = '" + strID + "'";
  349. CoreClientParam ccp_u = new CoreClientParam();
  350. ccp_u.ServerName = "Core.LgMes.Server.DEV.Methods.DEVPublicMethods";
  351. ccp_u.MethodName = "UpdateMethods";
  352. ccp_u.ServerParams = new Object[] { strSql };
  353. ob.ExecuteNonQuery(ccp_u, CoreInvokeType.Internal);
  354. //if (!(strErr == null || strErr == ""))
  355. //{
  356. // MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  357. // return;
  358. //}
  359. FrmCrystallizerManage frm = (FrmCrystallizerManage)this.Tag;
  360. frm.proc_GetBaseInfo(strCcm, strID);
  361. proc_GetID(strCcm);
  362. MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  363. btnBegin.Enabled = true;
  364. btnEnd.Enabled =false ;
  365. return;
  366. }
  367. catch (Exception ex)
  368. {
  369. MessageBox.Show(ex.Message);
  370. }
  371. }
  372. private void btnBegin_Click(object sender, EventArgs e)
  373. {
  374. proc_Begin();
  375. }
  376. private void btnEnd_Click(object sender, EventArgs e)
  377. {
  378. proc_End();
  379. }
  380. private void cbbCCM_SelectedIndexChanged(object sender, EventArgs e)
  381. {
  382. if (ucmbCCM.Text.Length > 0)
  383. {
  384. ucmbID.SelectedIndex = -1;
  385. proc_GetID(ucmbCCM.Text);
  386. }
  387. }
  388. private void cbbID_SelectedIndexChanged(object sender, EventArgs e)
  389. {
  390. try
  391. {
  392. if (!bOK)
  393. return;
  394. string strCcm = ucmbCCM.Text.Trim();
  395. string strID = ucmbID.Text.Trim();
  396. if (strID.Length == 0)
  397. {
  398. ucmbType.SelectedIndex = -1;
  399. udteRepair.Text = "";
  400. udteRepairTime.Text = "";
  401. ucmbReason.Text = "";
  402. txtTGBHCurr.Clear();
  403. txtTGBHDest.Clear();
  404. txtTBCScurr.Clear();
  405. txtTBCSDest.Clear();
  406. txtMemo.Clear();
  407. btnBegin.Enabled = btnEnd.Enabled = false;
  408. return;
  409. }
  410. string strErr = "";
  411. string strSql = "select REPAIRTYPE, REPAIRTIME, REASON, MEMO from DEV_TOOL_REPAIR "
  412. + "where TOOLTYPEID = '2' and REPAIREDTIME is null and REPAIRTOOLID = "
  413. + "(select ID from DEV_JJQ_BASE_INFO where CRYSTALLIZERID = '" + strID + "' and CCM_ID = '" + strCcm + "')";
  414. CoreClientParam ccp = new CoreClientParam();
  415. ccp.ServerName = "Core.LgMes.Server.DEV.Methods.DEVPublicMethods";
  416. ccp.MethodName = "QueryMethods";
  417. ccp.ServerParams = new Object[] { strSql };
  418. DataTable dt = new DataTable();
  419. ccp.SourceDataTable = dt;
  420. ob.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  421. DataSet ds = new DataSet();
  422. ds.Tables.Add(dt);
  423. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  424. {
  425. MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]维修信息查询失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  426. return;
  427. }
  428. if (ds.Tables[0].Rows.Count > 0)
  429. {
  430. ucmbType.Text = Convert.ToString(ds.Tables[0].Rows[0]["REPAIRTYPE"]);
  431. udteRepair.DateTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["REPAIRTIME"]);
  432. udteRepairTime.Text = "";
  433. ucmbReason.Text = Convert.ToString(ds.Tables[0].Rows[0]["REASON"]);
  434. txtMemo.Text = Convert.ToString(ds.Tables[0].Rows[0]["MEMO"]);
  435. btnBegin.Enabled = false;
  436. }
  437. else
  438. {
  439. ucmbType.SelectedIndex = -1;
  440. udteRepair.Text = "";
  441. udteRepairTime.Text = "";
  442. ucmbReason.Text = "";
  443. txtMemo.Clear();
  444. btnBegin.Enabled = true;
  445. }
  446. btnEnd.Enabled = !btnBegin.Enabled;
  447. strSql = "select OUTERCOPPER, CUPRUMCANALTIME from DEV_JJQ_BASE_INFO where CRYSTALLIZERID = '" + strID + "' and CCM_ID = '" + strCcm + "'";
  448. CoreClientParam ccp1 = new CoreClientParam();
  449. ccp1.ServerName = "Core.LgMes.Server.DEV.Methods.DEVPublicMethods";
  450. ccp1.MethodName = "QueryMethods";
  451. ccp1.ServerParams = new Object[] { strSql };
  452. DataTable dtt = new DataTable();
  453. ccp1.SourceDataTable = dtt;
  454. ob.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
  455. DataSet dss = new DataSet();
  456. dss.Tables.Add(dtt);
  457. if (strErr != "" || !(dss != null && dss.Tables.Count > 0))
  458. {
  459. MessageBox.Show("[" + strCcm + "]结晶器[" + strID + "]基本信息查询失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  460. return;
  461. }
  462. if (dss.Tables[0].Rows.Count > 0)
  463. {
  464. txtTGBHCurr.Text = txtTGBHDest.Text = Convert.ToString(dss.Tables[0].Rows[0]["OUTERCOPPER"]);
  465. txtTBCScurr.Text = txtTBCSDest.Text = Convert.ToString(dss.Tables[0].Rows[0]["CUPRUMCANALTIME"]);
  466. }
  467. }
  468. catch (Exception ex)
  469. {
  470. MessageBox.Show(ex.Message, "提示");
  471. }
  472. }
  473. }
  474. }