FrmVarietie.cs 50 KB

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