FrmCLPluginInfo.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  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 Core.Mes.Client.Common;
  10. using CoreFS.CA06;
  11. namespace Core.LgMes.Client.LgDeviceManager
  12. {
  13. public partial class FrmCLPluginInfo : Core.Mes.Client.Common.frmStyleBase//frmModelFormStyle
  14. {
  15. public FrmCLPluginInfo(OpeBase oba)
  16. {
  17. InitializeComponent();
  18. ob = oba;
  19. }
  20. private void FrmCLPluginInfo_Load(object sender, EventArgs e)
  21. {
  22. udteBuyTime.DateTime = DateTime.Today;
  23. proc_LoadPluginID();
  24. proc_Query("", "", "");
  25. }
  26. private void cbCCM_CheckedChanged(object sender, EventArgs e)
  27. {
  28. cmbCCM.Enabled = chkCCM.Checked;
  29. }
  30. private void cbType_CheckedChanged(object sender, EventArgs e)
  31. {
  32. cmbType.Enabled = chkType.Checked;
  33. }
  34. private void cbID_CheckedChanged(object sender, EventArgs e)
  35. {
  36. cmbID.Enabled = chkID.Checked;
  37. }
  38. private void cbbCCM_SelectedIndexChanged(object sender, EventArgs e)
  39. {
  40. proc_LoadPluginID();
  41. }
  42. private void cbbType_SelectedIndexChanged(object sender, EventArgs e)
  43. {
  44. proc_LoadPluginID();
  45. }
  46. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  47. {
  48. try
  49. {
  50. if (ultraGrid1.Rows.Count == 0) return;
  51. if (ultraGrid1.ActiveRow == null) return;
  52. cmbZJH.Text = Convert.ToString(ultraGrid1.ActiveRow.Cells["铸机号"].Value);
  53. txtNO.Text = Convert.ToString(ultraGrid1.ActiveRow.Cells["编号"].Value);
  54. cmbLB.Text = Convert.ToString(ultraGrid1.ActiveRow.Cells["类别"].Value);
  55. txtCS.Text = Convert.ToString(ultraGrid1.ActiveRow.Cells["使用炉数"].Value);
  56. udteBuyTime.DateTime = Convert.ToDateTime(ultraGrid1.ActiveRow.Cells["购买日期"].Value);
  57. txtMemo.Text = Convert.ToString(ultraGrid1.ActiveRow.Cells["备注"].Value);
  58. }
  59. catch (Exception ex)
  60. {
  61. MessageBox.Show(ex.Message);
  62. }
  63. }
  64. private void proc_ExecuteCommand_Return(object[] obj, out DataSet ds, out string strErr)
  65. {
  66. //CallingMessage par = new CallingMessage();
  67. //par.ServerName = "LgDeviceManager";
  68. //par.AssemblyName = "Core.LgMes.Server.LgDeviceManager";
  69. //par.ClassName = "Core.LgMes.Server.LgDeviceManager.jjqmanager";
  70. //par.MethodName = "ExecuteCommand_Return";
  71. //par.args = obj;
  72. strErr = "";
  73. ds =null;// ClientCommon._RemotingHelp.ExecuteMethod(par, out strErr) as DataSet;
  74. }
  75. /// <summary>
  76. /// 删除 不用
  77. /// </summary>
  78. /// <param name="obj"></param>
  79. /// <param name="strErr"></param>
  80. private void proc_ExecuteCommand_NonReturn(object[] obj, out string strErr)
  81. {
  82. //CallingMessage par = new CallingMessage();
  83. //par.ServerName = "LgDeviceManager";
  84. //par.AssemblyName = "Core.LgMes.Server.LgDeviceManager";
  85. //par.ClassName = "Core.LgMes.Server.LgDeviceManager.jjqmanager";
  86. //par.MethodName = "ExecuteCommand_NonReturn";
  87. //par.args = obj;
  88. //ClientCommon._RemotingHelp.ExecuteMethod(par, out strErr);
  89. strErr = "";
  90. }
  91. private void proc_ResetControl()
  92. {
  93. try
  94. {
  95. cmbZJH.SelectedIndex = -1;
  96. txtNO.Clear();
  97. cmbLB.SelectedIndex = -1;
  98. txtCS.Clear();
  99. txtMemo.Clear();
  100. }
  101. catch { }
  102. }
  103. /// <铜板水箱编号查询>
  104. /// 铜板水箱编号查询
  105. /// </summary>
  106. private void proc_LoadPluginID()
  107. {
  108. try
  109. {
  110. string srtCCM_ID = "";
  111. string srtTYPE = "";
  112. if (cmbCCM.SelectedIndex > -1)
  113. {
  114. srtCCM_ID = cmbCCM.Text.Trim();//铸机号
  115. }
  116. if (cmbType.SelectedIndex > -1)
  117. {
  118. srtTYPE = cmbType.SelectedIndex.ToString();//类型
  119. }
  120. string strErr = "";
  121. ArrayList arry = new ArrayList();
  122. arry.Add("proc_LoadPluginID.Select");
  123. arry.Add(srtCCM_ID);
  124. arry.Add(srtCCM_ID);
  125. arry.Add(srtTYPE);
  126. arry.Add(srtTYPE);
  127. CommonClientToServer ccs = new CommonClientToServer();
  128. ccs.ob = this.ob;
  129. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  130. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  131. {
  132. MessageBox.Show("铜板水箱编号加载失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  133. if (MessageBox.Show("是否重新加载铜板水箱编号?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
  134. proc_LoadPluginID();
  135. return;
  136. }
  137. cmbID.ResetText();
  138. cmbID.DataSource = ds.Tables[0];
  139. cmbID.DisplayMember = "PLUGINNO";
  140. }
  141. catch (Exception ex)
  142. {
  143. MessageBox.Show(ex.Message);
  144. }
  145. }
  146. /// <summary>
  147. /// 铜板水箱编号信息查询
  148. /// </summary>
  149. /// <param name="strCCM"></铸机号>
  150. /// <param name="strType"></类型>
  151. /// <param name="strID"></铜板水箱编号>
  152. private void proc_Query(string strCCM, string strType, string strID)
  153. {
  154. try
  155. {
  156. string strCCM_ID = "";
  157. string strTYPE = "";
  158. string strcbID = "";
  159. if (chkCCM.Checked && cmbCCM.SelectedIndex > -1)
  160. {
  161. strCCM_ID = cmbCCM.SelectedItem.ToString();
  162. }
  163. if (chkType.Checked && cmbType.SelectedIndex > -1)
  164. {
  165. strTYPE = cmbType.SelectedIndex.ToString();
  166. }
  167. if (chkID.Checked && cmbID.SelectedIndex > -1)
  168. {
  169. strcbID = cmbID.Text.Trim();
  170. }
  171. string strErr = "";
  172. ArrayList arry = new ArrayList();
  173. arry.Add("proc_Query.Select");
  174. arry.Add(strCCM_ID);
  175. arry.Add(strCCM_ID);
  176. arry.Add(strTYPE);
  177. arry.Add(strTYPE);
  178. arry.Add(strcbID);
  179. arry.Add(strcbID);
  180. CommonClientToServer ccs = new CommonClientToServer();
  181. ccs.ob = this.ob;
  182. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  183. if (strErr != "" || !(ds != null && ds.Tables.Count > 0))
  184. {
  185. MessageBox.Show("铜板水箱信息查询失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  186. return;
  187. }
  188. ultraGrid1.DataSource = ds.Tables[0];
  189. if (ds.Tables[0].Rows.Count == 0)
  190. {
  191. proc_ResetControl();
  192. return;
  193. }
  194. if (strCCM.Length > 0) //定位记录
  195. {
  196. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  197. {
  198. if (Convert.ToString(ultraGrid1.Rows[i].Cells["铸机号"].Value) == strCCM)
  199. {
  200. if (strType.Length > 0)
  201. {
  202. if (Convert.ToString(ultraGrid1.Rows[i].Cells["类别"].Value) == strType)
  203. {
  204. if (strID.Length > 0)
  205. {
  206. if (Convert.ToString(ultraGrid1.Rows[i].Cells["编号"].Value) == strID)
  207. {
  208. ultraGrid1.ActiveRow = ultraGrid1.Rows[i];
  209. ultraGrid1.Rows[i].Selected = true;
  210. return;
  211. }
  212. }
  213. else
  214. {
  215. ultraGrid1.ActiveRow = ultraGrid1.Rows[i];
  216. ultraGrid1.Rows[i].Selected = true;
  217. return;
  218. }
  219. }
  220. }
  221. else
  222. {
  223. ultraGrid1.ActiveRow = ultraGrid1.Rows[i];
  224. ultraGrid1.Rows[i].Selected = true;
  225. return;
  226. }
  227. }
  228. }
  229. }
  230. }
  231. catch (Exception ex)
  232. {
  233. MessageBox.Show(ex.Message);
  234. }
  235. }
  236. /// <summary>
  237. /// 结晶器铜板水箱信息增加
  238. /// </summary>
  239. private void proc_Add()
  240. {
  241. try
  242. {
  243. if (cmbZJH.SelectedIndex < 0)
  244. {
  245. MessageBox.Show("请选择铸机号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  246. cmbZJH.Focus();
  247. return;
  248. }
  249. if (txtNO.Text.Trim().Length == 0)
  250. {
  251. MessageBox.Show("请录入编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  252. txtNO.Focus();
  253. return;
  254. }
  255. if (cmbLB.SelectedIndex < 0)
  256. {
  257. MessageBox.Show("请选择类别!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  258. cmbLB.Focus();
  259. return;
  260. }
  261. string strCCM = cmbZJH.Text.Trim();
  262. string strNO = txtNO.Text.Trim();
  263. string strType = cmbLB.SelectedIndex.ToString();
  264. string strUseTimes = (txtCS.Text.Trim().Length == 0 ? "0" : txtCS.Text.Trim());
  265. string strDate = udteBuyTime.DateTime.ToString("yyyy-MM-dd");
  266. string strMemo = txtMemo.Text.Trim();
  267. string strErr = "";
  268. ArrayList arry = new ArrayList();
  269. arry.Add("proc_Add.Select");
  270. arry.Add(strCCM);
  271. arry.Add(strType);
  272. arry.Add(strNO);
  273. CommonClientToServer ccs = new CommonClientToServer();
  274. ccs.ob = this.ob;
  275. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  276. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  277. {
  278. MessageBox.Show("新增[" + strCCM + "][" + cmbLB.Text.Trim() + "][" + strNO + "]失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  279. return;
  280. }
  281. int iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  282. if (iCnt > 0)
  283. {
  284. MessageBox.Show("[" + strCCM + "]已存在[" + cmbLB.Text.Trim() + "][" + strNO + "],不能重复录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  285. txtNO.Focus();
  286. return;
  287. }
  288. strErr = "";
  289. arry.Clear();
  290. arry.Add("proc_Add.Add");
  291. arry.Add(strNO);
  292. arry.Add(strCCM);
  293. arry.Add(strType );
  294. arry.Add(strUseTimes);
  295. arry.Add(strDate);
  296. arry.Add(strMemo );
  297. string strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
  298. if (!(strErr == null || strErr == ""))
  299. {
  300. MessageBox.Show("新增[" + strCCM + "][" + cmbLB.Text.Trim() + "][" + strNO + "]失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  301. return;
  302. }
  303. strType = cmbLB.Text.Trim();
  304. proc_Query(strCCM, strType, strNO);
  305. MessageBox.Show("新增[" + strCCM + "][" + strType + "][" + strNO + "]成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  306. }
  307. catch (Exception ex)
  308. {
  309. MessageBox.Show(ex.Message);
  310. }
  311. }
  312. /// <summary>
  313. /// 铜板水箱编号信息修改
  314. /// </summary>
  315. private void proc_Edit()
  316. {
  317. try
  318. {
  319. if (ultraGrid1.Rows.Count == 0)
  320. return;
  321. if (ultraGrid1.ActiveRow == null)
  322. {
  323. MessageBox.Show("请选择您要修改的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  324. return;
  325. }
  326. if (cmbZJH.SelectedIndex < 0)
  327. {
  328. MessageBox.Show("请选择铸机号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  329. cmbZJH.Focus();
  330. return;
  331. }
  332. if (txtNO.Text.Trim().Length == 0)
  333. {
  334. MessageBox.Show("请录入编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  335. txtNO.Focus();
  336. return;
  337. }
  338. if (cmbLB.SelectedIndex < 0)
  339. {
  340. MessageBox.Show("请选择类别!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  341. cmbLB.Focus();
  342. return;
  343. }
  344. string strCCM = cmbZJH.Text.Trim();
  345. string strNO = txtNO.Text.Trim();
  346. string strType = cmbLB.SelectedIndex.ToString();
  347. string strUseTimes = (txtCS.Text.Trim().Length == 0 ? "0" : txtCS.Text.Trim());
  348. string strDate = udteBuyTime.DateTime.ToString("yyyy-MM-dd");
  349. string strMemo = txtMemo.Text.Trim();
  350. if (MessageBox.Show("确定要修改[" + strCCM + "][" + cmbLB.Text.Trim() + "][" + strNO + "]相关信息吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  351. return;
  352. string strErr = "";
  353. ArrayList arry = new ArrayList();
  354. arry.Add("proc_Edit.Select");
  355. arry.Add(strCCM);
  356. arry.Add(strType);
  357. arry.Add(strNO);
  358. CommonClientToServer ccs = new CommonClientToServer();
  359. ccs.ob = this.ob;
  360. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  361. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  362. {
  363. MessageBox.Show("[" + strCCM + "][" + cmbLB.Text.Trim() + "][" + strNO + "]信息修改失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  364. return;
  365. }
  366. int iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  367. if (iCnt == 0)
  368. {
  369. MessageBox.Show("[" + strCCM + "]不存在[" + cmbLB.Text.Trim() + "][" + strNO + "],无法修改!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  370. txtNO.Focus();
  371. return;
  372. }
  373. strErr = "";
  374. arry.Clear();
  375. arry.Add("proc_Edit.Edit");
  376. arry.Add(strUseTimes);//状态
  377. arry.Add(strDate);//购买时间
  378. arry.Add(strMemo);//备注
  379. arry.Add(strCCM);//铸机号
  380. arry.Add(strType);//类别
  381. arry.Add(strNO);//编号
  382. string strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
  383. if (!(strErr == null || strErr == ""))
  384. {
  385. MessageBox.Show("[" + strCCM + "][" + cmbLB.Text.Trim() + "][" + strNO + "]信息修改失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  386. return;
  387. }
  388. strType = cmbLB.Text.Trim();
  389. proc_Query(strCCM, strType, strNO);
  390. MessageBox.Show("[" + strCCM + "][" + strType + "][" + strNO + "]信息修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  391. }
  392. catch (Exception ex)
  393. {
  394. MessageBox.Show(ex.Message);
  395. }
  396. }
  397. /// <summary>
  398. /// 铜板水箱编号信息删除
  399. /// </summary>
  400. private void proc_Del()
  401. {
  402. try
  403. {
  404. if (ultraGrid1.Rows.Count == 0)
  405. return;
  406. if (ultraGrid1.ActiveRow == null)
  407. {
  408. MessageBox.Show("请选择您要删除的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  409. return;
  410. }
  411. string strID = Convert.ToString(ultraGrid1.ActiveRow.Cells["ID"].Value);
  412. string strNO = Convert.ToString(ultraGrid1.ActiveRow.Cells["编号"].Value);
  413. string strCCM = Convert.ToString(ultraGrid1.ActiveRow.Cells["铸机号"].Value);
  414. string strType = Convert.ToString(ultraGrid1.ActiveRow.Cells["类别"].Value);
  415. if (MessageBox.Show("确定要删除[" + strCCM + "][" + strType + "][" + strNO + "]信息吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  416. return;
  417. string strErr = "";
  418. ArrayList arry = new ArrayList();
  419. arry.Add("proc_Del.Select.Count");
  420. arry.Add(strID);
  421. CommonClientToServer ccs = new CommonClientToServer();
  422. ccs.ob = this.ob;
  423. DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  424. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  425. {
  426. MessageBox.Show("[" + strCCM + "][" + strType + "][" + strNO + "]信息删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  427. return;
  428. }
  429. int iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  430. if (iCnt == 0)
  431. {
  432. MessageBox.Show("[" + strCCM + "]不存在[" + strType + "][" + strNO + "],无法删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  433. txtNO.Focus();
  434. return;
  435. }
  436. strErr = "";
  437. arry.Clear();
  438. ds.Clear();
  439. arry.Add("proc_D.Select");
  440. arry.Add(strID);
  441. arry.Add(strID);
  442. arry.Add(strID);
  443. arry.Add(strID);
  444. arry.Add(strID);
  445. arry.Add(strID);
  446. ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  447. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  448. {
  449. MessageBox.Show("[" + strCCM + "][" + strType + "][" + strNO + "]信息删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  450. return;
  451. }
  452. iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  453. if (iCnt > 0)
  454. {
  455. MessageBox.Show("[" + strCCM + "][" + strType + "][" + strNO + "]存在使用记录,不能删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  456. txtNO.Focus();
  457. return;
  458. }
  459. strErr = "";
  460. arry.Clear();
  461. ds.Clear();
  462. arry.Add("proc_.Select");
  463. arry.Add(strID);
  464. arry.Add(strID);
  465. arry.Add(strID);
  466. arry.Add(strID);
  467. arry.Add(strID);
  468. arry.Add(strID);
  469. ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
  470. if (strErr != "" || !(ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
  471. {
  472. MessageBox.Show("[" + strCCM + "][" + strType + "][" + strNO + "]信息删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  473. return;
  474. }
  475. iCnt = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
  476. if (iCnt > 0)
  477. {
  478. MessageBox.Show("[" + strCCM + "][" + strType + "][" + strNO + "]存在使用记录,不能删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  479. txtNO.Focus();
  480. return;
  481. }
  482. strErr = "";
  483. arry.Clear();
  484. arry.Add("proc_Del.Delect");
  485. arry.Add(strID);
  486. string strReturn = ccs.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave", "doSimpleSave", arry, out strErr);
  487. if (!(strErr == null || strErr == ""))
  488. {
  489. MessageBox.Show("[" + strCCM + "][" + strType + "][" + strNO + "]信息删除失败!\r\n" + strErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  490. return;
  491. }
  492. proc_Query(strCCM, cmbLB.Text.Trim(), strNO);
  493. MessageBox.Show("[" + strCCM + "][" + strType + "][" + strNO + "]信息删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  494. }
  495. catch (Exception ex)
  496. {
  497. MessageBox.Show(ex.Message);
  498. }
  499. }
  500. /// <summary>
  501. /// 菜单
  502. /// </summary>
  503. /// <param name="sender"></param>
  504. /// <param name="e"></param>
  505. private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  506. {
  507. if (e.ClickedItem == null) return;
  508. switch (e.ClickedItem.Name)
  509. {
  510. case "QUERY":
  511. {
  512. proc_Query("", "", "");
  513. break;
  514. }
  515. case "ADD":
  516. {
  517. proc_Add();
  518. break;
  519. }
  520. case "EDIT":
  521. {
  522. proc_Edit();
  523. break;
  524. }
  525. case "DEL":
  526. {
  527. proc_Del();
  528. break;
  529. }
  530. case "CLOSE":
  531. {
  532. this.Close();
  533. break;
  534. }
  535. }
  536. }
  537. private void tbCS_KeyPress(object sender, KeyPressEventArgs e)
  538. {
  539. if (!(Char.IsNumber(e.KeyChar) || e.KeyChar == '\b' || e.KeyChar == '.') || (((TextBox)(sender)).Text.Trim().Contains(".") && e.KeyChar == '.'))
  540. {
  541. e.Handled = true;
  542. }
  543. }
  544. }
  545. }