FrmVBBaseInfo.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  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 FrmVBBaseInfo : Core.Mes.Client.Common.frmStyleBase
  14. {
  15. bool bOK = false; //是否响应段位号选择改变事件
  16. public string strNo = "", strCCM = "",strVBNo="";
  17. public FrmVBBaseInfo(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 == '.') || (((TextBox)(sender)).Text.Trim().Contains(".") && e.KeyChar == '.'))
  25. {
  26. e.Handled = true;
  27. }
  28. }
  29. private void FrmCLBaseInfoBP_Load(object sender, EventArgs e)
  30. {
  31. //proc_LoadCLID();
  32. if (strCCM.Length > 0)
  33. {
  34. cmbCCM.Text = strCCM;
  35. cmbVBType.Text = strVBNo;
  36. this.cbbCCM_SelectedIndexChanged(this, null);
  37. if (strNo.Length > 0)
  38. {
  39. cmbID.Text = strNo;
  40. bOK = true;
  41. this.cbbID_SelectedIndexChanged(this, null);
  42. }
  43. }
  44. else
  45. bOK = true;
  46. }
  47. private void proc_GetID(string strCCM)
  48. {
  49. try
  50. {
  51. if (strCCM.Length == 0)
  52. return;
  53. string strErr = "";
  54. ArrayList arry = new ArrayList();
  55. if (strCCM == "1#连铸机" || strCCM == "2#连铸机")
  56. {
  57. arry.Add("OneandTwoCCM.select");
  58. }
  59. else
  60. {
  61. arry.Add("VBCRYSTALLIZERID.select");
  62. arry.Add(strCCM);
  63. }
  64. CommonClientToServer ccs = new CommonClientToServer();
  65. ccs.ob = this.ob;
  66. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  67. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  68. {
  69. MessageBox.Show("段位号加载失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  70. if (MessageBox.Show("是否重新加载结段位号?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
  71. proc_GetID(strCCM);
  72. return;
  73. }
  74. cmbID.DataSource = ds.Tables[0];
  75. cmbID.DisplayMember = "CRYSTALLIZERID";
  76. if (ds.Tables[0].Rows.Count == 0)
  77. proc_ResetControl();
  78. }
  79. catch (Exception ex)
  80. {
  81. MessageBox.Show(ex.Message);
  82. }
  83. }
  84. private void proc_ResetControl()
  85. {
  86. try
  87. {
  88. cmbID.Text = "";
  89. txtCS.Clear();
  90. txtTgl.Clear();
  91. txtCS1.Clear();
  92. txtCS2.Clear();
  93. txtCS3.Clear();
  94. txtCS4.Clear();
  95. cmbID5.SelectedIndex = -1;
  96. txtCS5.Clear();
  97. cmbID6.SelectedIndex = -1;
  98. txtCS6.Clear();
  99. txtStatus.Clear();
  100. txtPos.Clear();
  101. udtePTime.DateTime = DateTime.Now;
  102. udteBuyTime.DateTime = DateTime.Now;
  103. txtMemo.Clear();
  104. }
  105. catch (Exception ex)
  106. {
  107. MessageBox.Show(ex.Message);
  108. }
  109. }
  110. /// <summary>
  111. /// 段位基本信息增加
  112. /// </summary>
  113. private void proc_Add()
  114. {
  115. try
  116. {
  117. string strCcm = cmbCCM.Text.Trim();
  118. string strID = cmbID.Text.Trim();
  119. string strType = cmbVBType.Text.Trim();
  120. if (strCcm.Length == 0)
  121. {
  122. MessageBox.Show("请选择铸机号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  123. cmbCCM.Focus();
  124. return;
  125. }
  126. if (strID.Length == 0)
  127. {
  128. MessageBox.Show("请输入编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  129. cmbID.Focus();
  130. return;
  131. }
  132. string strErr = "";
  133. ArrayList arry = new ArrayList();
  134. arry.Add("FrmVBBaseInfoBP");
  135. arry.Add(strCcm);
  136. arry.Add(strID);
  137. CommonClientToServer ccs = new CommonClientToServer();
  138. ccs.ob = this.ob;
  139. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery",
  140. "doSimpleQuery", arry, out strErr);
  141. int iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  142. if (iCnt > 0)
  143. {
  144. MessageBox.Show("[" + strCCM + "]已存在" + strType + "[" + strID + "],不能重复录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  145. cmbID.Focus();
  146. return;
  147. }
  148. string strReturn = "";
  149. strErr = "";
  150. arry.Clear();
  151. #region//修改段位铜板水箱信息
  152. CommonClientToServer cctos = new CommonClientToServer();
  153. #endregion
  154. strErr = "";
  155. arry.Clear();
  156. strReturn = "";
  157. arry.Add("FrmVBBaseInfoBP.ADD");
  158. arry.Add(strID);
  159. arry.Add(cmbVBType.Text=="垂直段"?"1":"2");
  160. arry.Add(txtCS.Text.Trim() == "" ? "0" : txtCS.Text.Trim());
  161. arry.Add(txtTgl.Text.Trim() == "" ? "0" : txtTgl.Text.Trim());
  162. arry.Add(udtePTime.DateTime.ToString("yyyy-MM-dd"));
  163. arry.Add(udteBuyTime.DateTime.ToString("yyyy-MM-dd"));
  164. arry.Add(txtMemo.Text.Trim());
  165. arry.Add(strCcm);
  166. arry.Add("");
  167. arry.Add("");
  168. arry.Add("");
  169. arry.Add("");
  170. arry.Add("");
  171. arry.Add("");
  172. arry.Add(txtOutAge.Text.Trim());
  173. arry.Add(txtInnerAge.Text.Trim());
  174. arry.Add(txtLeftAge.Text.Trim());
  175. arry.Add(txtRightAge.Text.Trim());
  176. //添加铜板对应使用炉数
  177. arry.Add(txtCS1.Text.Trim());
  178. arry.Add(txtCS2.Text.Trim());
  179. arry.Add(txtCS3.Text.Trim());
  180. arry.Add(txtCS4.Text.Trim());
  181. strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
  182. if (!(strErr == null || strErr == ""))
  183. {
  184. MessageBox.Show("新增[" + strCcm + "]" + strType + "[" + strID + "]失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  185. return;
  186. }
  187. FrmVBManage frm = (FrmVBManage)this.Tag;
  188. frm.proc_GetBaseInfo(strCcm, strID);
  189. proc_GetID(strCcm);
  190. MessageBox.Show("新增[" + strCcm + "]" + strType + "[" + strID + "]成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  191. return;
  192. }
  193. catch (Exception ex)
  194. {
  195. MessageBox.Show(ex.Message);
  196. }
  197. }
  198. /// <summary>
  199. /// 段位基本信息修改
  200. /// </summary>
  201. private void proc_Edit()
  202. {
  203. try
  204. {
  205. if (cmbID.Items.Count == 0)
  206. return;
  207. string strCcm = cmbCCM.Text.Trim();
  208. string strID = cmbID.Text.Trim();
  209. string strType = cmbVBType.Text.Trim();
  210. if (strID.Length == 0)
  211. {
  212. MessageBox.Show("请选择需要修改的段位编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  213. cmbID.Focus();
  214. return;
  215. }
  216. #region
  217. #endregion
  218. if (MessageBox.Show("确定要修改[" + strCcm + "]的" + strType + "[" + strID + "]信息吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  219. return;
  220. string strErr = "";
  221. string strReturn = "";
  222. ArrayList arry = new ArrayList();
  223. arry.Add("FrmVBBaseInfoBP_Edit.select");
  224. arry.Add(strCcm);
  225. arry.Add(strID);
  226. CommonClientToServer ccs = new CommonClientToServer();
  227. ccs.ob = this.ob;
  228. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  229. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  230. {
  231. MessageBox.Show("[" + strCcm + "]" + strType + "[" + strID + "]信息修改失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  232. return;
  233. }
  234. string str1 = "", str2 = "", str3 = "", str4 = "";
  235. string str5 = "", str6 = "", str7 = "";
  236. if (ds.Tables[0].Rows.Count > 0)
  237. {
  238. str1 = Convert.ToString(ds.Tables[0].Rows[0]["NOWSTATUS"]);
  239. str2 = Convert.ToString(ds.Tables[0].Rows[0]["OUTERCOPPER"]);
  240. str3 = Convert.ToString(ds.Tables[0].Rows[0]["INNERCOPPER"]);
  241. str4 = Convert.ToString(ds.Tables[0].Rows[0]["LEFTCOPPER"]);
  242. str5 = Convert.ToString(ds.Tables[0].Rows[0]["RIGHTCOPPER"]);
  243. str6 = Convert.ToString(ds.Tables[0].Rows[0]["OUTERWATER"]);
  244. str7 = Convert.ToString(ds.Tables[0].Rows[0]["INNERWATER"]);
  245. }
  246. strErr = "";
  247. #region//修改段位铜板水箱信息
  248. CommonClientToServer cctos = new CommonClientToServer();
  249. cctos.ob = this.ob;
  250. #endregion//修改段位铜板水箱信息
  251. //根据流号获取段位编号和周期编号
  252. ArrayList arryCry = new ArrayList();
  253. arryCry.Add("FrmVBCryByCcmsId.Query");
  254. arryCry.Add(txtPos.Text.Trim());
  255. DataSet dsCry = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arryCry, out strErr);
  256. strErr = "";
  257. arry.Clear();
  258. cctos.ob = this.ob;
  259. arry.Add("FrmVBBaseInfoBP.Edit");
  260. arry.Add(cmbVBType.Text == "垂直段" ? "1" : "2");
  261. arry.Add(strCcm);
  262. arry.Add(txtCS.Text.Trim() == "" ? "0" : txtCS.Text.Trim());
  263. arry.Add(txtTgl.Text.Trim() == "" ? "0" : txtTgl.Text.Trim());
  264. arry.Add(txtOutAge.Text.Trim() == "" ? "0" : txtOutAge.Text.Trim());
  265. arry.Add(txtInnerAge.Text.Trim() == "" ? "0" : txtInnerAge.Text.Trim());
  266. arry.Add(txtLeftAge.Text.Trim() == "" ? "0" : txtLeftAge.Text.Trim());
  267. arry.Add(txtRightAge.Text.Trim() == "" ? "0" : txtRightAge.Text.Trim());
  268. arry.Add(txtCS1.Text.Trim() == "" ? "0" : txtCS1.Text.Trim());
  269. arry.Add(txtCS2.Text.Trim() == "" ? "0" : txtCS2.Text.Trim());
  270. arry.Add(txtCS3.Text.Trim() == "" ? "0" : txtCS3.Text.Trim());
  271. arry.Add(txtCS4.Text.Trim() == "" ? "0" : txtCS4.Text.Trim());
  272. arry.Add("");
  273. arry.Add("");
  274. arry.Add("");
  275. arry.Add("");
  276. arry.Add("");
  277. arry.Add("");
  278. arry.Add(udtePTime.DateTime.ToString("yyyy-MM-dd"));
  279. arry.Add(udteBuyTime.DateTime.ToString("yyyy-MM-dd"));
  280. arry.Add(txtMemo.Text.Trim());
  281. arry.Add(strCCM);
  282. arry.Add(strID);
  283. strReturn = cctos.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
  284. //修改段位使用信息
  285. ArrayList arryU = new ArrayList();
  286. arryU.Add("FrmVB_User_Detail.Edit");
  287. arryU.Add(txtCS1.Text.Trim() == "" ? "0" : txtCS1.Text.Trim());
  288. arryU.Add(txtCS2.Text.Trim() == "" ? "0" : txtCS2.Text.Trim());
  289. arryU.Add(txtCS3.Text.Trim() == "" ? "0" : txtCS3.Text.Trim());
  290. arryU.Add(txtCS4.Text.Trim() == "" ? "0" : txtCS4.Text.Trim());
  291. arryU.Add(txtOutAge.Text.Trim() == "" ? "0" : txtOutAge.Text.Trim());
  292. arryU.Add(txtInnerAge.Text.Trim() == "" ? "0" : txtInnerAge.Text.Trim());
  293. arryU.Add(txtLeftAge.Text.Trim() == "" ? "0" : txtLeftAge.Text.Trim());
  294. arryU.Add(txtRightAge.Text.Trim() == "" ? "0" : txtRightAge.Text.Trim());
  295. arryU.Add(cmbVBType.Text == "垂直段" ? "1" : "2");
  296. arryU.Add(dsCry.Tables[0].Rows.Count>0 ? dsCry.Tables[0].Rows[0]["CRYSTALLIZERID"].ToString():"");
  297. arryU.Add(dsCry.Tables[0].Rows.Count > 0 ? dsCry.Tables[0].Rows[0]["CYCID"].ToString() : "");
  298. strReturn = cctos.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arryU, out strErr);
  299. if (!(strErr == null || strErr == ""))
  300. {
  301. MessageBox.Show("[" + strCcm + "]" + strType + "[" + strID + "]信息修改失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  302. return;
  303. }
  304. FrmVBManage frm = (FrmVBManage)this.Tag;
  305. frm.proc_GetBaseInfo(strCcm, strID);
  306. proc_GetID(strCcm);
  307. MessageBox.Show("[" + strCcm + "]" + strType + "[" + strID + "]信息修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  308. return;
  309. }
  310. catch (Exception ex)
  311. {
  312. MessageBox.Show(ex.Message);
  313. }
  314. }
  315. /// <summary>
  316. /// 段位基础信息删除
  317. /// </summary>
  318. private void proc_Del()
  319. {
  320. try
  321. {
  322. if (cmbID.Items.Count == 0)
  323. return;
  324. string strCcm = cmbCCM.Text.Trim();
  325. string strID = cmbID.Text.Trim();
  326. string strType = cmbVBType.Text.Trim();
  327. if (strID.Length == 0)
  328. {
  329. MessageBox.Show("请选择需要删除的" + strType + "编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  330. cmbID.Focus();
  331. return;
  332. }
  333. if (MessageBox.Show("确定要删除[" + strCcm + "]" + strType + "[" + strID + "]的信息吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  334. return;
  335. string strErr = "";
  336. ArrayList arry = new ArrayList();
  337. arry.Add("FrmVBBaseInfoBP_Del_Select");
  338. arry.Add(strCcm);
  339. arry.Add(strID);
  340. CommonClientToServer ccs = new CommonClientToServer();
  341. ccs.ob = this.ob;
  342. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  343. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  344. {
  345. MessageBox.Show("[" + strCcm + "]" + strType + "[" + strID + "]信息删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  346. return;
  347. }
  348. int iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  349. if (iCnt == 0)
  350. {
  351. MessageBox.Show("[" + strCcm + "]不存在" + strType + "[" + strID + "]信息,无法删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  352. cmbID.Focus();
  353. return;
  354. }
  355. iCnt = 0;
  356. ds = null;
  357. strErr = "";
  358. arry.Clear();
  359. ccs.ob = this.ob;
  360. arry.Add("FrmVBBaseInfoBP_Del_Select_1");
  361. arry.Add(strCcm);
  362. arry.Add(strID);
  363. ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  364. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  365. {
  366. MessageBox.Show("[" + strCcm + "]" + strType + "[" + strID + "]信息删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  367. return;
  368. }
  369. iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  370. if (iCnt > 0)
  371. {
  372. MessageBox.Show("[" + strCcm + "]" + strType + "[" + strID + "]存在使用记录,不能删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  373. cmbID.Focus();
  374. return;
  375. }
  376. iCnt = 0;
  377. ds = null;
  378. strErr = "";
  379. arry.Clear();
  380. ccs.ob = this.ob;
  381. arry.Add("FrmVBBaseInfoBP_Del_Select_2");
  382. arry.Add(strCcm);
  383. arry.Add(strID);
  384. ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  385. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  386. {
  387. MessageBox.Show("[" + strCcm + "]" + strType + "[" + strID + "]信息删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  388. return;
  389. }
  390. iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  391. if (iCnt > 0)
  392. {
  393. MessageBox.Show("[" + strCcm + "]" + strType + "[" + strID + "]存在维修记录,不能删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  394. cmbID.Focus();
  395. return;
  396. }
  397. strErr = "";
  398. arry.Clear();
  399. arry.Add("FrmVBBaseInfoBP_Del.Delect");
  400. arry.Add(strCcm);
  401. arry.Add(strID);
  402. string strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
  403. if (!(strErr == null || strErr == ""))
  404. {
  405. MessageBox.Show("[" + strCcm + "]" + strType + "[" + strID + "]信息删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  406. return;
  407. }
  408. FrmVBManage frm = (FrmVBManage)this.Tag;
  409. frm.proc_GetBaseInfo(strCcm, "");
  410. proc_GetID(strCcm);
  411. MessageBox.Show("[" + strCcm + "]" + strType + "[" + strID + "]信息删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  412. return;
  413. }
  414. catch (Exception ex)
  415. {
  416. MessageBox.Show(ex.Message);
  417. }
  418. }
  419. private TextBox proc_GetTextBox(string strComboBoxName)
  420. {
  421. switch (strComboBoxName)
  422. {
  423. case "cbbID1":
  424. {
  425. return txtCS1;
  426. }
  427. case "cbbID2":
  428. {
  429. return txtCS2;
  430. }
  431. case "cbbID3":
  432. {
  433. return txtCS3;
  434. }
  435. case "cbbID4":
  436. {
  437. return txtCS4;
  438. }
  439. case "cbbID5":
  440. {
  441. return txtCS5;
  442. }
  443. case "cbbID6":
  444. {
  445. return txtCS6;
  446. }
  447. }
  448. return null;
  449. }
  450. private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  451. {
  452. switch (e.ClickedItem.Name)
  453. {
  454. case "ADD":
  455. {
  456. this.proc_Add();
  457. break;
  458. }
  459. case "EDIT":
  460. {
  461. this.proc_Edit();
  462. break;
  463. }
  464. case "DEL":
  465. {
  466. this.proc_Del();
  467. break;
  468. }
  469. case "CLOSE":
  470. {
  471. this.Close();
  472. break;
  473. }
  474. default:
  475. break;
  476. }
  477. }
  478. /// <铸机号属性更改时>
  479. /// 铸机号属性更改时
  480. /// </summary>
  481. /// <param name="sender"></param>
  482. /// <param name="e"></param>
  483. private void cbbCCM_SelectedIndexChanged(object sender, EventArgs e)
  484. {
  485. if (cmbCCM.Text.Length > 0)
  486. {
  487. proc_GetID(cmbCCM.Text);
  488. }
  489. }
  490. /// <段位属性更改时>
  491. /// 段位属性更改时
  492. /// </summary>
  493. /// <param name="sender"></param>
  494. /// <param name="e"></param>
  495. private void cbbID_SelectedIndexChanged(object sender, EventArgs e)
  496. {
  497. try
  498. {
  499. if (!bOK)
  500. return;
  501. string strCCM = cmbCCM.Text.Trim();
  502. string strID = cmbID.Text.Trim();
  503. string strType = cmbVBType.Text.Trim();
  504. if (strID.Length == 0)
  505. return;
  506. string strErr = "";
  507. ArrayList arry = new ArrayList();
  508. arry.Add("VBcbbID.Select");
  509. arry.Add(strID);
  510. arry.Add(strCCM);
  511. CommonClientToServer ccs = new CommonClientToServer();
  512. ccs.ob = this.ob;
  513. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  514. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  515. {
  516. MessageBox.Show("" + strType + "[" + strID + "]信息查询失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  517. return;
  518. }
  519. if (ds.Tables[0].Rows.Count == 0) return;
  520. cmbVBType.Text = Convert.ToString(ds.Tables[0].Rows[0]["TYPE"]);
  521. txtCS.Text = Convert.ToString(ds.Tables[0].Rows[0]["CUPRUMCANALTIME"]);
  522. txtTgl.Text = Convert.ToString(ds.Tables[0].Rows[0]["AGE"]);
  523. txtStatus.Text = Convert.ToString(ds.Tables[0].Rows[0]["NOWSTATUS"]);
  524. txtPos.Text = Convert.ToString(ds.Tables[0].Rows[0]["CCM_S_ID"]);
  525. udtePTime.DateTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["CREATIVEDATE"]);
  526. udteBuyTime.DateTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["BUYDATE"]);
  527. txtMemo.Text = Convert.ToString(ds.Tables[0].Rows[0]["MEMO"]);
  528. txtOutAge.Text = Convert.ToString(ds.Tables[0].Rows[0]["OUTAGE"]);
  529. txtInnerAge.Text = Convert.ToString(ds.Tables[0].Rows[0]["INNERAGE"]);
  530. txtLeftAge.Text = Convert.ToString(ds.Tables[0].Rows[0]["LEFTAGE"]);
  531. txtRightAge.Text = Convert.ToString(ds.Tables[0].Rows[0]["RIGHTAGE"]);
  532. txtCS1.Text = Convert.ToString(ds.Tables[0].Rows[0]["OUTTIMES"]);
  533. txtCS2.Text = Convert.ToString(ds.Tables[0].Rows[0]["INNERTIMES"]);
  534. txtCS3.Text = Convert.ToString(ds.Tables[0].Rows[0]["LEFTTIMES"]);
  535. txtCS4.Text = Convert.ToString(ds.Tables[0].Rows[0]["RIGHTTIMES"]);
  536. }
  537. catch { }
  538. }
  539. }
  540. }