FrmVTBaseInfo.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  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. using System.Collections;
  11. namespace Core.LgMes.Client.LgDeviceManager
  12. {
  13. public partial class FrmVTBaseInfo : Core.Mes.Client.Common.frmStyleBase
  14. {
  15. bool bOK = false; //是否响应槽车号选择改变事件
  16. public string strNo = "", strRHS = "";
  17. public FrmVTBaseInfo(OpeBase oba)
  18. {
  19. InitializeComponent();
  20. ob = oba;
  21. }
  22. private void txtAge_KeyPress(object sender, KeyPressEventArgs e)
  23. {
  24. if (!(Char.IsNumber(e.KeyChar) || e.KeyChar == '\b' || e.KeyChar == '.') ||
  25. (((TextBox)(sender)).Text.Trim().Contains(".") && e.KeyChar == '.') ||
  26. (((TextBox)(sender)).Text.Trim().Length == 0 && e.KeyChar == '.'))
  27. {
  28. e.Handled = true;
  29. }
  30. }
  31. private void FrmVTBaseInfo_Load(object sender, EventArgs e)
  32. {
  33. if (strRHS.Length > 0)
  34. {
  35. cbbRHS.Text = strRHS;
  36. this.cbbCCM_SelectedIndexChanged(this, null);
  37. if (strNo.Length > 0)
  38. {
  39. cbbID.Text = strNo;
  40. bOK = true;
  41. this.cbbID_SelectedIndexChanged(this, null);
  42. }
  43. }
  44. else
  45. bOK = true;
  46. }
  47. /// <summary>
  48. /// 槽车号加载
  49. /// </summary>
  50. /// <param name="strRHS"></param>
  51. private void proc_GetID(string strRHS)
  52. {
  53. try
  54. {
  55. if (strRHS.Length == 0)
  56. return;
  57. string strErr = "";
  58. ArrayList arry = new ArrayList();
  59. arry.Add("FrmVTBaseInfo_Query1");
  60. arry.Add(strRHS);
  61. CommonClientToServer ccs = new CommonClientToServer();
  62. ccs.ob = this.ob;
  63. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  64. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  65. {
  66. MessageBox.Show("槽车号加载失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  67. if (MessageBox.Show("是否重新加载槽车号?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
  68. proc_GetID(strRHS);
  69. return;
  70. }
  71. cbbID.DataSource = ds.Tables[0];
  72. cbbID.DisplayMember = "TANKCARID";
  73. if (ds.Tables[0].Rows.Count == 0)
  74. proc_ResetControl();
  75. }
  76. catch (Exception ex)
  77. {
  78. MessageBox.Show(ex.Message);
  79. }
  80. }
  81. /// <summary>
  82. /// 槽车槽号信息加载
  83. /// </summary>
  84. /// <param name="strRHS"></param>
  85. /// <param name="strID"></param>
  86. private void proc_GetPluginInfo(string strRHS, string strID)
  87. {
  88. try
  89. {
  90. if (strRHS.Length == 0)
  91. return;
  92. string strErr = "";
  93. ArrayList arry = new ArrayList();
  94. arry.Add("FrmVTBaseInfoLoad_Query");
  95. arry.Add(strRHS);
  96. CommonClientToServer ccs = new CommonClientToServer();
  97. ccs.ob = this.ob;
  98. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  99. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  100. {
  101. MessageBox.Show("槽车槽号信息加载失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  102. if (MessageBox.Show("是否重新加载槽车槽号信息?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
  103. proc_GetPluginInfo(strRHS, strID);
  104. return;
  105. }
  106. if (ds.Tables[0].Rows.Count > 0)
  107. {
  108. DataRow dr = ds.Tables[0].NewRow();
  109. dr["ID"] = "0";
  110. dr["PLUGINNO"] = "";
  111. ds.Tables[0].Rows.InsertAt(dr, 0);
  112. cbbID1.DataSource = ds.Tables[0].DefaultView;
  113. cbbID1.ValueMember = "ID";
  114. cbbID1.DisplayMember = "PLUGINNO";
  115. //cbbID2.DataSource = ds.Tables[0].Copy().DefaultView;
  116. //cbbID2.ValueMember = "ID";
  117. //cbbID2.DisplayMember = "PLUGINNO";
  118. //cbbID3.DataSource = ds.Tables[0].Copy().DefaultView;
  119. //cbbID3.ValueMember = "ID";
  120. //cbbID3.DisplayMember = "PLUGINNO";
  121. }
  122. }
  123. catch (Exception ex)
  124. {
  125. MessageBox.Show(ex.Message);
  126. }
  127. }
  128. private void proc_ResetControl()
  129. {
  130. try
  131. {
  132. cbbID.Text = "";
  133. tbCS.Clear();
  134. tbStatus.Clear();
  135. cbbID1.SelectedIndex = -1;
  136. tbCS1.Clear();
  137. cbbID2.SelectedIndex = -1;
  138. tbCS2.Clear();
  139. cbbID3.SelectedIndex = -1;
  140. tbCS3.Clear();
  141. ultraDateTimeEditor1.DateTime = DateTime.Now;
  142. ultraDateTimeEditor2.DateTime = DateTime.Now;
  143. tbMemo.Clear();
  144. }
  145. catch (Exception ex)
  146. {
  147. MessageBox.Show(ex.Message);
  148. }
  149. }
  150. /// <summary>
  151. /// 槽车基础信息增加
  152. /// </summary>
  153. private void proc_Add()
  154. {
  155. try
  156. {
  157. string strRHS = cbbRHS.SelectedIndex < 0 ? "" : cbbRHS.Text.Trim();
  158. string strID = cbbID.Text.Trim();
  159. if (strRHS.Length == 0)
  160. {
  161. MessageBox.Show("请选择RH炉号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  162. cbbRHS.Focus();
  163. return;
  164. }
  165. cbbID1.SelectedIndex = (cbbID1.SelectedIndex < 0 ? 0 : cbbID1.SelectedIndex);
  166. if (strID.Length == 0)
  167. {
  168. MessageBox.Show("请输入槽车编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  169. cbbID.Focus();
  170. return;
  171. }
  172. if (cbbID1.SelectedIndex <-1 )
  173. {
  174. MessageBox.Show("请选择槽号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  175. cbbID2.Focus();
  176. return;
  177. }
  178. string strErr = "";
  179. ArrayList arry = new ArrayList();
  180. arry.Add("FrmVTBaseInfo_Query5");
  181. arry.Add(strRHS);
  182. arry.Add(strID);
  183. CommonClientToServer ccs = new CommonClientToServer();
  184. ccs.ob = this.ob;
  185. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  186. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  187. {
  188. MessageBox.Show("新增[" + strRHS + "]槽车[" + strID + "]失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  189. return;
  190. }
  191. int iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  192. if (iCnt > 0)
  193. {
  194. MessageBox.Show("[" + strRHS + "]已存在槽车[" + strID + "],不能重复录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  195. cbbID.Focus();
  196. return;
  197. }
  198. string strReturn = "";
  199. //1
  200. strErr = "";
  201. arry.Clear();
  202. arry.Add("FrmVTBaseInfo_Update.1");
  203. arry.Add(tbCS1.Text.Trim());
  204. arry.Add(cbbID1.SelectedValue.ToString());
  205. ccs.ob = this.ob;
  206. strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
  207. strErr = "";
  208. arry.Clear();
  209. arry.Add("FrmVTBaseInfo_ADD.1");
  210. arry.Add(strID);
  211. arry.Add(tbCS.Text.Trim() == "" ? "0" : tbCS.Text.Trim());
  212. arry.Add(ultraDateTimeEditor1.DateTime.ToString("yyyy-MM-dd"));
  213. arry.Add(ultraDateTimeEditor2.DateTime.ToString("yyyy-MM-dd"));
  214. arry.Add(tbMemo.Text.Trim());
  215. arry.Add(strRHS);
  216. arry.Add(cbbID1.SelectedValue.ToString());
  217. ccs.ob = this.ob;
  218. strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
  219. if (!(strErr == null || strErr == ""))
  220. {
  221. MessageBox.Show("新增[" + strRHS + "]槽车[" + strID + "]失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  222. return;
  223. }
  224. FrmVacuumTankManage frm = (FrmVacuumTankManage)this.Tag;
  225. frm.proc_GetBaseInfo(strRHS, strID);
  226. proc_GetID(strRHS);
  227. MessageBox.Show("新增[" + strRHS + "]槽车[" + strID + "]成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  228. return;
  229. }
  230. catch (Exception ex)
  231. {
  232. MessageBox.Show(ex.Message);
  233. }
  234. }
  235. /// <summary>
  236. /// 槽车基础信息修改
  237. /// </summary>
  238. private void proc_Edit()
  239. {
  240. try
  241. {
  242. if (cbbID.Items.Count == 0)
  243. return;
  244. string strRHS = cbbRHS.Text.Trim();
  245. string strID = cbbID.Text.Trim();
  246. cbbID1.SelectedIndex = (cbbID1.SelectedIndex < 0 ? 0 : cbbID1.SelectedIndex);
  247. if (strID.Length == 0)
  248. {
  249. MessageBox.Show("请选择需要修改的槽车编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  250. cbbID.Focus();
  251. return;
  252. }
  253. if (MessageBox.Show("确定要修改[" + strRHS + "]的槽车[" + strID + "]信息吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  254. return;
  255. if (cbbID1.SelectedIndex < -1)
  256. {
  257. MessageBox.Show("请选择槽号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  258. cbbID2.Focus();
  259. return;
  260. }
  261. string strErr = "";
  262. ArrayList arry = new ArrayList();
  263. arry.Add("FrmVTBaseInfo_Query6");
  264. arry.Add(strRHS);
  265. arry.Add(strID);
  266. CommonClientToServer ccs = new CommonClientToServer();
  267. ccs.ob = this.ob;
  268. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  269. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  270. {
  271. MessageBox.Show("[" + strRHS + "]槽车[" + strID + "]信息修改失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  272. return;
  273. }
  274. if (ds.Tables[0].Rows.Count == 0)
  275. {
  276. MessageBox.Show("[" + strRHS + "]不存在槽车[" + strID + "]信息,无法修改!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  277. cbbID.Focus();
  278. return;
  279. }
  280. string str1 = Convert.ToString(ds.Tables[0].Rows[0]["NOWSTATUS"]);
  281. string str2 = Convert.ToString(ds.Tables[0].Rows[0]["TOPID"]);
  282. string str3 = Convert.ToString(ds.Tables[0].Rows[0]["MIDDLEID"]);
  283. string str4 = Convert.ToString(ds.Tables[0].Rows[0]["BOTTOMID"]);
  284. if (str1 == "1" &&
  285. !((str2 == cbbID1.SelectedValue.ToString())))
  286. {
  287. MessageBox.Show("[" + strRHS + "]槽车[" + strID + "]当前处于[上线]状态,不能修改槽号信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  288. return;
  289. }
  290. #region//修改真空槽信息
  291. string strReturn = "";
  292. strErr = "";
  293. arry.Clear();
  294. arry.Add("FrmVTBaseInfo_Update.1");
  295. arry.Add(tbCS1.Text.Trim());
  296. arry.Add(cbbID1.SelectedValue.ToString());
  297. ccs.ob = this.ob;
  298. strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
  299. #endregion
  300. strErr = "";
  301. arry.Clear();
  302. arry.Add("FrmVTBaseInfo_Update.2");
  303. arry.Add((tbCS.Text.Trim() == "" ? "0" : tbCS.Text.Trim()));
  304. arry.Add(cbbID1.SelectedValue.ToString());
  305. arry.Add(ultraDateTimeEditor1.DateTime.ToString("yyyy-MM-dd"));
  306. arry.Add(ultraDateTimeEditor2.DateTime.ToString("yyyy-MM-dd"));
  307. arry.Add(tbMemo.Text.Trim());
  308. arry.Add(strRHS);
  309. arry.Add(strID);
  310. ccs.ob = this.ob;
  311. strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
  312. if (!(strErr == null || strErr == ""))
  313. {
  314. MessageBox.Show("[" + strRHS + "]槽车[" + strID + "]信息修改失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  315. return;
  316. }
  317. FrmVacuumTankManage frm = (FrmVacuumTankManage)this.Tag;
  318. frm.proc_GetBaseInfo(strRHS, strID);
  319. proc_GetID(strRHS);
  320. MessageBox.Show("[" + strRHS + "]槽车[" + strID + "]信息修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  321. return;
  322. }
  323. catch (Exception ex)
  324. {
  325. MessageBox.Show(ex.Message);
  326. }
  327. }
  328. /// <summary>
  329. /// 槽车基础信息删除
  330. /// </summary>
  331. private void proc_Del()
  332. {
  333. try
  334. {
  335. if (cbbID.Items.Count == 0)
  336. return;
  337. string strRHS = cbbRHS.Text.Trim();
  338. string strID = cbbID.Text.Trim();
  339. if (strID.Length == 0)
  340. {
  341. MessageBox.Show("请选择需要删除的槽车编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  342. cbbID.Focus();
  343. return;
  344. }
  345. if (MessageBox.Show("确定要删除[" + strRHS + "]槽车[" + strID + "]的信息吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  346. return;
  347. string strErr = "";
  348. ArrayList arry = new ArrayList();
  349. arry.Add("FrmVTBaseInfo_Query7");
  350. arry.Add(strRHS);
  351. arry.Add(strID);
  352. CommonClientToServer ccs = new CommonClientToServer();
  353. ccs.ob = this.ob;
  354. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  355. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  356. {
  357. MessageBox.Show("[" + strRHS + "]槽车[" + strID + "]信息删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  358. return;
  359. }
  360. int iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  361. if (iCnt == 0)
  362. {
  363. MessageBox.Show("[" + strRHS + "]不存在槽车[" + strID + "]信息,无法删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  364. cbbID.Focus();
  365. return;
  366. }
  367. iCnt = 0;
  368. ds = null;
  369. strErr = "";
  370. arry.Clear();
  371. ccs.ob = this.ob;
  372. arry.Add("FrmVTBaseInfo_Query8");
  373. arry.Add(strRHS);
  374. arry.Add(strID);
  375. ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  376. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  377. {
  378. MessageBox.Show("[" + strRHS + "]槽车[" + strID + "]信息删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  379. return;
  380. }
  381. iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  382. if (iCnt > 0)
  383. {
  384. MessageBox.Show("[" + strRHS + "]槽车[" + strID + "]存在使用记录,不能删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  385. cbbID.Focus();
  386. return;
  387. }
  388. iCnt = 0;
  389. ds = null;
  390. strErr = "";
  391. arry.Clear();
  392. ccs.ob = this.ob;
  393. arry.Add("FrmVTBaseInfo_Query9");
  394. arry.Add(strRHS);
  395. arry.Add(strID);
  396. ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  397. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  398. {
  399. MessageBox.Show("[" + strRHS + "]槽车[" + strID + "]信息删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  400. return;
  401. }
  402. iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  403. if (iCnt > 0)
  404. {
  405. MessageBox.Show("[" + strRHS + "]槽车[" + strID + "]存在烘烤记录,不能删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  406. cbbID.Focus();
  407. return;
  408. }
  409. string strReturn = "";
  410. strErr = "";
  411. arry.Clear();
  412. ccs.ob = this.ob;
  413. arry.Add("FrmVTBaseInfo_Del.1");
  414. arry.Add(strRHS);
  415. arry.Add(strID);
  416. strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
  417. if (!(strErr == null || strErr == ""))
  418. {
  419. MessageBox.Show("[" + strRHS + "]槽车[" + strID + "]信息删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  420. return;
  421. }
  422. FrmVacuumTankManage frm = (FrmVacuumTankManage)this.Tag;
  423. frm.proc_GetBaseInfo(strRHS, "");
  424. proc_GetID(strRHS);
  425. MessageBox.Show("[" + strRHS + "]槽车[" + strID + "]信息删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  426. return;
  427. }
  428. catch (Exception ex)
  429. {
  430. MessageBox.Show(ex.Message);
  431. }
  432. }
  433. private TextBox proc_GetTextBox(string strComboBoxName)
  434. {
  435. switch (strComboBoxName)
  436. {
  437. case "cbbID1":
  438. {
  439. return tbCS1;
  440. }
  441. case "cbbID2":
  442. {
  443. return tbCS2;
  444. }
  445. case "cbbID3":
  446. {
  447. return tbCS3;
  448. }
  449. }
  450. return null;
  451. }
  452. private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  453. {
  454. switch (e.ClickedItem.Name)
  455. {
  456. case "ADD":
  457. {
  458. this.proc_Add();
  459. break;
  460. }
  461. case "EDIT":
  462. {
  463. this.proc_Edit();
  464. break;
  465. }
  466. case "DEL":
  467. {
  468. this.proc_Del();
  469. break;
  470. }
  471. case "CLOSE":
  472. {
  473. this.Close();
  474. break;
  475. }
  476. default:
  477. break;
  478. }
  479. }
  480. private void cbbCCM_SelectedIndexChanged(object sender, EventArgs e)
  481. {
  482. if (cbbRHS.Text.Length > 0)
  483. {
  484. proc_GetPluginInfo(cbbRHS.Text, "");
  485. proc_GetID(cbbRHS.Text);
  486. }
  487. }
  488. /// <summary>
  489. /// 槽车号事件
  490. /// </summary>
  491. /// <param name="sender"></param>
  492. /// <param name="e"></param>
  493. private void cbbID_SelectedIndexChanged(object sender, EventArgs e)
  494. {
  495. try
  496. {
  497. proc_GetPluginInfo(cbbRHS.Text.Trim(), cbbID.Text.ToString());
  498. if (!bOK)
  499. return;
  500. string strRHS = cbbRHS.Text.Trim();
  501. string strID = cbbID.Text.Trim();
  502. if (strID.Length == 0)
  503. return;
  504. string strErr = "";
  505. ArrayList arry = new ArrayList();
  506. arry.Add("FrmVTBaseInfo_Query3");
  507. arry.Add(strID);
  508. arry.Add(strRHS);
  509. CommonClientToServer ccs = new CommonClientToServer();
  510. ccs.ob = this.ob;
  511. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  512. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  513. {
  514. MessageBox.Show("槽车[" + strID + "]信息查询失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  515. return;
  516. }
  517. if (ds.Tables[0].Rows.Count == 0) return;
  518. tbCS.Text = Convert.ToString(ds.Tables[0].Rows[0]["AGE"]);
  519. cbbID1.SelectedValue = Convert.ToString(ds.Tables[0].Rows[0]["ID1"]);
  520. tbCS1.Text = Convert.ToString(ds.Tables[0].Rows[0]["CS1"]);
  521. tbStatus.Text = Convert.ToString(ds.Tables[0].Rows[0]["NOWSTATUS"]);
  522. ultraDateTimeEditor1.DateTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["CREATIVEDATE"]);
  523. ultraDateTimeEditor2.DateTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["BUYDATE"]);
  524. tbMemo.Text = Convert.ToString(ds.Tables[0].Rows[0]["MEMO"]);
  525. }
  526. catch { }
  527. }
  528. /// <summary>
  529. /// 上中下槽号事件
  530. /// </summary>
  531. /// <param name="sender"></param>
  532. /// <param name="e"></param>
  533. private void PlugIn_SelectedIndexChanged(object sender, EventArgs e)
  534. {
  535. try
  536. {
  537. ComboBox cbb = sender as ComboBox;
  538. if (cbb == null) return;
  539. if (!(cbb is ComboBox)) return;
  540. string str = cbb.SelectedValue.ToString();
  541. if (cbb.SelectedItem != null)
  542. {
  543. DataRowView rowView = (DataRowView)cbb.SelectedItem;
  544. str = rowView.Row["ID"].ToString();
  545. }
  546. if (str.Length == 0) return;
  547. string strErr = "";
  548. ArrayList arry = new ArrayList();
  549. arry.Add("FrmVTBaseInfo_Query4");
  550. arry.Add(str);
  551. CommonClientToServer ccs = new CommonClientToServer();
  552. ccs.ob = this.ob;
  553. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  554. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  555. {
  556. return;
  557. }
  558. proc_GetTextBox(cbb.Name).Text = Convert.ToString(ds.Tables[0].Rows[0]["USETIMES"]);
  559. }
  560. catch { }
  561. }
  562. }
  563. }