FrmVarietieProduct.cs 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using Core.Mes.Client.Comm.Server;
  11. using Core.Mes.Client.Comm.Control;
  12. using Infragistics.Win.UltraWinGrid;
  13. using System.Collections;
  14. using Core.Mes.Client.Comm.Tool;
  15. using Core.StlMes.Client.YdmPipeManage.Controls;
  16. namespace Core.StlMes.Client.YdmPipeManage
  17. {
  18. public partial class FrmVarietieProduct : FrmBase
  19. {
  20. string strStartTime = "2010-01-01 00:00:00";//开始时间
  21. string strEndTime = "";//结束时间
  22. DataTable ds1 = new DataTable();
  23. DataTable ds2 = new DataTable();
  24. DataTable ds3 = new DataTable();
  25. DataTable ds4 = new DataTable();
  26. private int InCoun = 0;
  27. public FrmVarietieProduct()
  28. {
  29. InitializeComponent();
  30. }
  31. private void FrmVarietie_Load(object sender, EventArgs e)
  32. {
  33. //doQuery();
  34. }
  35. protected override void OnLoad(EventArgs e)
  36. {
  37. base.OnLoad(e);
  38. PipeManageClass.SetUltraGridRowFilter(ref GridProducode, true);
  39. PipeManageClass.SetUltraGridRowFilter(ref GridKind, true);
  40. PipeManageClass.SetUltraGridRowFilter(ref ultraGrid1, true);
  41. PipeManageClass.SetUltraGridRowFilter(ref GridSteel, true);
  42. PipeManageClass.SetUltraGridRowFilter(ref GridzbSteel, true);
  43. PipeManageClass.SetUltraGridRowFilter(ref ultraGrid2, true);
  44. PipeManageClass.SetUltraGridRowFilter(ref GridSpec, true);
  45. PipeManageClass.SetUltraGridRowFilter(ref GridzbSpec, true);
  46. PipeManageClass.SetUltraGridRowFilter(ref ultraGrid3, true);
  47. PipeManageClass.SetUltraGridRowFilter(ref GridModel, true);
  48. PipeManageClass.SetUltraGridRowFilter(ref GridzbModel, true);
  49. PipeManageClass.SetUltraGridRowFilter(ref ultraGrid4, true);
  50. PipeManageClass.SetUltraGridRowFilter(ref ultraGrid5, true);
  51. PipeManageClass.SetUltraGridRowFilter(ref ultraGrid6, true);
  52. PipeManageClass.SetUltraGridRowFilter(ref ultraGrid7, true);
  53. PipeManageClass.SetUltraGridRowFilter(ref ultraGrid8, true);
  54. PipeManageClass.SetUltraGridRowFilter(ref ultraGrid9, true);
  55. PipeManageClass.SetUltraGridRowFilter(ref ultraGrid10, true);
  56. }
  57. /// <summary>
  58. /// 重写基类方法
  59. /// </summary>
  60. /// <param name="sender"></param>
  61. /// <param name="ToolbarKey"></param>
  62. public override void ToolBar_Click(object sender, string ToolbarKey)
  63. {
  64. switch (ToolbarKey)
  65. {
  66. case "Query":
  67. doQuery();
  68. break;
  69. case "Save":
  70. doAdd();
  71. break;
  72. case "Delete":
  73. doDelete();
  74. break;
  75. case "Refresh":
  76. doRefresh();
  77. break;
  78. case "Export":
  79. doExport();
  80. break;
  81. case "Close":
  82. this.Close();
  83. break;
  84. }
  85. }
  86. /// <summary>
  87. /// 导出
  88. /// </summary>
  89. private void doExport()
  90. {
  91. if (ultraTabControl1.SelectedTab.Key.Equals("0"))
  92. {
  93. if (InCoun == 1)
  94. {
  95. GridHelper.ulGridToExcel(GridProducode, "产销系统品名");
  96. }
  97. else if (InCoun == 2)
  98. {
  99. GridHelper.ulGridToExcel(ultraGrid1, "品名对应关系");
  100. }
  101. else if (InCoun == 3)
  102. {
  103. GridHelper.ulGridToExcel(GridKind, "质保系统品名");
  104. }
  105. else
  106. {
  107. MessageUtil.ShowTips("请激活要导出的GRID!");
  108. return;
  109. }
  110. }
  111. else if (ultraTabControl1.SelectedTab.Key.Equals("1"))
  112. {
  113. if (InCoun == 1)
  114. {
  115. GridHelper.ulGridToExcel(GridSteel, "产销系统钢级");
  116. }
  117. else if (InCoun == 2)
  118. {
  119. GridHelper.ulGridToExcel(ultraGrid2, "钢级对应关系");
  120. }
  121. else if (InCoun == 3)
  122. {
  123. GridHelper.ulGridToExcel(GridzbSteel, "质保系统钢级");
  124. }
  125. else
  126. {
  127. MessageUtil.ShowTips("请激活要导出的GRID!");
  128. return;
  129. }
  130. }
  131. else if (ultraTabControl1.SelectedTab.Key.Equals("2"))
  132. {
  133. if (InCoun == 1)
  134. {
  135. GridHelper.ulGridToExcel(GridSpec, "产销系统规格");
  136. }
  137. else if (InCoun == 2)
  138. {
  139. GridHelper.ulGridToExcel(ultraGrid3, "规格对应关系");
  140. }
  141. else if (InCoun == 3)
  142. {
  143. GridHelper.ulGridToExcel(GridzbSpec, "质保系统规格");
  144. }
  145. else
  146. {
  147. MessageUtil.ShowTips("请激活要导出的GRID!");
  148. return;
  149. }
  150. }
  151. else if (ultraTabControl1.SelectedTab.Key.Equals("3"))
  152. {
  153. if (InCoun == 1)
  154. {
  155. GridHelper.ulGridToExcel(GridModel, "产销系统扣型");
  156. }
  157. else if (InCoun == 2)
  158. {
  159. GridHelper.ulGridToExcel(ultraGrid4, "扣型对应关系");
  160. }
  161. else if (InCoun == 3)
  162. {
  163. GridHelper.ulGridToExcel(GridzbModel, "质保系统扣型");
  164. }
  165. else
  166. {
  167. MessageUtil.ShowTips("请激活要导出的GRID!");
  168. return;
  169. }
  170. }
  171. else if (ultraTabControl1.SelectedTab.Key.Equals("4"))
  172. {
  173. if (InCoun == 1)
  174. {
  175. GridHelper.ulGridToExcel(ultraGrid5, "产销系统产线");
  176. }
  177. else if (InCoun == 2)
  178. {
  179. GridHelper.ulGridToExcel(ultraGrid6, "产线对应关系");
  180. }
  181. else if (InCoun == 3)
  182. {
  183. GridHelper.ulGridToExcel(ultraGrid7, "质保系统产线");
  184. }
  185. else
  186. {
  187. MessageUtil.ShowTips("请激活要导出的GRID!");
  188. return;
  189. }
  190. }
  191. else
  192. {
  193. if (InCoun == 1)
  194. {
  195. GridHelper.ulGridToExcel(ultraGrid8, "产销系统钢种");
  196. }
  197. else if (InCoun == 2)
  198. {
  199. GridHelper.ulGridToExcel(ultraGrid9, "钢种对应关系");
  200. }
  201. else if (InCoun == 3)
  202. {
  203. GridHelper.ulGridToExcel(ultraGrid10, "质保系统钢种");
  204. }
  205. else
  206. {
  207. MessageUtil.ShowTips("请激活要导出的GRID!");
  208. return;
  209. }
  210. }
  211. }
  212. /// <summary>
  213. /// 查询
  214. /// </summary>
  215. private void doQuery()
  216. {
  217. if (ultraTabControl1.SelectedTab.Key.Equals("0"))
  218. {
  219. DataTable dt1 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getKind", null, this.ob);
  220. GridHelper.CopyDataToDatatable(ref dt1, ref dataTable1, true);
  221. GridHelper.RefreshAndAutoSize(GridProducode);
  222. }
  223. else if (ultraTabControl1.SelectedTab.Key.Equals("1"))
  224. {
  225. DataTable dt1 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getSteel", null, this.ob);
  226. GridHelper.CopyDataToDatatable(ref dt1, ref dtCX_Steel, true);
  227. GridHelper.RefreshAndAutoSize(GridSteel);
  228. }
  229. else if (ultraTabControl1.SelectedTab.Key.Equals("2"))
  230. {
  231. DataTable dt1 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getSpec", null, this.ob);
  232. GridHelper.CopyDataToDatatable(ref dt1, ref dtCX_Spec, true);
  233. GridHelper.RefreshAndAutoSize(GridSpec);
  234. }
  235. else if (ultraTabControl1.SelectedTab.Key.Equals("3"))
  236. {
  237. DataTable dt1 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getModel", null, this.ob);
  238. GridHelper.CopyDataToDatatable(ref dt1, ref dtCX_Model, true);
  239. GridHelper.RefreshAndAutoSize(GridModel);
  240. }
  241. else if (ultraTabControl1.SelectedTab.Key.Equals("4"))
  242. {
  243. DataTable dt1 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getFactory", null, this.ob);
  244. GridHelper.CopyDataToDatatable(ref dt1, ref dataTable4, true);
  245. GridHelper.RefreshAndAutoSize(this.ultraGrid5);
  246. }
  247. else
  248. {
  249. DataTable dt1 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getGrade", null, this.ob);
  250. GridHelper.CopyDataToDatatable(ref dt1, ref dataTable7, true);
  251. GridHelper.RefreshAndAutoSize(this.ultraGrid8);
  252. }
  253. doQueryZB();
  254. }
  255. /// <summary>
  256. /// 保存
  257. /// </summary>
  258. private void doAdd()
  259. {
  260. if (ultraTabControl1.SelectedTab.Key.Equals("0"))
  261. {
  262. #region 品名对应关系
  263. UltraGridRow row = GridProducode.ActiveRow;
  264. UltraGridRow row1 = GridKind.ActiveRow;
  265. int counm = 0;
  266. if (row==null)
  267. {
  268. MessageUtil.ShowTips("无数据,不能进行此操作!");
  269. return;
  270. }
  271. if (row.IsFilterRow) { MessageUtil.ShowTips("请选择产销系统品名!"); return; }
  272. if (row1 == null)
  273. {
  274. MessageUtil.ShowTips("质保无数据,不能进行此操作!");
  275. return;
  276. }
  277. ArrayList list = new ArrayList();
  278. //string strwhere = "";
  279. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in GridKind.Rows)
  280. {
  281. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  282. {
  283. counm += 1;
  284. ArrayList listSave = new ArrayList();
  285. //listSave.Add(row.Cells["PRODUCCODE"].Text.Trim());
  286. listSave.Add(uRow.Cells["kind"].Text);
  287. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryKind1", new object[] { listSave }, this.ob);
  288. if (dt.Rows.Count > 0)
  289. {
  290. MessageUtil.ShowTips("您选择的该条质保系统品名" + "【" + uRow.Cells["kind"].Text + "】" + "对应关系已存在,请重新选择!");
  291. return;
  292. }
  293. ArrayList pram = new ArrayList();
  294. pram.Add(row.Cells["PRODUCCODE"].Text);
  295. pram.Add(row.Cells["PRODUCNAME"].Text);
  296. pram.Add(row.Cells["PRODUC_JX"].Text);
  297. pram.Add(row.Cells["PRODUC_ENG"].Text);
  298. pram.Add(uRow.Cells["kind"].Text);
  299. pram.Add(this.UserInfo.GetUserName());
  300. list.Add(pram);
  301. //strwhere += uRow.Cells["kind"].Text.Trim() + ",";
  302. }
  303. }
  304. //DataTable dt1 = PipeManageClass.RowFilterDataTable(ds1, strwhere);
  305. //GridHelper.CopyDataToDatatable(ref dt1, ref dataTable3, true);
  306. //GridHelper.RefreshAndAutoSize(GridKind);
  307. if (counm == 0)
  308. {
  309. MessageUtil.ShowTips("请选择质保系统品名!");
  310. return;
  311. }
  312. int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.addProduct", new Object[] { list }, this.ob);
  313. if (count > 0)
  314. {
  315. MessageUtil.ShowTips("保存成功!");
  316. doQueryProduct();
  317. }
  318. #endregion
  319. }
  320. else if (ultraTabControl1.SelectedTab.Key.Equals("1"))
  321. {
  322. #region 钢级对应关系
  323. UltraGridRow row = GridSteel.ActiveRow;
  324. UltraGridRow row1 = GridzbSteel.ActiveRow;
  325. int counm = 0;
  326. if (row == null)
  327. {
  328. MessageUtil.ShowTips("无数据,不能进行此操作!");
  329. return;
  330. }
  331. if (row.IsFilterRow) { MessageUtil.ShowTips("请选择产销系统钢级!"); return; }
  332. if (row1 == null)
  333. {
  334. MessageUtil.ShowTips("质保无数据,不能进行此操作!");
  335. return;
  336. }
  337. ArrayList list = new ArrayList();
  338. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in GridzbSteel.Rows)
  339. {
  340. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  341. {
  342. counm += 1;
  343. ArrayList listSave = new ArrayList();
  344. //listSave.Add(row.Cells["STEELCODE"].Text.Trim());
  345. listSave.Add(uRow.Cells["steellevel"].Text);
  346. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQuerySteel1", new object[] { listSave }, this.ob);
  347. if (dt.Rows.Count > 0)
  348. {
  349. MessageUtil.ShowTips("您选择该条质保系统钢级" +"【"+ uRow.Cells["steellevel"].Text +"】"+ "对应关系已存在,请重新选择!");
  350. return;
  351. }
  352. ArrayList pram = new ArrayList();
  353. pram.Add(row.Cells["STEELCODE"].Text);
  354. pram.Add(row.Cells["STEELNAME"].Text);
  355. pram.Add(uRow.Cells["steellevel"].Text);
  356. pram.Add(this.UserInfo.GetUserName());
  357. list.Add(pram);
  358. }
  359. }
  360. if (counm == 0)
  361. {
  362. MessageUtil.ShowTips("请选择质保系统钢级!");
  363. return;
  364. }
  365. int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.addSteel", new Object[] { list }, this.ob);
  366. if (count > 0)
  367. {
  368. MessageUtil.ShowTips("保存成功!");
  369. doQueryProduct();
  370. }
  371. #endregion}
  372. }
  373. else if (ultraTabControl1.SelectedTab.Key.Equals("2"))
  374. {
  375. #region 规格对应关系
  376. UltraGridRow row = GridSpec.ActiveRow;
  377. UltraGridRow row1 = GridzbSpec.ActiveRow;
  378. int counm = 0;
  379. if (row == null)
  380. {
  381. MessageUtil.ShowTips("无数据,不能进行此操作!");
  382. return;
  383. }
  384. if (row.IsFilterRow) { MessageUtil.ShowTips("请选择产销系统规格!"); return; }
  385. if (row1 == null)
  386. {
  387. MessageUtil.ShowTips("质保无数据,不能进行此操作!");
  388. return;
  389. }
  390. ArrayList list = new ArrayList();
  391. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in GridzbSpec.Rows)
  392. {
  393. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  394. {
  395. counm += 1;
  396. ArrayList listSave = new ArrayList();
  397. //listSave.Add(row.Cells["SPEC_CODE"].Text.Trim());
  398. listSave.Add(uRow.Cells["gg"].Text);
  399. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQuerySpec1", new object[] { listSave }, this.ob);
  400. if (dt.Rows.Count > 0)
  401. {
  402. MessageUtil.ShowTips("您选择的该条质保系统规格" +"【"+ uRow.Cells["gg"].Text+"】" + "对应关系已存在,请重新选择!");
  403. return;
  404. }
  405. ArrayList pram = new ArrayList();
  406. pram.Add(row.Cells["SPEC_CODE"].Text);
  407. pram.Add(row.Cells["SPEC_NAME"].Text);
  408. pram.Add(uRow.Cells["gg"].Text);
  409. pram.Add(this.UserInfo.GetUserName());
  410. list.Add(pram);
  411. }
  412. }
  413. if (counm == 0)
  414. {
  415. MessageUtil.ShowTips("请选择质保系统规格!");
  416. return;
  417. }
  418. int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.addSpec", new Object[] { list }, this.ob);
  419. if (count > 0)
  420. {
  421. MessageUtil.ShowTips("保存成功!");
  422. doQueryProduct();
  423. }
  424. #endregion}
  425. }
  426. else if (ultraTabControl1.SelectedTab.Key.Equals("3"))
  427. {
  428. #region 扣型对应关系
  429. UltraGridRow row = GridModel.ActiveRow;
  430. UltraGridRow row1 = GridzbModel.ActiveRow;
  431. int counm = 0;
  432. if (row == null)
  433. {
  434. MessageUtil.ShowTips("无数据,不能进行此操作!");
  435. return;
  436. }
  437. if (row.IsFilterRow) { MessageUtil.ShowTips("请选择产销系统扣型!"); return; }
  438. if (row1 == null)
  439. {
  440. MessageUtil.ShowTips("质保无数据,不能进行此操作!");
  441. return;
  442. }
  443. ArrayList list = new ArrayList();
  444. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in GridzbModel.Rows)
  445. {
  446. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  447. {
  448. counm += 1;
  449. ArrayList listSave = new ArrayList();
  450. //listSave.Add(row.Cells["MODEL_CODE"].Text.Trim());
  451. listSave.Add(uRow.Cells["typeofThread"].Text);
  452. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryModel1", new object[] { listSave }, this.ob);
  453. if (dt.Rows.Count > 0)
  454. {
  455. MessageUtil.ShowTips("您选择的该条质保系统扣型" + "【" + uRow.Cells["typeofThread"].Text + "】" + "对应关系已存在,请重新选择!");
  456. return;
  457. }
  458. ArrayList pram = new ArrayList();
  459. pram.Add(row.Cells["MODEL_CODE"].Text);
  460. pram.Add(row.Cells["MODEL_DESC"].Text);
  461. pram.Add(uRow.Cells["typeofThread"].Text);
  462. pram.Add(this.UserInfo.GetUserName());
  463. list.Add(pram);
  464. }
  465. }
  466. if (counm == 0)
  467. {
  468. MessageUtil.ShowTips("请选择质保系统扣型!");
  469. return;
  470. }
  471. int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.addModel", new Object[] { list }, this.ob);
  472. if (count > 0)
  473. {
  474. MessageUtil.ShowTips("保存成功!");
  475. doQueryProduct();
  476. }
  477. #endregion
  478. }
  479. else if (ultraTabControl1.SelectedTab.Key.Equals("4"))
  480. {
  481. #region 产线对应关系
  482. UltraGridRow row = this.ultraGrid5.ActiveRow;
  483. UltraGridRow row1 = ultraGrid7.ActiveRow;
  484. int counm = 0;
  485. if (row == null)
  486. {
  487. MessageUtil.ShowTips("无数据,不能进行此操作!");
  488. return;
  489. }
  490. if (row.IsFilterRow) { MessageUtil.ShowTips("请选择产销系统产线!"); return; }
  491. if (row1 == null)
  492. {
  493. MessageUtil.ShowTips("质保无数据,不能进行此操作!");
  494. return;
  495. }
  496. ArrayList list = new ArrayList();
  497. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid7.Rows)
  498. {
  499. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  500. {
  501. counm += 1;
  502. ArrayList listSave = new ArrayList();
  503. //listSave.Add(row.Cells["MODEL_CODE"].Text.Trim());
  504. listSave.Add(uRow.Cells["factory"].Text);
  505. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryFactory1", new object[] { listSave }, this.ob);
  506. if (dt.Rows.Count > 0)
  507. {
  508. MessageUtil.ShowTips("您选择的该条质保系统产线" + "【" + uRow.Cells["factory"].Text + "】" + "对应关系已存在,请重新选择!");
  509. return;
  510. }
  511. ArrayList pram = new ArrayList();
  512. pram.Add(row.Cells["PLINE_CODE"].Text);
  513. pram.Add(row.Cells["PLINE_NAME"].Text);
  514. pram.Add(uRow.Cells["factory"].Text);
  515. pram.Add(this.UserInfo.GetUserName());
  516. list.Add(pram);
  517. }
  518. }
  519. if (counm == 0)
  520. {
  521. MessageUtil.ShowTips("请选择质保系统产线!");
  522. return;
  523. }
  524. int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.addFactory", new Object[] { list }, this.ob);
  525. if (count > 0)
  526. {
  527. MessageUtil.ShowTips("保存成功!");
  528. doQueryProduct();
  529. }
  530. #endregion
  531. }
  532. else
  533. {
  534. #region 钢种对应关系
  535. UltraGridRow row = this.ultraGrid8.ActiveRow;
  536. UltraGridRow row1 = ultraGrid10.ActiveRow;
  537. int counm = 0;
  538. if (row == null)
  539. {
  540. MessageUtil.ShowTips("无数据,不能进行此操作!");
  541. return;
  542. }
  543. if (row.IsFilterRow) { MessageUtil.ShowTips("请选择产销系统钢种!"); return; }
  544. if (row1 == null)
  545. {
  546. MessageUtil.ShowTips("质保无数据,不能进行此操作!");
  547. return;
  548. }
  549. ArrayList list = new ArrayList();
  550. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid10.Rows)
  551. {
  552. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  553. {
  554. counm += 1;
  555. ArrayList listSave = new ArrayList();
  556. //listSave.Add(row.Cells["MODEL_CODE"].Text.Trim());
  557. listSave.Add(uRow.Cells["steelgrade"].Text);
  558. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryGrade1", new object[] { listSave }, this.ob);
  559. if (dt.Rows.Count > 0)
  560. {
  561. MessageUtil.ShowTips("您选择的该条质保系统钢种" + "【" + uRow.Cells["steelgrade"].Text.Trim() + "】" + "对应关系已存在,请重新选择!");
  562. return;
  563. }
  564. ArrayList pram = new ArrayList();
  565. pram.Add(row.Cells["GRADECODE"].Text);
  566. pram.Add(row.Cells["GRADENAME"].Text);
  567. pram.Add(uRow.Cells["steelgrade"].Text);
  568. pram.Add(this.UserInfo.GetUserName());
  569. list.Add(pram);
  570. }
  571. }
  572. if (counm == 0)
  573. {
  574. MessageUtil.ShowTips("请选择质保系统钢种!");
  575. return;
  576. }
  577. int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.addGrade", new Object[] { list }, this.ob);
  578. if (count > 0)
  579. {
  580. MessageUtil.ShowTips("保存成功!");
  581. doQueryProduct();
  582. }
  583. #endregion
  584. }
  585. }
  586. /// <summary>
  587. /// 删除
  588. /// </summary>
  589. private void doDelete()
  590. {
  591. if (ultraTabControl1.SelectedTab.Key.Equals("0"))
  592. {
  593. #region 品名对应关系
  594. UltraGridRow row = ultraGrid1.ActiveRow;
  595. int counm = 0;
  596. if (row == null)
  597. {
  598. MessageUtil.ShowTips("无数据,不能进行此操作!");
  599. return;
  600. }
  601. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid1.Rows)
  602. {
  603. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  604. {
  605. counm += 1;
  606. }
  607. }
  608. if (counm == 0)
  609. {
  610. MessageUtil.ShowTips("请选择产销系统与质保系统品名对应关系!");
  611. return;
  612. }
  613. ArrayList list = new ArrayList();
  614. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid1.Rows)
  615. {
  616. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  617. {
  618. ArrayList pram = new ArrayList();
  619. pram.Add(row.Cells["PRODUCCODE"].Text);
  620. pram.Add(uRow.Cells["ZB_PRODUCNAME"].Text);
  621. list.Add(pram);
  622. }
  623. }
  624. int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.deleteProduct", new Object[] { list }, this.ob);
  625. if (count > 0)
  626. {
  627. MessageUtil.ShowTips("删除成功!");
  628. doQueryProduct();
  629. }
  630. else
  631. {
  632. MessageUtil.ShowTips("删除失败!");
  633. }
  634. #endregion
  635. }
  636. else if (ultraTabControl1.SelectedTab.Key.Equals("1"))
  637. {
  638. #region 钢级对应关系
  639. UltraGridRow row = ultraGrid2.ActiveRow;
  640. int counm = 0;
  641. if (row == null)
  642. {
  643. MessageUtil.ShowTips("无数据,不能进行此操作!");
  644. return;
  645. }
  646. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid2.Rows)
  647. {
  648. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  649. {
  650. counm += 1;
  651. }
  652. }
  653. if (counm == 0)
  654. {
  655. MessageUtil.ShowTips("请选择产销系统与质保系统钢级对应关系!");
  656. return;
  657. }
  658. ArrayList list = new ArrayList();
  659. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid2.Rows)
  660. {
  661. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  662. {
  663. ArrayList pram = new ArrayList();
  664. pram.Add(row.Cells["STEELCODE"].Text);
  665. pram.Add(uRow.Cells["ZB_STEELNAME"].Text);
  666. list.Add(pram);
  667. }
  668. }
  669. int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.deleteSteel", new Object[] { list }, this.ob);
  670. if (count > 0)
  671. {
  672. MessageUtil.ShowTips("删除成功!");
  673. doQueryProduct();
  674. }
  675. else
  676. {
  677. MessageUtil.ShowTips("删除失败!");
  678. }
  679. #endregion}
  680. }
  681. else if (ultraTabControl1.SelectedTab.Key.Equals("2"))
  682. {
  683. #region 规格对应关系
  684. UltraGridRow row = ultraGrid3.ActiveRow;
  685. int counm = 0;
  686. if (row == null)
  687. {
  688. MessageUtil.ShowTips("无数据,不能进行此操作!");
  689. return;
  690. }
  691. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid3.Rows)
  692. {
  693. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  694. {
  695. counm += 1;
  696. }
  697. }
  698. if (counm == 0)
  699. {
  700. MessageUtil.ShowTips("请选择产销系统与质保系统规格对应关系!");
  701. return;
  702. }
  703. ArrayList list = new ArrayList();
  704. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid3.Rows)
  705. {
  706. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  707. {
  708. ArrayList pram = new ArrayList();
  709. pram.Add(row.Cells["SPEC_CODE"].Text);
  710. pram.Add(uRow.Cells["ZB_SPEC_NAME"].Text);
  711. list.Add(pram);
  712. }
  713. }
  714. int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.deleteSpec", new Object[] { list }, this.ob);
  715. if (count > 0)
  716. {
  717. MessageUtil.ShowTips("删除成功!");
  718. doQueryProduct();
  719. }
  720. else
  721. {
  722. MessageUtil.ShowTips("删除失败!");
  723. }
  724. #endregion
  725. }
  726. else if (ultraTabControl1.SelectedTab.Key.Equals("3"))
  727. {
  728. #region 扣型对应关系
  729. UltraGridRow row = ultraGrid4.ActiveRow;
  730. int counm = 0;
  731. if (row == null)
  732. {
  733. MessageUtil.ShowTips("无数据,不能进行此操作!");
  734. return;
  735. }
  736. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid4.Rows)
  737. {
  738. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  739. {
  740. counm += 1;
  741. }
  742. }
  743. if (counm == 0)
  744. {
  745. MessageUtil.ShowTips("请选择产销系统与质保系统扣型对应关系!");
  746. return;
  747. }
  748. ArrayList list = new ArrayList();
  749. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid4.Rows)
  750. {
  751. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  752. {
  753. ArrayList pram = new ArrayList();
  754. pram.Add(row.Cells["MODEL_CODE"].Text);
  755. pram.Add(uRow.Cells["ZB_MODEL_DESC"].Text);
  756. list.Add(pram);
  757. }
  758. }
  759. int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.deleteModel", new Object[] { list }, this.ob);
  760. if (count > 0)
  761. {
  762. MessageUtil.ShowTips("删除成功!");
  763. doQueryProduct();
  764. }
  765. else
  766. {
  767. MessageUtil.ShowTips("删除失败!");
  768. }
  769. #endregion
  770. }
  771. else if (ultraTabControl1.SelectedTab.Key.Equals("4"))
  772. {
  773. #region 产线对应关系
  774. UltraGridRow row = ultraGrid6.ActiveRow;
  775. int counm = 0;
  776. if (row == null)
  777. {
  778. MessageUtil.ShowTips("无数据,不能进行此操作!");
  779. return;
  780. }
  781. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid6.Rows)
  782. {
  783. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  784. {
  785. counm += 1;
  786. }
  787. }
  788. if (counm == 0)
  789. {
  790. MessageUtil.ShowTips("请选择产销系统与质保系统产线对应关系!");
  791. return;
  792. }
  793. ArrayList list = new ArrayList();
  794. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid6.Rows)
  795. {
  796. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  797. {
  798. ArrayList pram = new ArrayList();
  799. pram.Add(row.Cells["PLINE_CODE"].Text);
  800. pram.Add(uRow.Cells["ZB_PLINENAME"].Text);
  801. list.Add(pram);
  802. }
  803. }
  804. int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.deleteFactory", new Object[] { list }, this.ob);
  805. if (count > 0)
  806. {
  807. MessageUtil.ShowTips("删除成功!");
  808. doQueryProduct();
  809. }
  810. else
  811. {
  812. MessageUtil.ShowTips("删除失败!");
  813. }
  814. #endregion
  815. }
  816. else
  817. {
  818. #region 钢种对应关系
  819. UltraGridRow row = ultraGrid9.ActiveRow;
  820. int counm = 0;
  821. if (row == null)
  822. {
  823. MessageUtil.ShowTips("无数据,不能进行此操作!");
  824. return;
  825. }
  826. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid9.Rows)
  827. {
  828. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  829. {
  830. counm += 1;
  831. }
  832. }
  833. if (counm == 0)
  834. {
  835. MessageUtil.ShowTips("请选择产销系统与质保系统钢种对应关系!");
  836. return;
  837. }
  838. ArrayList list = new ArrayList();
  839. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ultraGrid9.Rows)
  840. {
  841. if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
  842. {
  843. ArrayList pram = new ArrayList();
  844. pram.Add(row.Cells["GRADECODE"].Text);
  845. pram.Add(uRow.Cells["ZB_GRADENAME"].Text);
  846. list.Add(pram);
  847. }
  848. }
  849. int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmVarietie.deleteGrade", new Object[] { list }, this.ob);
  850. if (count > 0)
  851. {
  852. MessageUtil.ShowTips("删除成功!");
  853. doQueryProduct();
  854. }
  855. else
  856. {
  857. MessageUtil.ShowTips("删除失败!");
  858. }
  859. #endregion
  860. }
  861. }
  862. /// <summary>
  863. /// 刷新
  864. /// </summary>
  865. private void doRefresh()
  866. {
  867. doQueryZB();
  868. }
  869. /// <summary>
  870. /// 查询质保系统数据
  871. /// </summary>
  872. private void doQueryZB()
  873. {
  874. try
  875. {
  876. this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
  877. if (Constant.WaitingForm == null)
  878. {
  879. Constant.WaitingForm = new WaitingForm();
  880. }
  881. Constant.WaitingForm.ShowToUser = true;
  882. Constant.WaitingForm.Show();
  883. Constant.WaitingForm.Update();
  884. if (ultraTabControl1.SelectedTab.Key.Equals("0"))
  885. {
  886. DataTable dt3 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryKind", null, this.ob);
  887. string intt = "";
  888. if (dt3.Rows.Count > 0)
  889. {
  890. for (int i = 0; i < dt3.Rows.Count; i++)
  891. {
  892. intt += "'" + dt3.Rows[i]["ZB_PRODUCNAME"].ToString() + "'" + ",";
  893. }
  894. }
  895. if (intt != "")
  896. {
  897. intt = intt.Substring(1, intt.Length - 3);
  898. }
  899. else
  900. intt = "";
  901. DataTable dt2 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getZBKind", new object[] { strStartTime, intt }, this.ob);
  902. GridHelper.CopyDataToDatatable(ref dt2, ref dataTable3, true);
  903. GridHelper.RefreshAndAutoSize(GridKind);
  904. ds1 = dt2.Copy();
  905. }
  906. else if (ultraTabControl1.SelectedTab.Key.Equals("1"))
  907. {
  908. DataTable dt3 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQuerySteel", null, this.ob);
  909. string intt = "";
  910. if (dt3.Rows.Count > 0)
  911. {
  912. for (int i = 0; i < dt3.Rows.Count; i++)
  913. {
  914. intt += "'" + dt3.Rows[i]["ZB_STEELNAME"].ToString() + "'" + ",";
  915. }
  916. }
  917. if (intt != "")
  918. {
  919. intt = intt.Substring(1, intt.Length - 3);
  920. }
  921. else
  922. intt = "";
  923. DataTable dt2 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getZBSteel", new object[] { strStartTime, intt }, this.ob);
  924. GridHelper.CopyDataToDatatable(ref dt2, ref dtZB_Steel, true);
  925. GridHelper.RefreshAndAutoSize(GridzbSteel);
  926. }
  927. else if (ultraTabControl1.SelectedTab.Key.Equals("2"))
  928. {
  929. DataTable dt3 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQuerySpec", null, this.ob);
  930. StringBuilder intt = new StringBuilder();
  931. ArrayList listData = new ArrayList();
  932. string ss = "";
  933. DataTable dt2 = null;
  934. if (dt3.Rows.Count > 0)
  935. {
  936. for (int i = 0; i < dt3.Rows.Count; i++)
  937. {
  938. intt.Append("'" + dt3.Rows[i]["ZB_SPEC_NAME"].ToString() + "'" + ",");
  939. }
  940. ss = intt.ToString();
  941. if (ss != "")
  942. {
  943. ss = ss.Substring(1, ss.Length - 3);
  944. }
  945. dt2 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getZBSpec", new object[] { strStartTime }, this.ob);
  946. }
  947. //string ss = intt.ToString();
  948. //if (ss != "
  949. //{
  950. // ss = ss.Substring(1, ss.Length - 3);
  951. //}
  952. //else
  953. // ss = "";
  954. //DataTable dt2 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getZBSpec", new object[] { strStartTime, ss }, this.ob);
  955. DataRow[] drs = dt2.Select("GG IN ('" + ss + "')");
  956. foreach (DataRow dr in drs)
  957. {
  958. dt2.Rows.Remove(dr);
  959. }
  960. GridHelper.CopyDataToDatatable(ref dt2, ref dtZB_Spec, true);
  961. GridHelper.RefreshAndAutoSize(GridzbSpec);
  962. }
  963. else if (ultraTabControl1.SelectedTab.Key.Equals("3"))
  964. {
  965. DataTable dt3 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryModel", null, this.ob);
  966. string intt = "";
  967. if (dt3.Rows.Count > 0)
  968. {
  969. for (int i = 0; i < dt3.Rows.Count; i++)
  970. {
  971. intt += "'" + dt3.Rows[i]["ZB_MODEL_DESC"].ToString() + "'" + ",";
  972. }
  973. }
  974. if (intt != "")
  975. {
  976. intt = intt.Substring(1, intt.Length - 3);
  977. }
  978. else
  979. intt = "";
  980. DataTable dt2 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getZBModel", new object[] { strStartTime, intt }, this.ob);
  981. GridHelper.CopyDataToDatatable(ref dt2, ref dtZB_Model, true);
  982. GridHelper.RefreshAndAutoSize(GridzbModel);
  983. }
  984. else if (ultraTabControl1.SelectedTab.Key.Equals("4"))
  985. {
  986. DataTable dt4 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryFactory", null, this.ob);
  987. string intt = "";
  988. if (dt4.Rows.Count > 0)
  989. {
  990. for (int i = 0; i < dt4.Rows.Count; i++)
  991. {
  992. intt += "'" + dt4.Rows[i]["ZB_PLINENAME"].ToString() + "'" + ",";
  993. }
  994. }
  995. if (intt != "")
  996. {
  997. intt = intt.Substring(1, intt.Length - 3);
  998. }
  999. else
  1000. intt = "";
  1001. DataTable dt2 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getZBFactory", new object[] { strStartTime, intt }, this.ob);
  1002. GridHelper.CopyDataToDatatable(ref dt2, ref dataTable6, true);
  1003. GridHelper.RefreshAndAutoSize(ultraGrid7);
  1004. }
  1005. else
  1006. {
  1007. DataTable dt5 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getQueryGrade", null, this.ob);
  1008. string intt = "";
  1009. if (dt5.Rows.Count > 0)
  1010. {
  1011. for (int i = 0; i < dt5.Rows.Count; i++)
  1012. {
  1013. intt += "'" + dt5.Rows[i]["ZB_GRADENAME"].ToString() + "'" + ",";
  1014. }
  1015. }
  1016. if (intt != "")
  1017. {
  1018. intt = intt.Substring(1, intt.Length - 3);
  1019. }
  1020. else
  1021. intt = "";
  1022. DataTable dt2 = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.getZBGrade", new object[] { strStartTime, intt }, this.ob);
  1023. GridHelper.CopyDataToDatatable(ref dt2, ref dataTable9, true);
  1024. GridHelper.RefreshAndAutoSize(ultraGrid10);
  1025. }
  1026. this.Cursor = Cursors.Default;
  1027. Constant.WaitingForm.ShowToUser = false;
  1028. Constant.WaitingForm.Close();
  1029. Constant.WaitingForm = null;
  1030. }
  1031. catch (Exception e)
  1032. {
  1033. this.Cursor = Cursors.Default;
  1034. Constant.WaitingForm.ShowToUser = false;
  1035. Constant.WaitingForm.Close();
  1036. Constant.WaitingForm = null;
  1037. }
  1038. }
  1039. /// <summary>
  1040. /// 产销品名对应质保品名关系
  1041. /// </summary>
  1042. /// <param name="sender"></param>
  1043. /// <param name="e"></param>
  1044. private void GridProducode_AfterRowActivate(object sender, EventArgs e)
  1045. {
  1046. doQueryProduct();
  1047. }
  1048. /// <summary>
  1049. /// 产销钢级对应质保钢级关系
  1050. /// </summary>
  1051. /// <param name="sender"></param>
  1052. /// <param name="e"></param>
  1053. private void GridSteel_AfterRowActivate(object sender, EventArgs e)
  1054. {
  1055. doQueryProduct();
  1056. }
  1057. /// <summary>
  1058. /// 产销规格对应质保规格关系
  1059. /// </summary>
  1060. /// <param name="sender"></param>
  1061. /// <param name="e"></param>
  1062. private void GridSpec_AfterRowActivate(object sender, EventArgs e)
  1063. {
  1064. doQueryProduct();
  1065. }
  1066. /// <summary>
  1067. /// 产销扣型对应质保扣型关系
  1068. /// </summary>
  1069. /// <param name="sender"></param>
  1070. /// <param name="e"></param>
  1071. private void GridModel_AfterRowActivate(object sender, EventArgs e)
  1072. {
  1073. doQueryProduct();
  1074. }
  1075. /// <summary>
  1076. /// 产销产线对应质保产线关系
  1077. /// </summary>
  1078. /// <param name="sender"></param>
  1079. /// <param name="e"></param>
  1080. private void ultraGrid5_AfterRowActivate(object sender, EventArgs e)
  1081. {
  1082. doQueryProduct();
  1083. }
  1084. /// <summary>
  1085. /// 产销钢种对应质保钢种关系
  1086. /// </summary>
  1087. /// <param name="sender"></param>
  1088. /// <param name="e"></param>
  1089. private void ultraGrid8_AfterRowActivate(object sender, EventArgs e)
  1090. {
  1091. doQueryProduct();
  1092. }
  1093. /// <summary>
  1094. /// 查询对应关系
  1095. /// </summary>
  1096. private void doQueryProduct()
  1097. {
  1098. if (ultraTabControl1.SelectedTab.Key.Equals("0"))
  1099. {
  1100. UltraGridRow row = GridProducode.ActiveRow;
  1101. if (row == null) return;
  1102. string strProduct = row.Cells["PRODUCCODE"].Text;
  1103. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.queryProduct", new object[] { strProduct }, this.ob);
  1104. GridHelper.CopyDataToDatatable(ref dt, ref dataTable2, true);
  1105. GridHelper.RefreshAndAutoSize(ultraGrid1);
  1106. }
  1107. else if (ultraTabControl1.SelectedTab.Key.Equals("1"))
  1108. {
  1109. UltraGridRow row = GridSteel.ActiveRow;
  1110. if (row == null) return;
  1111. string strSteel = row.Cells["STEELCODE"].Text;
  1112. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.querySteel", new object[] { strSteel }, this.ob);
  1113. GridHelper.CopyDataToDatatable(ref dt, ref dtSteel, true);
  1114. GridHelper.RefreshAndAutoSize(ultraGrid2);
  1115. }
  1116. else if (ultraTabControl1.SelectedTab.Key.Equals("2"))
  1117. {
  1118. UltraGridRow row = GridSpec.ActiveRow;
  1119. if (row == null) return;
  1120. string strSpec = row.Cells["SPEC_CODE"].Text;
  1121. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.querySpec", new object[] { strSpec }, this.ob);
  1122. GridHelper.CopyDataToDatatable(ref dt, ref dtSpec, true);
  1123. GridHelper.RefreshAndAutoSize(ultraGrid3);
  1124. }
  1125. else if (ultraTabControl1.SelectedTab.Key.Equals("3"))
  1126. {
  1127. UltraGridRow row = GridModel.ActiveRow;
  1128. if (row == null) return;
  1129. string strModel = row.Cells["MODEL_CODE"].Text;
  1130. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.queryModel", new object[] { strModel }, this.ob);
  1131. GridHelper.CopyDataToDatatable(ref dt, ref dtModel, true);
  1132. GridHelper.RefreshAndAutoSize(ultraGrid4);
  1133. }
  1134. else if (ultraTabControl1.SelectedTab.Key.Equals("4"))
  1135. {
  1136. UltraGridRow row = this.ultraGrid5.ActiveRow;
  1137. if (row == null) return;
  1138. string strfactory = row.Cells["PLINE_CODE"].Text;
  1139. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.queryFactory", new object[] { strfactory }, this.ob);
  1140. GridHelper.CopyDataToDatatable(ref dt, ref dataTable5, true);
  1141. GridHelper.RefreshAndAutoSize(ultraGrid6);
  1142. }
  1143. else
  1144. {
  1145. UltraGridRow row = this.ultraGrid8.ActiveRow;
  1146. if (row == null) return;
  1147. string strgrade = row.Cells["GRADECODE"].Text;
  1148. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmVarietie.queryGrade", new object[] { strgrade }, this.ob);
  1149. GridHelper.CopyDataToDatatable(ref dt, ref dataTable8, true);
  1150. GridHelper.RefreshAndAutoSize(ultraGrid9);
  1151. }
  1152. }
  1153. /// <summary>
  1154. /// 托选
  1155. /// </summary>
  1156. /// <param name="sender"></param>
  1157. /// <param name="e"></param>
  1158. private void GridALL_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
  1159. {
  1160. if (ultraTabControl1.SelectedTab.Key.Equals("0"))
  1161. {
  1162. try
  1163. {
  1164. ultraGrid1.UpdateData();
  1165. GridKind.UpdateData();
  1166. foreach (UltraGridRow r in ultraGrid1.Rows)
  1167. {
  1168. r.Cells["CHK"].Value = r.Selected;
  1169. }
  1170. foreach (UltraGridRow r1 in GridKind.Rows)
  1171. {
  1172. r1.Cells["CHK"].Value = r1.Selected;
  1173. }
  1174. }
  1175. catch { }
  1176. }
  1177. else if (ultraTabControl1.SelectedTab.Key.Equals("1"))
  1178. {
  1179. try
  1180. {
  1181. ultraGrid2.UpdateData();
  1182. GridzbSteel.UpdateData();
  1183. foreach (UltraGridRow r in ultraGrid2.Rows)
  1184. {
  1185. r.Cells["CHK"].Value = r.Selected;
  1186. }
  1187. foreach (UltraGridRow r1 in GridzbSteel.Rows)
  1188. {
  1189. r1.Cells["CHK"].Value = r1.Selected;
  1190. }
  1191. }
  1192. catch { }
  1193. }
  1194. else if (ultraTabControl1.SelectedTab.Key.Equals("2"))
  1195. {
  1196. try
  1197. {
  1198. ultraGrid3.UpdateData();
  1199. GridzbSpec.UpdateData();
  1200. foreach (UltraGridRow r in ultraGrid3.Rows)
  1201. {
  1202. r.Cells["CHK"].Value = r.Selected;
  1203. }
  1204. foreach (UltraGridRow r1 in GridzbSpec.Rows)
  1205. {
  1206. r1.Cells["CHK"].Value = r1.Selected;
  1207. }
  1208. }
  1209. catch { }
  1210. }
  1211. else if (ultraTabControl1.SelectedTab.Key.Equals("3"))
  1212. {
  1213. try
  1214. {
  1215. ultraGrid4.UpdateData();
  1216. GridzbModel.UpdateData();
  1217. foreach (UltraGridRow r in ultraGrid4.Rows)
  1218. {
  1219. r.Cells["CHK"].Value = r.Selected;
  1220. }
  1221. foreach (UltraGridRow r1 in GridzbModel.Rows)
  1222. {
  1223. r1.Cells["CHK"].Value = r1.Selected;
  1224. }
  1225. }
  1226. catch { }
  1227. }
  1228. else if (ultraTabControl1.SelectedTab.Key.Equals("4"))
  1229. {
  1230. try
  1231. {
  1232. ultraGrid6.UpdateData();
  1233. ultraGrid5.UpdateData();
  1234. foreach (UltraGridRow r in ultraGrid6.Rows)
  1235. {
  1236. r.Cells["CHK"].Value = r.Selected;
  1237. }
  1238. foreach (UltraGridRow r1 in ultraGrid5.Rows)
  1239. {
  1240. r1.Cells["CHK"].Value = r1.Selected;
  1241. }
  1242. }
  1243. catch { }
  1244. }
  1245. else
  1246. {
  1247. try
  1248. {
  1249. ultraGrid9.UpdateData();
  1250. ultraGrid8.UpdateData();
  1251. foreach (UltraGridRow r in ultraGrid9.Rows)
  1252. {
  1253. r.Cells["CHK"].Value = r.Selected;
  1254. }
  1255. foreach (UltraGridRow r1 in ultraGrid8.Rows)
  1256. {
  1257. r1.Cells["CHK"].Value = r1.Selected;
  1258. }
  1259. }
  1260. catch { }
  1261. }
  1262. }
  1263. private void GridP1_Click(object sender, EventArgs e)
  1264. {
  1265. InCoun = 1;
  1266. }
  1267. private void GridP2_Click(object sender, EventArgs e)
  1268. {
  1269. InCoun = 2;
  1270. }
  1271. private void GridP3_Click(object sender, EventArgs e)
  1272. {
  1273. InCoun = 3;
  1274. }
  1275. }
  1276. }