FrmVarietie.cs 50 KB

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