SyncPro.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. using com.steering.mes.zgmil.entity;
  2. using Core.Mes.Client.Comm.Control;
  3. using Core.Mes.Client.Comm.Server;
  4. using Core.StlMes.Client.ZGMil.Common;
  5. using Core.StlMes.Client.ZGMil.Entity;
  6. using CoreFS.CA06;
  7. using Infragistics.Win.UltraWinGrid;
  8. using System;
  9. using System.Collections;
  10. using System.Collections.Generic;
  11. using System.ComponentModel;
  12. using System.Data;
  13. using System.Drawing;
  14. using System.Linq;
  15. using System.Text;
  16. using System.Windows.Forms;
  17. namespace Core.StlMes.Client.ZGMil.NodeResultQuery
  18. {
  19. public partial class SyncPro : FrmBase
  20. {
  21. private OpeBase ob;
  22. public OpeBase Ob
  23. {
  24. get { return ob; }
  25. set { ob = value; }
  26. }
  27. MilPlanEntity milplian = new MilPlanEntity();
  28. MilFeedPlanEntity feedplan = new MilFeedPlanEntity();
  29. ArrayList arr = new ArrayList();
  30. string PlineCode = "";
  31. string pline = "";
  32. ArrayList listheatno = new ArrayList();
  33. public SyncPro(OpeBase ob,string plinecode)
  34. {
  35. InitializeComponent();
  36. foreach (UltraGridColumn ugc in ultraGridSync.DisplayLayout.Bands[0].Columns)
  37. {
  38. if (!ugc.Key.ToString().Equals("Check"))
  39. {
  40. ugc.CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  41. }
  42. }
  43. foreach (UltraGridColumn ugc in ultraGridSync.DisplayLayout.Bands[1].Columns)
  44. {
  45. ugc.CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  46. }
  47. foreach (UltraGridColumn ugc in ultraGridSyncHas.DisplayLayout.Bands[0].Columns)
  48. {
  49. if (!ugc.Key.ToString().Equals("Check"))
  50. {
  51. ugc.CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  52. }
  53. }
  54. foreach (UltraGridColumn ugc in ultraGridSyncHas.DisplayLayout.Bands[1].Columns)
  55. {
  56. ugc.CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  57. }
  58. this.Ob = ob;
  59. this.pline = plinecode;
  60. if (plinecode.Equals("C008"))
  61. {
  62. this.PlineCode = "250机组";
  63. }
  64. if (plinecode.Equals("C010"))
  65. {
  66. this.PlineCode = "168机组";
  67. }
  68. if (plinecode.Equals("C017"))
  69. {
  70. this.PlineCode = "460机组";
  71. }
  72. if (plinecode.Equals("C009"))
  73. {
  74. this.PlineCode = "258机组";
  75. }
  76. if (plinecode.Equals("C012"))
  77. {
  78. this.PlineCode = "ASSEL机组";
  79. }
  80. }
  81. protected override void OnShown(EventArgs e)
  82. {
  83. base.OnShown(e);
  84. foreach (UltraGridColumn ugc in ultraGridSync.DisplayLayout.Bands[0].Columns)
  85. {
  86. ugc.SortIndicator = SortIndicator.Disabled;
  87. }
  88. foreach (UltraGridColumn ugc in ultraGridSyncHas.DisplayLayout.Bands[0].Columns)
  89. {
  90. ugc.SortIndicator = SortIndicator.Disabled;
  91. }
  92. }
  93. public ArrayList Getheatno()
  94. {
  95. ArrayList list = new ArrayList();
  96. DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.GetSQLDate.PlanQuery2", new object[] { "2", pline }, this.ob);
  97. if (dt1.Rows.Count > 0)
  98. {
  99. for(int i=0;i<dt1.Rows.Count;i++)
  100. {
  101. string heatno = "";
  102. heatno = dt1.Rows[i]["judge_stove_no"].ToString();
  103. listheatno.Add(heatno);
  104. }
  105. }
  106. return listheatno;
  107. }
  108. public void QuerySql()
  109. {
  110. listheatno.Clear();
  111. listheatno = this.Getheatno();
  112. #region -------可同步计划----------
  113. if (ultraTabControl1.Tabs[0].Visible == true)//查询科同步计划
  114. {
  115. String flag = "1";
  116. DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.GetSQLDate.PlanQuery1", new object[] { flag,PlineCode }, this.ob);
  117. if (dt1.Rows.Count > 0)
  118. {
  119. //----修改对应字段值
  120. for (int j = 0; j < dt1.Rows.Count;j++ )
  121. {
  122. DataRow dr = dt1.Rows[j];
  123. for (int i = 0; i < listheatno.Count; i++)
  124. {
  125. if (dr["judge_stove_no"].ToString().Equals(listheatno[i]))
  126. {
  127. dt1.Rows.Remove(dr);
  128. j = - 1;
  129. break;
  130. }
  131. }
  132. }
  133. }
  134. if(dt1.Rows.Count>0)
  135. {
  136. foreach (DataRow dr in dt1.Rows)
  137. {
  138. if (string.IsNullOrEmpty(dr["BRANCH"].ToString()))
  139. {
  140. dr["BRANCH"] = "0";
  141. }
  142. else if (dr["BRANCH"].Equals("NULL"))
  143. {
  144. dr["BRANCH"] = "0";
  145. }
  146. if (string.IsNullOrEmpty(dr["CUT_LENGTH"].ToString()))
  147. {
  148. dr["CUT_LENGTH"] = "0";
  149. }
  150. else if (dr["CUT_LENGTH"].Equals("NULL"))
  151. {
  152. dr["CUT_LENGTH"] = "0";
  153. }
  154. if (string.IsNullOrEmpty(dr["CUT_WEIGHT"].ToString()))
  155. {
  156. dr["CUT_WEIGHT"] = "0";
  157. }
  158. else if (dr["CUT_WEIGHT"].Equals("NULL"))
  159. {
  160. dr["CUT_WEIGHT"] = "0";
  161. }
  162. double dbz = (Convert.ToDouble(dr["管坯上料吨"].ToString()) - Convert.ToDouble(dr["CUT_WEIGHT"].ToString())) / Convert.ToDouble(dr["DB_NUM"].ToString());
  163. dr["DB_HEIGHT"] = Math.Round(dbz, 3, MidpointRounding.AwayFromZero);
  164. }
  165. //------------------
  166. GridHelper.CopyDataToDatatable(ref dt1, ref dtplan, true);
  167. //listheatno.Clear();
  168. //listheatno = this.Getheatno();
  169. //foreach (UltraGridRow ugr in ultraGridSync.DisplayLayout.Bands[0].Layout.Rows)
  170. //{
  171. // for (int i = 0; i < listheatno.Count; i++)
  172. // {
  173. // if (ugr.Cells["judge_stove_no"].Value.ToString().Equals(listheatno[i]))
  174. // ugr.Appearance.BackColor = Color.YellowGreen;
  175. // }
  176. //}
  177. DataTable dt2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.GetSQLDate.FeedQuery1", new object[] { flag, PlineCode }, this.ob);
  178. //----修改对应字段值
  179. if (dt2.Rows.Count > 0)
  180. {
  181. for (int j = 0; j < dt2.Rows.Count; j++)
  182. {
  183. DataRow dr = dt2.Rows[j];
  184. for (int i = 0; i < listheatno.Count; i++)
  185. {
  186. if (dr["judge_stove_no"].ToString().Equals(listheatno[i]))
  187. {
  188. dt2.Rows.Remove(dr);
  189. j = -1;
  190. break;
  191. }
  192. }
  193. }
  194. }
  195. if (dt2.Rows.Count > 0)
  196. {
  197. foreach (DataRow dr in dt2.Rows)
  198. {
  199. if (string.IsNullOrEmpty(dr["CUT_TARGET"].ToString()))
  200. {
  201. dr["CUT_TARGET"] = "";
  202. }
  203. if (string.IsNullOrEmpty(dr["USE_LENGTH"].ToString()))
  204. {
  205. dr["USE_LENGTH"] = 0;
  206. }
  207. double dzz = Convert.ToDouble(dr["MAT_TOTAL_HEIGHT"].ToString()) / Convert.ToDouble(dr["FEED_NUM"].ToString());
  208. dr["MAT_HEIGHT"] = Math.Round(dzz, 3, MidpointRounding.AwayFromZero);
  209. if (string.IsNullOrEmpty(dr["切余长度"].ToString()))
  210. {
  211. dr["CUT_LENGTH"] = 0;
  212. dr["NON_USE_LENGTH"] = 0;
  213. }
  214. else
  215. {
  216. double qyzc = Convert.ToDouble(dr["切余长度"].ToString()) * Convert.ToDouble(dr["FEED_NUM"].ToString());
  217. dr["CUT_LENGTH"] = qyzc.ToString();
  218. dr["NON_USE_LENGTH"] = qyzc.ToString();
  219. }
  220. if (string.IsNullOrEmpty(dr["切余重"].ToString()))
  221. {
  222. dr["CUT_WEIGHT"] = 0;
  223. }
  224. else
  225. {
  226. double qyz = Convert.ToDouble(dr["切余重"].ToString()) * Convert.ToDouble(dr["FEED_NUM"].ToString());
  227. dr["CUT_WEIGHT"] = Math.Round(qyz, 3, MidpointRounding.AwayFromZero);
  228. }
  229. double dbz = (Convert.ToDouble(dr["MAT_TOTAL_HEIGHT"].ToString()) - Convert.ToDouble(dr["CUT_WEIGHT"].ToString())) / (Convert.ToDouble(dr["管坯上料单倍尺支"].ToString()) * 1000);
  230. dbz = dbz / 1000;
  231. dr["DB_HEIGHT"] = Math.Round(dbz, 3, MidpointRounding.AwayFromZero);
  232. }
  233. }
  234. //------------------
  235. GridHelper.CopyDataToDatatable(ref dt2, ref dtfeed, true);
  236. }
  237. }
  238. #endregion
  239. //foreach (UltraGridRow ugr in this.ultraGridSync.Rows)
  240. //{
  241. // ugr.Cells["heatno"].Value = BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString());
  242. //}
  243. }
  244. public void QueryOracle()
  245. {
  246. #region -------已同步计划----------
  247. if (ultraTabControl1.Tabs[1].Visible == true)
  248. {
  249. //值查询已同步的并且未开始的计划
  250. string flag = "2";
  251. DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.coup.GetSQLDate.PlanQuery2", new object[] { flag, pline }, this.ob);
  252. if (dt1.Rows.Count > 0)
  253. {
  254. GridHelper.CopyDataToDatatable(ref dt1, ref dtPlanHas, true);
  255. //foreach (DataRow dr in dtPlanHas.Rows)
  256. //{
  257. // dr["heatno"] = dr["JUDGE_STOVE_NO"].ToString().Substring(0, 6);
  258. //}
  259. }
  260. DataTable dt2 = ServerHelper.GetData("com.steering.mes.zgmil.coup.GetSQLDate.FeedQuery2", new object[] { flag, pline }, this.ob);
  261. if (dt2.Rows.Count > 0)
  262. {
  263. GridHelper.CopyDataToDatatable(ref dt2, ref dtFeedHas, true);
  264. //foreach (DataRow dr in dtFeedHas.Rows)
  265. //{
  266. // dr["heatno"] = dr["JUDGE_STOVE_NO"].ToString().Substring(0, 6);
  267. //}
  268. }
  269. }
  270. #endregion
  271. //foreach (UltraGridRow ugr in this.ultraGridSyncHas.Rows)
  272. //{
  273. // ugr.Cells["heatno"].Value = BaseMethod.getJudgeStoveNo(ugr.Cells["JUDGE_STOVE_NO"].Value.ToString());
  274. //}
  275. }
  276. /// <summary>
  277. /// 计划接收
  278. /// </summary>
  279. public void SysncPlan()
  280. {
  281. int result = 0;
  282. int count = 0;
  283. ultraGridSync.UpdateData();
  284. foreach (UltraGridRow prow in ultraGridSync.DisplayLayout.Bands[0].Layout.Rows)
  285. {
  286. if (Convert.ToBoolean(prow.Cells["Check"].Text)==true)
  287. {
  288. result += 1;
  289. milplian.Clear();
  290. milplian = NativeMethod.GetUltraGridRowToEntity(prow, ultraGridSync, milplian, 0);
  291. if (milplian.Type.ToString().Equals("正常计划"))
  292. {
  293. milplian.Type = "0";
  294. }
  295. else
  296. {
  297. milplian.Type = "1";
  298. }
  299. DataTable dthas = ServerHelper.GetData("com.steering.mes.zgmil.coup.GetSQLDate.CheckPlan", new object[] { milplian }, this.ob);
  300. if (dthas.Rows.Count > 0)
  301. {
  302. MessageBox.Show("炉号:【" + milplian.JudgeStoveNo.ToString().Substring(0,6) + "】已同步,请先回退后再同步。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  303. return;
  304. }
  305. if (prow.HasChild())
  306. {
  307. arr.Clear();
  308. foreach (UltraGridRow crow in prow.ChildBands["Relation1"].Rows)
  309. {
  310. MilFeedPlanEntity feedplans = new MilFeedPlanEntity();
  311. // feedplan.Clear();
  312. feedplans = NativeMethod.GetUltraGridRowToEntity(crow, ultraGridSync, feedplans, 1);
  313. arr.Add(feedplans);
  314. }
  315. }
  316. int t = ServerHelper.SetData("com.steering.mes.zgmil.coup.GetSQLDate.SysncPlan", new object[] { milplian, arr }, this.ob);
  317. count += t;
  318. if (t > 0)
  319. {
  320. int counts= ServerHelper.SetData("com.steering.mes.zgmil.coup.GetSQLDate.AfterSysncPlan", new object[] { milplian, arr }, this.ob);
  321. if (counts < 1)
  322. {
  323. ServerHelper.SetData("com.steering.mes.zgmil.coup.GetSQLDate.AfterSysncPlanBack", new object[] { milplian, arr }, this.ob);
  324. MessageBox.Show("炉号:【" + milplian.JudgeStoveNo + "】同步失败,请查找原因后再次同步", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  325. }
  326. }
  327. }
  328. }
  329. if (result == count)
  330. {
  331. dtfeed.Rows.Clear();
  332. dtplan.Rows.Clear();
  333. QuerySql();
  334. dtFeedHas.Rows.Clear();
  335. dtPlanHas.Rows.Clear();
  336. QueryOracle();
  337. MessageBox.Show("所选计划同步完成。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
  338. }
  339. }
  340. public void SysncPlanAll()
  341. {
  342. int result = 0;
  343. int count = 0;
  344. int counts = ServerHelper.SetData("com.steering.mes.zgmil.coup.GetSQLDate.DelOraclePlan", new object[] { pline }, this.ob);
  345. if (counts > 0)
  346. {
  347. foreach (UltraGridRow prow in ultraGridSync.DisplayLayout.Bands[0].Layout.Rows)
  348. {
  349. result += 1;
  350. milplian.Clear();
  351. milplian = NativeMethod.GetUltraGridRowToEntity(prow, ultraGridSync, milplian, 0);
  352. if (prow.HasChild())
  353. {
  354. arr.Clear();
  355. foreach (UltraGridRow crow in prow.ChildBands["Relation1"].Rows)
  356. {
  357. MilFeedPlanEntity feedplans = new MilFeedPlanEntity();
  358. //feedplans.Clear();
  359. feedplans = NativeMethod.GetUltraGridRowToEntity(crow, ultraGridSync, feedplans, 1);
  360. arr.Add(feedplans);
  361. }
  362. }
  363. count += ServerHelper.SetData("com.steering.mes.zgmil.coup.GetSQLDate.SysncPlan", new object[] { milplian, arr }, this.ob);
  364. }
  365. }
  366. if (result == count)
  367. {
  368. dtfeed.Rows.Clear();
  369. dtplan.Rows.Clear();
  370. QuerySql();
  371. dtFeedHas.Rows.Clear();
  372. dtPlanHas.Rows.Clear();
  373. QueryOracle();
  374. MessageBox.Show("全部计划同步完成。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
  375. }
  376. }
  377. /// <summary>
  378. /// 计划回退
  379. /// </summary>
  380. public void SysncPlanBack()
  381. {
  382. arr.Clear();
  383. ultraGridSyncHas.UpdateData();
  384. foreach (UltraGridRow prow in ultraGridSyncHas.DisplayLayout.Bands[0].Layout.Rows)
  385. {
  386. if (prow.Cells["Check"].Value.ToString().Equals("True"))
  387. {
  388. MilPlanEntity milplians = new MilPlanEntity();
  389. //milplians.Clear();
  390. milplians = NativeMethod.GetUltraGridRowToEntity(prow, ultraGridSyncHas, milplians, 0);
  391. arr.Add(milplians);
  392. DataTable dthas = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getBackSlabFlag", new object[] { milplians }, this.ob);
  393. if (dthas.Rows.Count > 0)
  394. {
  395. MessageBox.Show("炉号:【" + BaseMethod.getJudgeStoveNo(milplians.JudgeStoveNo.ToString()) + "】是回炉坯组炉炉号,请到【回炉坯】操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  396. return;
  397. }
  398. }
  399. }
  400. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.GetSQLDate.SysncPlanBack", new object[] { arr }, this.ob);
  401. if (count > 0)
  402. {
  403. dtfeed.Rows.Clear();
  404. dtplan.Rows.Clear();
  405. QuerySql();
  406. dtFeedHas.Rows.Clear();
  407. dtPlanHas.Rows.Clear();
  408. QueryOracle();
  409. ServerHelper.SetData("com.steering.mes.zgmil.coup.GetSQLDate.AfterSysncPlanBack", new object[] { arr }, this.ob);
  410. MessageBox.Show("所选计划回退完成。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
  411. }
  412. }
  413. public void SysncPlanBackAll()
  414. {
  415. arr.Clear();
  416. foreach (UltraGridRow prow in ultraGridSyncHas.DisplayLayout.Bands[0].Layout.Rows)
  417. {
  418. MilPlanEntity milplians = new MilPlanEntity();
  419. //milplians.Clear();
  420. milplians = NativeMethod.GetUltraGridRowToEntity(prow, ultraGridSyncHas, milplians, 0);
  421. arr.Add(milplians);
  422. }
  423. int count = ServerHelper.SetData("com.steering.mes.zgmil.coup.GetSQLDate.SysncPlanBack", new object[] { arr }, this.ob);
  424. if (count > 0)
  425. {
  426. MessageBox.Show("所选计划回退完成。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
  427. }
  428. dtfeed.Rows.Clear();
  429. dtplan.Rows.Clear();
  430. QuerySql();
  431. dtFeedHas.Rows.Clear();
  432. dtPlanHas.Rows.Clear();
  433. QueryOracle();
  434. }
  435. private void BtnQuery_Click(object sender, EventArgs e)
  436. {
  437. dtfeed.Rows.Clear();
  438. dtplan.Rows.Clear();
  439. QuerySql();
  440. dtFeedHas.Rows.Clear();
  441. dtPlanHas.Rows.Clear();
  442. QueryOracle();
  443. }
  444. private void BtnSysnc_Click(object sender, EventArgs e)
  445. {
  446. SysncPlan();
  447. }
  448. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  449. {
  450. if (ultraTabControl1.SelectedTab==ultraTabControl1.Tabs[0])
  451. {
  452. //ultraTabControl1.Tabs[1].Visible = false;
  453. dtfeed.Rows.Clear();
  454. dtplan.Rows.Clear();
  455. QuerySql();
  456. BtnSysnc.Enabled = true;
  457. // BtnSysncAll.Enabled = true;
  458. BtnBack.Enabled = false;
  459. // BtnBackAll.Enabled = false;
  460. }
  461. if (ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[1])
  462. {
  463. //ultraTabControl1.Tabs[0].Visible = false;
  464. dtFeedHas.Rows.Clear();
  465. dtPlanHas.Rows.Clear();
  466. QueryOracle();
  467. BtnSysnc.Enabled = false;
  468. // BtnSysncAll.Enabled = false;
  469. BtnBack.Enabled = true;
  470. //BtnBackAll.Enabled = true;
  471. }
  472. }
  473. private void BtnBack_Click(object sender, EventArgs e)
  474. {
  475. SysncPlanBack();
  476. }
  477. private void BtnSysncAll_Click(object sender, EventArgs e)
  478. {
  479. SysncPlanAll();
  480. }
  481. private void BtnBackAll_Click(object sender, EventArgs e)
  482. {
  483. SysncPlanBackAll();
  484. }
  485. private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  486. {
  487. if (this.ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[0])
  488. {
  489. foreach (UltraGridRow prow in ultraGridSync.DisplayLayout.Bands[0].Layout.Rows)
  490. {
  491. prow.Cells["Check"].Value = true;
  492. }
  493. }
  494. if (this.ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[1])
  495. {
  496. foreach (UltraGridRow prow in ultraGridSyncHas.DisplayLayout.Bands[0].Layout.Rows)
  497. {
  498. prow.Cells["Check"].Value = true;
  499. }
  500. }
  501. }
  502. private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  503. {
  504. if (this.ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[0])
  505. {
  506. foreach (UltraGridRow prow in ultraGridSync.DisplayLayout.Bands[0].Layout.Rows)
  507. {
  508. prow.Cells["Check"].Value = false;
  509. }
  510. }
  511. if (this.ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[1])
  512. {
  513. foreach (UltraGridRow prow in ultraGridSyncHas.DisplayLayout.Bands[0].Layout.Rows)
  514. {
  515. prow.Cells["Check"].Value = false;
  516. }
  517. }
  518. }
  519. public void choose()
  520. {
  521. if (this.ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[0])
  522. {
  523. foreach (UltraGridRow prow in ultraGridSync.DisplayLayout.Bands[0].Layout.Rows)
  524. {
  525. prow.Cells["Check"].Value = true;
  526. }
  527. }
  528. if (this.ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[1])
  529. {
  530. foreach (UltraGridRow prow in ultraGridSyncHas.DisplayLayout.Bands[0].Layout.Rows)
  531. {
  532. prow.Cells["Check"].Value = true;
  533. }
  534. }
  535. }
  536. public void unchoose()
  537. {
  538. if (this.ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[0])
  539. {
  540. foreach (UltraGridRow prow in ultraGridSync.DisplayLayout.Bands[0].Layout.Rows)
  541. {
  542. prow.Cells["Check"].Value = false;
  543. }
  544. }
  545. if (this.ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[1])
  546. {
  547. foreach (UltraGridRow prow in ultraGridSyncHas.DisplayLayout.Bands[0].Layout.Rows)
  548. {
  549. prow.Cells["Check"].Value = false;
  550. }
  551. }
  552. }
  553. public void query()
  554. {
  555. dtfeed.Rows.Clear();
  556. dtplan.Rows.Clear();
  557. QuerySql();
  558. dtFeedHas.Rows.Clear();
  559. dtPlanHas.Rows.Clear();
  560. QueryOracle();
  561. }
  562. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  563. {
  564. switch(e.Tool.Key)
  565. {
  566. case "query":
  567. query();
  568. break;
  569. case "recevice":
  570. if (ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[0])
  571. {
  572. SysncPlan();
  573. }
  574. else
  575. {
  576. MessageBox.Show("当前显示计划为已接收计划,不允许进行计划接收操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  577. }
  578. break;
  579. case "unrecevice":
  580. if (ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[1])
  581. {
  582. SysncPlanBack();
  583. }
  584. else
  585. {
  586. MessageBox.Show("当前显示计划为待接收计划,不允许进行计划回退操作。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  587. }
  588. break;
  589. case "choose":
  590. choose();
  591. break;
  592. case "unchoose":
  593. unchoose();
  594. break;
  595. case "close":
  596. this.Close();
  597. break;
  598. }
  599. }
  600. }
  601. }