FrmIPAdress.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. using com.steering.mes.zgmil.entity;
  2. using Core.Mes.Client.Comm.Control;
  3. using Core.Mes.Client.Comm.Server;
  4. using Core.StlMes.Client.ZGMil.Entity;
  5. using CoreFS.CA06;
  6. using Infragistics.Win.UltraWinGrid;
  7. using System;
  8. using System.Collections;
  9. using System.Collections.Generic;
  10. using System.ComponentModel;
  11. using System.Data;
  12. using System.Drawing;
  13. using System.Linq;
  14. using System.Text;
  15. using System.Windows.Forms;
  16. namespace Core.StlMes.Client.ZGMil.Result
  17. {
  18. public partial class FrmIPAdress : FrmBase
  19. {
  20. public FrmIPAdress()
  21. {
  22. InitializeComponent();
  23. }
  24. //实例化类
  25. private MilBaseAddressEntity MilBase = new MilBaseAddressEntity();
  26. protected override void OnShown(EventArgs e)
  27. {
  28. base.OnShown(e);
  29. CMB_CX1.Enabled = false;
  30. CMB_CZT1.Enabled = false;
  31. CMB_GX1.Enabled = false;
  32. RB_CX.Checked=false;
  33. RB_CZT.Checked = false;
  34. RB_GX.Checked = false;
  35. foreach (UltraGridColumn ugc in this.ultraGrid1.DisplayLayout.Bands[0].Columns)
  36. {
  37. ugc.CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  38. }
  39. this.ipTB1.Label1.BackColor = Color.Transparent;
  40. this.ipTB1.Label2.BackColor = Color.Transparent;
  41. this.ipTB1.Label3.BackColor = Color.Transparent;
  42. this.ipTB2.Label1.BackColor = Color.Transparent;
  43. this.ipTB2.Label2.BackColor = Color.Transparent;
  44. this.ipTB2.Label3.BackColor = Color.Transparent;
  45. this.ipTB3.Label1.BackColor = Color.Transparent;
  46. this.ipTB3.Label2.BackColor = Color.Transparent;
  47. this.ipTB3.Label3.BackColor = Color.Transparent;
  48. this.ipTB4.Label1.BackColor = Color.Transparent;
  49. this.ipTB4.Label2.BackColor = Color.Transparent;
  50. this.ipTB4.Label3.BackColor = Color.Transparent;
  51. //this.CMB_CX.Text = "250机组";
  52. //this.CMB_CZT.Text = "1";
  53. //this.CMB_GZ.Text = "管排锯操作";
  54. }
  55. /// <summary>
  56. /// 查询区域条件选择控件控制
  57. /// </summary>
  58. /// <param name="sender"></param>
  59. /// <param name="e"></param>
  60. private void RB_CheckedChanged(object sender, EventArgs e)
  61. {
  62. if (RB_GX.Checked)
  63. {
  64. CMB_GX1.Enabled = true;
  65. CMB_GX1.Text = "管排锯操作";
  66. }
  67. else
  68. {
  69. CMB_GX1.Enabled = false;
  70. }
  71. if (RB_CZT.Checked)
  72. {
  73. CMB_CZT1.Enabled = true;
  74. CMB_CZT1.Text = "1";
  75. }
  76. else
  77. {
  78. CMB_CZT1.Enabled = false;
  79. }
  80. if (RB_CX.Checked)
  81. {
  82. CMB_CX1.Enabled = true;
  83. CMB_CX1.Text = "250机组";
  84. }
  85. else
  86. {
  87. CMB_CX1.Enabled = false;
  88. }
  89. }
  90. /// <summary>
  91. /// ToolBar按钮
  92. /// </summary>
  93. /// <param name="sender"></param>
  94. /// <param name="ToolbarKey"></param>
  95. public override void ToolBar_Click(object sender, string ToolbarKey)
  96. {
  97. switch (ToolbarKey)
  98. {
  99. case "DoQuery":
  100. Query();
  101. break;
  102. case "DoSave":
  103. Save();
  104. break;
  105. case "DoDelete":
  106. Delete();
  107. break;
  108. case "DoAdd":
  109. Add();
  110. break;
  111. case "Close":
  112. this.Dispose();
  113. this.Close();
  114. break;
  115. }
  116. }
  117. /// <summary>
  118. /// 查询
  119. /// </summary>
  120. private void Query()
  121. {
  122. MilBase.Clear();
  123. if (RB_GX.Checked)
  124. {
  125. switch(CMB_GX1.Text.ToString())
  126. {
  127. case"管排锯操作":
  128. MilBase.ProcessNo = "GP";
  129. break;
  130. case"矫直操作":
  131. MilBase.ProcessNo = "JZ";
  132. break;
  133. case "涡流探伤操作":
  134. MilBase.ProcessNo = "ET";
  135. break;
  136. case "漏磁探伤操作":
  137. MilBase.ProcessNo = "MT";
  138. break;
  139. case "超声波探伤操作":
  140. MilBase.ProcessNo = "UT";
  141. break;
  142. }
  143. }
  144. else
  145. {
  146. MilBase.ProcessNo = "";
  147. }
  148. if (RB_CZT.Checked)
  149. {
  150. MilBase.OperatCode = CMB_CZT1.Text.ToString();
  151. }
  152. else
  153. {
  154. MilBase.OperatCode = "";
  155. }
  156. if (RB_CX.Checked)
  157. {
  158. switch(CMB_CX1.Text.ToString())
  159. {
  160. case "250机组":
  161. MilBase.PlineCode = "C008";
  162. break;
  163. case "258机组":
  164. MilBase.PlineCode = "C009";
  165. break;
  166. case "168机组":
  167. MilBase.PlineCode = "C010";
  168. break;
  169. case "ASSEL机组":
  170. MilBase.PlineCode = "C012";
  171. break;
  172. case "460机组":
  173. MilBase.PlineCode = "C017";
  174. break;
  175. case "天淮508机组":
  176. MilBase.PlineCode = "C072";
  177. break;
  178. }
  179. }
  180. else
  181. {
  182. MilBase.PlineCode = "";
  183. }
  184. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmIPAdress.Query", new object[] { MilBase },this.ob);
  185. if (dt.Rows.Count > 0)
  186. {
  187. GridHelper.CopyDataToDatatable(dt, dtAdress, true);
  188. }
  189. else
  190. {
  191. MessageBox.Show("未查询到数据。", "提示",MessageBoxButtons.OK, MessageBoxIcon.Warning );
  192. }
  193. }
  194. #region 废代码
  195. public bool CheckIPAddress(string ip,DataTable dt)
  196. {
  197. bool result = false;
  198. ArrayList arr = new ArrayList();
  199. foreach (DataRow dr in dt.Rows)
  200. {
  201. if (!string.IsNullOrEmpty(dr["IP_ADDRESS1"].ToString()))
  202. {
  203. arr.Add(dr["IP_ADDRESS1"].ToString());
  204. }
  205. if (!string.IsNullOrEmpty(dr["IP_ADDRESS2"].ToString()))
  206. {
  207. arr.Add(dr["IP_ADDRESS2"].ToString());
  208. }
  209. if (!string.IsNullOrEmpty(dr["IP_ADDRESS3"].ToString()))
  210. {
  211. arr.Add(dr["IP_ADDRESS3"].ToString());
  212. }
  213. if (!string.IsNullOrEmpty(dr["IP_ADDRESS4"].ToString()))
  214. {
  215. arr.Add(dr["IP_ADDRESS4"].ToString());
  216. }
  217. }
  218. for (int i = 0; i < arr.Count; i++)
  219. {
  220. if (ip.Equals(arr[i]))
  221. {
  222. result = true;
  223. }
  224. }
  225. return result;
  226. }
  227. public bool BeforeCheck(string str)
  228. {
  229. bool result = false;
  230. MilBaseAddressEntity milb = new MilBaseAddressEntity();
  231. DataTable dtcheck = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmIPAdress.Query", new object[] { milb }, this.ob);
  232. if (str.Equals("1"))
  233. {
  234. foreach (DataRow dr in dtcheck.Rows)
  235. {
  236. if (dr["PROCESS_NO"].ToString().Equals(MilBase.ProcessNo) && dr["OPERAT_CODE"].ToString().Equals(MilBase.OperatCode) && dr["PLINE_CODE"].ToString().Equals(MilBase.PlineCode))
  237. {
  238. dtcheck.Rows.Remove(dr);
  239. }
  240. }
  241. }
  242. if (!string.IsNullOrEmpty(MilBase.IpAddress1.ToString()))
  243. {
  244. if (CheckIPAddress(MilBase.IpAddress1.ToString(), dtcheck))
  245. {
  246. MessageBox.Show("您输入的操作台IP地址1:【" + MilBase.IpAddress1.ToString() + "】已经录入数据库中,不允许重复录入,请检查后重录", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  247. result = true;
  248. }
  249. }
  250. if (!string.IsNullOrEmpty(MilBase.IpAddress2.ToString()))
  251. {
  252. if (CheckIPAddress(MilBase.IpAddress2.ToString(), dtcheck))
  253. {
  254. MessageBox.Show("您输入的操作台IP地址2:【" + MilBase.IpAddress2.ToString() + "】已经录入数据库中,不允许重复录入,请检查后重录", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  255. result = true;
  256. }
  257. }
  258. if (!string.IsNullOrEmpty(MilBase.IpAddress3.ToString()))
  259. {
  260. if (CheckIPAddress(MilBase.IpAddress3.ToString(), dtcheck))
  261. {
  262. MessageBox.Show("您输入的操作台IP地址3:【" + MilBase.IpAddress3.ToString() + "】已经录入数据库中,不允许重复录入,请检查后重录", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  263. result = true;
  264. }
  265. }
  266. if (!string.IsNullOrEmpty(MilBase.IpAddress4.ToString()))
  267. {
  268. if (CheckIPAddress(MilBase.IpAddress4.ToString(), dtcheck))
  269. {
  270. MessageBox.Show("您输入的操作台IP地址4:【" + MilBase.IpAddress4.ToString() + "】已经录入数据库中,不允许重复录入,请检查后重录", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  271. result = true;
  272. }
  273. }
  274. return result;
  275. }
  276. #endregion
  277. public bool CheckIPisIn(MilBaseAddressEntity milbase)
  278. {
  279. bool result = false;
  280. if (checkself(milbase))
  281. {
  282. MessageBox.Show("您配置的该条操作台IP记录内,有重复IP,请检查修改后重新配置", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  283. result = true;
  284. }
  285. NativeMethodNew na = new NativeMethodNew(this.ob);
  286. switch (na.CheckIpAddressisin(milbase))
  287. {
  288. case 0:
  289. break;
  290. case 1:
  291. MessageBox.Show("您配置的该条操作台IP记录内 IP_ADDRESS1:【" + milbase.IpAddress1 + "】,已存在于数据库", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  292. result = true;
  293. break;
  294. case 2:
  295. MessageBox.Show("您配置的该条操作台IP记录内 IP_ADDRESS2:【" + milbase.IpAddress2 + "】,已存在于数据库", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  296. result = true;
  297. break;
  298. case 3:
  299. MessageBox.Show("您配置的该条操作台IP记录内 IP_ADDRESS3:【" + milbase.IpAddress3 + "】,已存在于数据库", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  300. result = true;
  301. break;
  302. case 4:
  303. MessageBox.Show("您配置的该条操作台IP记录内 IP_ADDRESS4:【" + milbase.IpAddress4 + "】,已存在于数据库", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  304. result = true;
  305. break;
  306. }
  307. return result;
  308. }
  309. public bool checkself(MilBaseAddressEntity milbase)
  310. {
  311. bool result=false;
  312. List<string> list = new List<string>();
  313. string ip1 = MilBase.IpAddress1.ToString();
  314. string ip2 = MilBase.IpAddress2.ToString();
  315. string ip3 = MilBase.IpAddress3.ToString();
  316. string ip4 = MilBase.IpAddress4.ToString();
  317. list.Add(ip1); list.Add(ip2); list.Add(ip3); list.Add(ip4);
  318. if (ip1.Equals(list[1]) || ip1.Equals(list[2]) || ip1.Equals(list[3]))
  319. {
  320. if (!string.IsNullOrEmpty(ip1))
  321. {
  322. result = true;
  323. }
  324. }
  325. if (ip2.Equals(ip1) || ip2.Equals(ip3) || ip2.Equals(ip4))
  326. {
  327. if (!string.IsNullOrEmpty(ip2))
  328. {
  329. result = true;
  330. }
  331. }
  332. if (ip3.Equals(ip1) || ip3.Equals(ip2) || ip3.Equals(ip4))
  333. {
  334. if (!string.IsNullOrEmpty(ip3))
  335. {
  336. result = true;
  337. }
  338. }
  339. if (ip4.Equals(ip1) || ip4.Equals(ip2) || ip4.Equals(ip3))
  340. {
  341. if (!string.IsNullOrEmpty(ip4))
  342. {
  343. result = true;
  344. }
  345. }
  346. return result;
  347. }
  348. private void Add()
  349. {
  350. MilBase.Clear();
  351. MilBase.IpAddress1 = this.ipTB1.Text.ToString();
  352. MilBase.IpAddress2 = this.ipTB2.Text.ToString();
  353. MilBase.IpAddress3 = this.ipTB3.Text.ToString();
  354. MilBase.IpAddress4 = this.ipTB4.Text.ToString();
  355. MilBase.OperatCode = this.CMB_CZT.Text.ToString();
  356. switch (this.CMB_CX.Text.ToString())
  357. {
  358. case "250机组":
  359. MilBase.PlineCode = "C008";
  360. break;
  361. case "258机组":
  362. MilBase.PlineCode = "C009";
  363. break;
  364. case "168机组":
  365. MilBase.PlineCode = "C010";
  366. break;
  367. case "ASSEL机组":
  368. MilBase.PlineCode = "C012";
  369. break;
  370. case "460机组":
  371. MilBase.PlineCode = "C017";
  372. break;
  373. case "天淮508机组":
  374. MilBase.PlineCode = "C072";
  375. break;
  376. }
  377. switch (CMB_GZ.Text.ToString())
  378. {
  379. case "管排锯操作":
  380. MilBase.ProcessNo = "GP";
  381. break;
  382. case "矫直操作":
  383. MilBase.ProcessNo = "JZ";
  384. break;
  385. case "涡流探伤操作":
  386. MilBase.ProcessNo = "ET";
  387. break;
  388. case "漏磁探伤操作":
  389. MilBase.ProcessNo = "MT";
  390. break;
  391. case "超声波探伤操作":
  392. MilBase.ProcessNo = "UT";
  393. break;
  394. }
  395. MilBase.OperatName = this.CMB_GZ.Text.ToString() + this.CMB_CZT.Text.ToString() + "台";
  396. if (this.TXTRich.Text.Length > 40)
  397. {
  398. MessageBox.Show("您输入的字符过长,请重新输入。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  399. return;
  400. }
  401. MilBase.Remark = this.TXTRich.Text.ToString();
  402. if (isExist(MilBase))
  403. {
  404. MessageBox.Show("已存在该跳数据,请检查并重新输入再进行保存。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  405. return;
  406. }
  407. //if (BeforeCheck("0"))
  408. //{
  409. // return;
  410. //}
  411. if(CheckIPisIn(MilBase))
  412. {
  413. return;
  414. }
  415. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmIPAdress.Add", new object[] { MilBase }, this.ob);
  416. if (count > 0)
  417. {
  418. MessageBox.Show("新增数据完成。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  419. }
  420. string ProcessNo = MilBase.ProcessNo.ToString();
  421. string PlineCode = MilBase.PlineCode.ToString();
  422. string OperatCode = MilBase.OperatCode.ToString();
  423. Query();
  424. foreach(UltraGridRow ugr in ultraGrid1.Rows)
  425. {
  426. if (ugr.Cells["PROCESS"].Value.ToString().Trim() == ProcessNo && ugr.Cells["PLINE"].Value.ToString().Trim() == PlineCode && ugr.Cells["OPERAT_CODE"].Value.ToString().Trim() == OperatCode)
  427. {
  428. this.ultraGrid1.ActiveRow = ugr;
  429. }
  430. }
  431. }
  432. private void Save()
  433. {
  434. MilBase.Clear();
  435. MilBase.IpAddress1 = this.ipTB1.Text.ToString();
  436. MilBase.IpAddress2 = this.ipTB2.Text.ToString();
  437. MilBase.IpAddress3 = this.ipTB3.Text.ToString();
  438. MilBase.IpAddress4 = this.ipTB4.Text.ToString();
  439. MilBase.OperatCode = this.CMB_CZT.Text.ToString();
  440. switch (this.CMB_CX.Text.ToString())
  441. {
  442. case "250机组":
  443. MilBase.PlineCode = "C008";
  444. break;
  445. case "258机组":
  446. MilBase.PlineCode = "C009";
  447. break;
  448. case "168机组":
  449. MilBase.PlineCode = "C010";
  450. break;
  451. case "ASSEL机组":
  452. MilBase.PlineCode = "C012";
  453. break;
  454. case "460机组":
  455. MilBase.PlineCode = "C017";
  456. break;
  457. case "天淮508机组":
  458. MilBase.PlineCode = "C072";
  459. break;
  460. }
  461. switch (CMB_GZ.Text.ToString())
  462. {
  463. case "管排锯操作":
  464. MilBase.ProcessNo = "GP";
  465. break;
  466. case "矫直操作":
  467. MilBase.ProcessNo = "JZ";
  468. break;
  469. case "涡流探伤操作":
  470. MilBase.ProcessNo = "ET";
  471. break;
  472. case "漏磁探伤操作":
  473. MilBase.ProcessNo = "MT";
  474. break;
  475. case "超声波探伤操作":
  476. MilBase.ProcessNo = "UT";
  477. break;
  478. }
  479. MilBase.OperatName = this.CMB_GZ.Text.ToString() + this.CMB_CZT.Text.ToString() + "台";
  480. if (this.TXTRich.Text.Length > 40)
  481. {
  482. MessageBox.Show("您输入的字符过长,请重新输入", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  483. return;
  484. }
  485. MilBase.Remark = this.TXTRich.Text.ToString();
  486. if (!isExist(MilBase))
  487. {
  488. MessageBox.Show("不存在该条记录,如果是新增,请点击添加按钮,添加数据", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  489. return;
  490. }
  491. //if (BeforeCheck("1"))
  492. //{
  493. // return;
  494. //}
  495. if (CheckIPisIn(MilBase))
  496. {
  497. return;
  498. }
  499. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmIPAdress.Save", new object[] { MilBase }, this.ob);
  500. if (count > 0)
  501. {
  502. MessageBox.Show("修改数据完成。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  503. }
  504. string ProcessNo = MilBase.ProcessNo.ToString();
  505. string PlineCode = MilBase.PlineCode.ToString();
  506. string OperatCode = MilBase.OperatCode.ToString();
  507. Query();
  508. foreach (UltraGridRow ugr in ultraGrid1.Rows)
  509. {
  510. if (ugr.Cells["PROCESS"].Value.ToString().Trim() == ProcessNo && ugr.Cells["PLINE"].Value.ToString().Trim() == PlineCode && ugr.Cells["OPERAT_CODE"].Value.ToString().Trim() == OperatCode)
  511. {
  512. this.ultraGrid1.ActiveRow = ugr;
  513. }
  514. }
  515. }
  516. private void Delete()
  517. {
  518. MilBase.Clear();
  519. MilBase.IpAddress1 = this.ipTB1.Text.ToString();
  520. MilBase.IpAddress2 = this.ipTB2.Text.ToString();
  521. MilBase.IpAddress3 = this.ipTB3.Text.ToString();
  522. MilBase.IpAddress4 = this.ipTB4.Text.ToString();
  523. MilBase.OperatCode = this.CMB_CZT.Text.ToString();
  524. switch (this.CMB_CX.Text.ToString())
  525. {
  526. case "250机组":
  527. MilBase.PlineCode = "C008";
  528. break;
  529. case "258机组":
  530. MilBase.PlineCode = "C009";
  531. break;
  532. case "168机组":
  533. MilBase.PlineCode = "C010";
  534. break;
  535. case "ASSEL机组":
  536. MilBase.PlineCode = "C012";
  537. break;
  538. case "460机组":
  539. MilBase.PlineCode = "C017";
  540. break;
  541. case "天淮508机组":
  542. MilBase.PlineCode = "C072";
  543. break;
  544. }
  545. switch (CMB_GZ.Text.ToString())
  546. {
  547. case "管排锯操作":
  548. MilBase.ProcessNo = "GP";
  549. break;
  550. case "矫直操作":
  551. MilBase.ProcessNo = "JZ";
  552. break;
  553. case "涡流探伤操作":
  554. MilBase.ProcessNo = "ET";
  555. break;
  556. case "漏磁探伤操作":
  557. MilBase.ProcessNo = "MT";
  558. break;
  559. case "超声波探伤操作":
  560. MilBase.ProcessNo = "UT";
  561. break;
  562. }
  563. MilBase.OperatName = this.CMB_GZ.Text.ToString() + this.CMB_CZT.Text.ToString() + "台";
  564. if (!isExist(MilBase))
  565. {
  566. MessageBox.Show("不存在该条记录,请检查后重新删除。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  567. return;
  568. }
  569. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmIPAdress.Delete", new object[] { MilBase }, this.ob);
  570. if (count > 0)
  571. {
  572. MessageBox.Show("删除数据完成。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  573. }
  574. Query();
  575. }
  576. /// <summary>
  577. /// 判断数据是否已经存在
  578. /// </summary>
  579. /// <param name="milbase"></param>
  580. /// <returns></returns>
  581. private bool isExist(MilBaseAddressEntity milbase)
  582. {
  583. bool result = false;
  584. string processno= milbase.ProcessNo.ToString();
  585. string operatcode= milbase.OperatCode.ToString();
  586. string plinecode = milbase.PlineCode.ToString();
  587. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmIPAdress.isExist", new object[] { milbase }, this.ob);
  588. if (dt.Rows.Count == 1)
  589. {
  590. result = true;
  591. }
  592. return result;
  593. }
  594. /// <summary>
  595. /// 单击主表事件
  596. /// </summary>
  597. /// <param name="sender"></param>
  598. /// <param name="e"></param>
  599. private void ultraGrid1_AfterRowActive(object sender, EventArgs e)
  600. {
  601. UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  602. this.ipTB1.Text = ugr.Cells["IP_ADDRESS1"].Value.ToString();
  603. this.ipTB2.Text = ugr.Cells["IP_ADDRESS2"].Value.ToString();
  604. this.ipTB3.Text = ugr.Cells["IP_ADDRESS3"].Value.ToString();
  605. this.ipTB4.Text = ugr.Cells["IP_ADDRESS4"].Value.ToString();
  606. this.CMB_CX.Text = ugr.Cells["PLINE_CODE"].Value.ToString();
  607. this.CMB_GZ.Text = ugr.Cells["PROCESS_NO"].Value.ToString();
  608. this.CMB_CZT.Text = ugr.Cells["OPERAT_CODE"].Value.ToString();
  609. this.TXTRich.Text = ugr.Cells["REMARK"].Value.ToString();
  610. }
  611. }
  612. }