frmCostCalculation.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.PnCost.Models;
  5. using CoreFS.CA06;
  6. using System;
  7. using System.Collections;
  8. using System.Collections.Generic;
  9. using System.ComponentModel;
  10. using System.Data;
  11. using System.Drawing;
  12. using System.Linq;
  13. using System.Text;
  14. using System.Windows.Forms;
  15. namespace Core.StlMes.Client.PnCost
  16. {
  17. public partial class frmCostCalculation : FrmBase
  18. {
  19. #region 定义变量
  20. private string plineID = "first";
  21. private string flagA;
  22. private string flagD;
  23. private string flagE;
  24. private string flagF;
  25. private string flagG;
  26. #endregion
  27. #region 初始化
  28. public frmCostCalculation()
  29. {
  30. InitializeComponent();
  31. }
  32. private void frmCostCalculation_Load(object sender, EventArgs e)
  33. {
  34. EntityHelper.ShowGridCaption<CostCalculationGtlEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  35. EntityHelper.ShowGridCaption<CostCalculationAEntity>(ultraGrid2.DisplayLayout.Bands[0]);
  36. EntityHelper.ShowGridCaption<CostCalculationDEntity>(ultraGrid3.DisplayLayout.Bands[0]);
  37. EntityHelper.ShowGridCaption<CostCalculationEEntity>(ultraGrid4.DisplayLayout.Bands[0]);
  38. EntityHelper.ShowGridCaption<CostCalculationFEntity>(ultraGrid5.DisplayLayout.Bands[0]);
  39. EntityHelper.ShowGridCaption<CostCalculationGEntity>(ultraGrid6.DisplayLayout.Bands[0]);
  40. EntityHelper.ShowGridCaption<CostCalculationErrorEntity>(ultraGrid7.DisplayLayout.Bands[0]);
  41. ultraCheckEditor3.Checked = false;
  42. ultraTextEditor1.Enabled = false;
  43. for (int i = 2000; i < 2051; i++)
  44. {
  45. yeardrop.Items.Add(i);
  46. }
  47. string str1 = "";
  48. for (int i = 1; i < 10; i++)
  49. {
  50. str1 = "0" + i.ToString2();
  51. monthdrop.Items.Add(str1);
  52. }
  53. monthdrop.Items.Add(10);
  54. monthdrop.Items.Add(11);
  55. monthdrop.Items.Add(12);
  56. yeardrop.Value = System.DateTime.Now.Year.ToString2();
  57. monthdrop.Value = System.DateTime.Now.Month.ToString2();
  58. DataTable dt = ServerHelper.GetData("com.steering.pss.pncost.base.ComCalculation.querypliao",
  59. new object[] { }, ob);
  60. ulcmeBaseWL.DisplayMember = "BASENAME";
  61. ulcmeBaseWL.ValueMember = "BASECODE";
  62. ulcmeBaseWL.DataSource = dt;
  63. }
  64. #endregion
  65. #region 方法
  66. public override void ToolBar_Click(object sender, string ToolbarKey)
  67. {
  68. base.ToolBar_Click(sender, ToolbarKey);
  69. switch (ToolbarKey)
  70. {
  71. case "Query":
  72. Query();
  73. break;
  74. case "Refresh":
  75. Refresh();
  76. break;
  77. case "CostMain":
  78. CostMain();
  79. break;
  80. case "Close":
  81. this.Close();
  82. break;
  83. case "Export":
  84. Export();
  85. break;
  86. }
  87. }
  88. private void CostMain()
  89. {
  90. WaitingForm2 wf = new WaitingForm2();
  91. wf.Msg = "正在计算,请稍候......";
  92. wf.Show();
  93. wf.Update();
  94. string year = yeardrop.Value.ToString2();
  95. string month = monthdrop.Value.ToString2();
  96. string[] results = (string[])ServerHelper.SetDataReturnObj("com.steering.pss.pncost.base.ComCalculation.costMain",
  97. new object[] { year + month }, ob);
  98. wf.ShowToUser = false;
  99. wf.Close();
  100. Query();
  101. if (results[0] == "-1")
  102. {
  103. MessageUtil.ShowWarning(results[1]);
  104. return;
  105. }
  106. if (results[0] == "1")
  107. {
  108. MessageUtil.ShowTips("计算成功!");
  109. }
  110. }
  111. /// 导出方法
  112. /// <summary>
  113. /// 导出方法
  114. /// </summary>
  115. private void Export() {
  116. if (ultraTabControl1.SelectedTab.Text == "电炉铸造锻造")
  117. {
  118. if (ultraGrid2.Rows.Count == 0)
  119. {
  120. MessageUtil.ShowWarning("查询数据为空,无法导出!");
  121. return;
  122. }
  123. GridHelper.ulGridToExcel(ultraGrid2, "电炉铸造锻造计划成本");
  124. }
  125. if (ultraTabControl1.SelectedTab.Text == "轧管")
  126. {
  127. if (ultraGrid3.Rows.Count == 0)
  128. {
  129. MessageUtil.ShowWarning("查询数据为空,无法导出!");
  130. return;
  131. }
  132. GridHelper.ulGridToExcel(ultraGrid3, "轧管计划成本");
  133. }
  134. if (ultraTabControl1.SelectedTab.Text == "镦拨扩")
  135. {
  136. if (ultraGrid4.Rows.Count == 0)
  137. {
  138. MessageUtil.ShowWarning("查询数据为空,无法导出!");
  139. return;
  140. }
  141. GridHelper.ulGridToExcel(ultraGrid4, "镦拨扩计划成本");
  142. }
  143. if (ultraTabControl1.SelectedTab.Text == "热处理")
  144. {
  145. if (ultraGrid5.Rows.Count == 0)
  146. {
  147. MessageUtil.ShowWarning("查询数据为空,无法导出!");
  148. return;
  149. }
  150. GridHelper.ulGridToExcel(ultraGrid5, "热处理计划成本");
  151. }
  152. if (ultraTabControl1.SelectedTab.Text == "加工")
  153. {
  154. if (ultraGrid6.Rows.Count == 0)
  155. {
  156. MessageUtil.ShowWarning("查询数据为空,无法导出!");
  157. return;
  158. }
  159. GridHelper.ulGridToExcel(ultraGrid6, "加工计划成本");
  160. }
  161. if (ultraTabControl1.SelectedTab.Text == "日志")
  162. {
  163. if (ultraGrid7.Rows.Count == 0)
  164. {
  165. MessageUtil.ShowWarning("查询数据为空,无法导出!");
  166. return;
  167. }
  168. GridHelper.ulGridToExcel(ultraGrid7, "日志信息");
  169. }
  170. if (ultraTabControl1.SelectedTab.Text == "订单成本统计")
  171. {
  172. if (ultraGrid8.Rows.Count == 0)
  173. {
  174. MessageUtil.ShowWarning("查询数据为空,无法导出!");
  175. return;
  176. }
  177. GridHelper.ulGridToExcel(ultraGrid8, "订单成本统计");
  178. }
  179. }
  180. /// 查询方法
  181. /// <summary>
  182. /// 查询方法
  183. /// </summary>
  184. private void Query()
  185. {
  186. plineID = flagA = flagD = flagE = flagF = flagG = "";
  187. #region 条件验证
  188. //年月
  189. string year = yeardrop.Value.ToString2();
  190. string month = monthdrop.Value.ToString2();
  191. //排产订单编号
  192. string strChan = "";
  193. if (ultraCheckEditor3.Checked)//排产订单编号是否选择
  194. {
  195. strChan = ultraTextEditor1.Text.Trim().ToString2();//排产订单编号
  196. }
  197. #endregion
  198. #region 汇总
  199. List<CostCalculationGtlEntity> data = EntityHelper.GetData<CostCalculationGtlEntity>(
  200. "com.steering.pss.pncost.base.ComCalculation.queryAll", new object[] { year + month }, ob);
  201. costCalculationGtlEntityBindingSource.DataSource = data;
  202. if (ultraGrid1.Rows.Count != 0)
  203. {
  204. ultraGrid1.UpdateData();
  205. ultraGrid1.ActiveRow = ultraGrid1.Rows[0];
  206. }
  207. #endregion
  208. tab();
  209. }
  210. /// 判断tab页查询相应数据
  211. /// <summary>
  212. /// 判断tab页查询相应数据
  213. /// </summary>
  214. private void tab()
  215. {
  216. if (plineID == "first")
  217. {
  218. return;
  219. }
  220. if (ultraTabControl1.SelectedTab.Text == "轧管")
  221. {
  222. #region 条件验证
  223. //年月
  224. string year = yeardrop.Value.ToString2();
  225. string month = monthdrop.Value.ToString2();
  226. //扎管订单编号
  227. string strChan = "";
  228. if (ultraCheckEditor3.Checked)//扎管订单编号是否选择
  229. {
  230. strChan = ultraTextEditor1.Text.Trim().ToString2();//扎管订单编号
  231. }
  232. #endregion
  233. #region 扎管
  234. if (plineID == "" || ultraGrid3.Rows.Count == 0 || flagD == "")
  235. {
  236. flagD = "already";
  237. List<CostCalculationDEntity> dataD = EntityHelper.GetData<CostCalculationDEntity>(
  238. "com.steering.pss.pncost.base.ComCalculation.queryD", new object[] { year + month, strChan }, ob);
  239. costCalculationDEntityBindingSource.DataSource = dataD;
  240. if (ultraGrid3.Rows.Count == 0)
  241. {
  242. return;
  243. }
  244. //GridHelper.RefreshAndAutoSize(ultraGrid3);
  245. }
  246. for (int i = 0; i < ultraGrid3.Rows.Count; i++)
  247. {
  248. if (plineID == ultraGrid3.Rows[i].Cells["ProPlanId"].Value.ToString2())
  249. {
  250. ultraGrid3.Rows[i].Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
  251. ultraGrid3.ActiveRow = ultraGrid3.Rows[i];
  252. }
  253. else
  254. {
  255. ultraGrid3.Rows[i].Appearance.BackColor = System.Drawing.Color.White;
  256. }
  257. }
  258. #endregion
  259. }
  260. else if (ultraTabControl1.SelectedTab.Text == "镦拨扩")
  261. {
  262. #region 条件验证
  263. //年月
  264. string year = yeardrop.Value.ToString2();
  265. string month = monthdrop.Value.ToString2();
  266. //扎管订单编号
  267. string strChan = "";
  268. if (ultraCheckEditor3.Checked)//扎管订单编号是否选择
  269. {
  270. strChan = ultraTextEditor1.Text.Trim().ToString2();//扎管订单编号
  271. }
  272. #endregion
  273. #region 镦拨扩
  274. if (plineID == "" || ultraGrid4.Rows.Count == 0 || flagE == "")
  275. {
  276. flagE = "already";
  277. List<CostCalculationEEntity> dataE = EntityHelper.GetData<CostCalculationEEntity>(
  278. "com.steering.pss.pncost.base.ComCalculation.queryE", new object[] { year + month, strChan }, ob);
  279. costCalculationEEntityBindingSource.DataSource = dataE;
  280. if (ultraGrid4.Rows.Count == 0)
  281. {
  282. return;
  283. }
  284. //GridHelper.RefreshAndAutoSize(ultraGrid4);
  285. //ultraGrid4.ActiveRow = ultraGrid4.Rows[0];
  286. }
  287. for (int i = 0; i < ultraGrid4.Rows.Count; i++)
  288. {
  289. if (plineID == ultraGrid4.Rows[i].Cells["ProPlanId"].Value.ToString2())
  290. {
  291. ultraGrid4.Rows[i].Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
  292. }
  293. else
  294. {
  295. ultraGrid4.Rows[i].Appearance.BackColor = System.Drawing.Color.White;
  296. }
  297. }
  298. #endregion
  299. }
  300. else if (ultraTabControl1.SelectedTab.Text == "电炉铸造锻造")
  301. {
  302. #region 条件验证
  303. //年月
  304. string year = yeardrop.Value.ToString2();
  305. string month = monthdrop.Value.ToString2();
  306. //扎管订单编号
  307. string strChan = "";
  308. if (ultraCheckEditor3.Checked)//扎管订单编号是否选择
  309. {
  310. strChan = ultraTextEditor1.Text.Trim().ToString2();//扎管订单编号
  311. }
  312. #endregion
  313. #region 电炉铸造锻造
  314. if (plineID == "" || ultraGrid2.Rows.Count == 0 || flagA == "")
  315. {
  316. flagA = "already";
  317. List<CostCalculationAEntity> dataA = EntityHelper.GetData<CostCalculationAEntity>(
  318. "com.steering.pss.pncost.base.ComCalculation.queryA", new object[] { year + month, strChan }, ob);
  319. costCalculationAEntityBindingSource.DataSource = dataA;
  320. if (ultraGrid2.Rows.Count == 0)
  321. {
  322. return;
  323. }
  324. //GridHelper.RefreshAndAutoSize(ultraGrid2);
  325. //ultraGrid2.ActiveRow = ultraGrid2.Rows[0];
  326. }
  327. for (int i = 0; i < ultraGrid2.Rows.Count; i++)
  328. {
  329. if (plineID == ultraGrid2.Rows[i].Cells["ProPlanId"].Value.ToString2())
  330. {
  331. ultraGrid2.Rows[i].Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
  332. }
  333. else
  334. {
  335. ultraGrid2.Rows[i].Appearance.BackColor = System.Drawing.Color.White;
  336. }
  337. }
  338. #endregion
  339. }
  340. else if (ultraTabControl1.SelectedTab.Text == "热处理")
  341. {
  342. #region 条件验证
  343. //年月
  344. string year = yeardrop.Value.ToString2();
  345. string month = monthdrop.Value.ToString2();
  346. //扎管订单编号
  347. string strChan = "";
  348. if (ultraCheckEditor3.Checked)//扎管订单编号是否选择
  349. {
  350. strChan = ultraTextEditor1.Text.Trim().ToString2();//扎管订单编号
  351. }
  352. #endregion
  353. #region 热处理
  354. if (plineID == "" || ultraGrid5.Rows.Count == 0 || flagF == "")
  355. {
  356. flagF = "already";
  357. List<CostCalculationFEntity> dataF = EntityHelper.GetData<CostCalculationFEntity>(
  358. "com.steering.pss.pncost.base.ComCalculation.queryF", new object[] { year + month, strChan }, ob);
  359. costCalculationFEntityBindingSource.DataSource = dataF;
  360. if (ultraGrid5.Rows.Count == 0)
  361. {
  362. return;
  363. }
  364. //GridHelper.RefreshAndAutoSize(ultraGrid5);
  365. //ultraGrid5.ActiveRow = ultraGrid5.Rows[0];
  366. }
  367. for (int i = 0; i < ultraGrid5.Rows.Count; i++)
  368. {
  369. if (plineID == ultraGrid5.Rows[i].Cells["ProPlanId"].Value.ToString2())
  370. {
  371. ultraGrid5.Rows[i].Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
  372. }
  373. else
  374. {
  375. ultraGrid5.Rows[i].Appearance.BackColor = System.Drawing.Color.White;
  376. }
  377. }
  378. #endregion
  379. }
  380. else if (ultraTabControl1.SelectedTab.Text == "加工")
  381. {
  382. #region 条件验证
  383. //年月
  384. string year = yeardrop.Value.ToString2();
  385. string month = monthdrop.Value.ToString2();
  386. //扎管订单编号
  387. string strChan = "";
  388. if (ultraCheckEditor3.Checked)//扎管订单编号是否选择
  389. {
  390. strChan = ultraTextEditor1.Text.Trim().ToString2();//扎管订单编号
  391. }
  392. #endregion
  393. #region 加工
  394. if (plineID == "" || ultraGrid6.Rows.Count == 0 || flagG == "")
  395. {
  396. flagG = "already";
  397. List<CostCalculationGEntity> dataG = EntityHelper.GetData<CostCalculationGEntity>(
  398. "com.steering.pss.pncost.base.ComCalculation.queryG", new object[] { year + month, strChan }, ob);
  399. costCalculationGEntityBindingSource.DataSource = dataG;
  400. if (ultraGrid6.Rows.Count == 0)
  401. {
  402. return;
  403. }
  404. //ultraGrid6.ActiveRow = ultraGrid6.Rows[0];
  405. }
  406. for (int i = 0; i < ultraGrid6.Rows.Count; i++)
  407. {
  408. if (plineID == ultraGrid6.Rows[i].Cells["ProPlanId"].Value.ToString2())
  409. {
  410. ultraGrid6.Rows[i].Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
  411. }
  412. else
  413. {
  414. ultraGrid6.Rows[i].Appearance.BackColor = System.Drawing.Color.White;
  415. }
  416. }
  417. //GridHelper.RefreshAndAutoSize(ultraGrid6);
  418. #endregion
  419. }
  420. else if (ultraTabControl1.SelectedTab.Text == "订单成本统计")
  421. {
  422. #region 条件验证
  423. //年月
  424. string year = yeardrop.Value.ToString2();
  425. string month = monthdrop.Value.ToString2();
  426. #endregion
  427. #region 统计
  428. if (plineID == "" || ultraGrid8.Rows.Count == 0 || flagG == "")
  429. {
  430. flagG = "already";
  431. DataTable data = ServerHelper.GetData("com.steering.pss.pncost.base.ComCalculation.querycount",
  432. new object[] { year + month }, ob);
  433. GridHelper.CopyDataToDatatable(data, dataTable1, true);
  434. if (ultraGrid8.Rows.Count == 0)
  435. {
  436. return;
  437. }
  438. //ultraGrid6.ActiveRow = ultraGrid6.Rows[0];
  439. }
  440. for (int i = 0; i < ultraGrid8.Rows.Count; i++)
  441. {
  442. if (plineID == ultraGrid8.Rows[i].Cells["pro_plan_id"].Value.ToString2())
  443. {
  444. ultraGrid8.Rows[i].Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
  445. }
  446. else
  447. {
  448. ultraGrid8.Rows[i].Appearance.BackColor = System.Drawing.Color.White;
  449. }
  450. }
  451. //GridHelper.RefreshAndAutoSize(ultraGrid6);
  452. #endregion
  453. }
  454. else
  455. {
  456. #region 条件验证
  457. //年月
  458. string year = yeardrop.Value.ToString2();
  459. string month = monthdrop.Value.ToString2();
  460. //扎管订单编号
  461. string strChan = "";
  462. if (ultraCheckEditor3.Checked)//扎管订单编号是否选择
  463. {
  464. strChan = ultraTextEditor1.Text.Trim().ToString2();//扎管订单编号
  465. }
  466. #endregion
  467. #region 日志
  468. List<CostCalculationErrorEntity> dataERR = EntityHelper.GetData<CostCalculationErrorEntity>(
  469. "com.steering.pss.pncost.base.ComCalculation.queryERR", new object[] { }, ob);
  470. costCalculationErrorEntityBindingSource.DataSource = dataERR;
  471. if (ultraGrid6.Rows.Count == 0)
  472. {
  473. return;
  474. }
  475. GridHelper.RefreshAndAutoSize(ultraGrid7);
  476. #endregion
  477. }
  478. }
  479. #endregion
  480. #region 事件
  481. private void ultraCheckEditor3_CheckedChanged(object sender, EventArgs e)
  482. {
  483. ultraTextEditor1.Enabled = this.ultraCheckEditor3.Checked;
  484. }
  485. /// 电炉,锻造,铸造选中行事件
  486. /// <summary>
  487. /// 电炉,锻造,铸造选中行事件
  488. /// </summary>
  489. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  490. {
  491. plineID = ultraGrid2.ActiveRow.Cells["ProPlanId"].Value.ToString2();
  492. for (int i = 0; i < ultraGrid2.Rows.Count; i++)
  493. {
  494. if (plineID == ultraGrid2.Rows[i].Cells["ProPlanId"].Value.ToString2())
  495. {
  496. ultraGrid2.Rows[i].Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
  497. }
  498. else
  499. {
  500. ultraGrid2.Rows[i].Appearance.BackColor = System.Drawing.Color.White;
  501. }
  502. }
  503. }
  504. /// 扎管选中行事件
  505. /// <summary>
  506. /// 扎管选中行事件
  507. /// </summary>
  508. private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
  509. {
  510. plineID = ultraGrid3.ActiveRow.Cells["ProPlanId"].Value.ToString2();
  511. for (int i = 0; i < ultraGrid3.Rows.Count; i++)
  512. {
  513. if (plineID == ultraGrid3.Rows[i].Cells["ProPlanId"].Value.ToString2())
  514. {
  515. ultraGrid3.Rows[i].Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
  516. }
  517. else
  518. {
  519. ultraGrid3.Rows[i].Appearance.BackColor = System.Drawing.Color.White;
  520. }
  521. }
  522. }
  523. /// 热处理选中行事件
  524. /// <summary>
  525. /// 热处理选中行事件
  526. /// </summary>
  527. private void ultraGrid4_AfterRowActivate(object sender, EventArgs e)
  528. {
  529. plineID = ultraGrid4.ActiveRow.Cells["ProPlanId"].Value.ToString2();
  530. for (int i = 0; i < ultraGrid4.Rows.Count; i++)
  531. {
  532. if (plineID == ultraGrid4.Rows[i].Cells["ProPlanId"].Value.ToString2())
  533. {
  534. ultraGrid4.Rows[i].Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
  535. }
  536. else
  537. {
  538. ultraGrid4.Rows[i].Appearance.BackColor = System.Drawing.Color.White;
  539. }
  540. }
  541. }
  542. /// 吨拔廓选中行事件
  543. /// <summary>
  544. /// 吨拔廓选中行事件
  545. /// </summary>
  546. private void ultraGrid5_AfterRowActivate(object sender, EventArgs e)
  547. {
  548. plineID = ultraGrid5.ActiveRow.Cells["ProPlanId"].Value.ToString2();
  549. for (int i = 0; i < ultraGrid5.Rows.Count; i++)
  550. {
  551. if (plineID == ultraGrid5.Rows[i].Cells["ProPlanId"].Value.ToString2())
  552. {
  553. ultraGrid5.Rows[i].Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
  554. }
  555. else
  556. {
  557. ultraGrid5.Rows[i].Appearance.BackColor = System.Drawing.Color.White;
  558. }
  559. }
  560. }
  561. /// 加工选中行事件
  562. /// <summary>
  563. /// 加工选中行事件
  564. /// </summary>
  565. private void ultraGrid6_AfterRowActivate(object sender, EventArgs e)
  566. {
  567. plineID = ultraGrid6.ActiveRow.Cells["ProPlanId"].Value.ToString2();
  568. for (int i = 0; i < ultraGrid6.Rows.Count; i++)
  569. {
  570. if (plineID == ultraGrid6.Rows[i].Cells["ProPlanId"].Value.ToString2())
  571. {
  572. ultraGrid6.Rows[i].Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
  573. }
  574. else
  575. {
  576. ultraGrid6.Rows[i].Appearance.BackColor = System.Drawing.Color.White;
  577. }
  578. }
  579. }
  580. /// 汇总选中行事件
  581. /// <summary>
  582. /// 汇总选中行事件
  583. /// </summary>
  584. private void ultraGrid8_AfterRowActivate(object sender, EventArgs e)
  585. {
  586. plineID = ultraGrid8.ActiveRow.Cells["pro_plan_id"].Value.ToString2();
  587. for (int i = 0; i < ultraGrid8.Rows.Count; i++)
  588. {
  589. if (plineID == ultraGrid8.Rows[i].Cells["pro_plan_id"].Value.ToString2())
  590. {
  591. ultraGrid8.Rows[i].Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
  592. }
  593. else
  594. {
  595. ultraGrid8.Rows[i].Appearance.BackColor = System.Drawing.Color.White;
  596. }
  597. }
  598. }
  599. /// tab页选中行事件
  600. /// <summary>
  601. /// tab页选中行事件
  602. /// </summary>
  603. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  604. {
  605. tab();
  606. }
  607. #endregion
  608. /// <summary>
  609. /// 导出
  610. /// </summary>
  611. private void ExportData()
  612. {
  613. GridHelper.ulGridToExcel(ultraGrid1, "轧管生产数据统计");
  614. }
  615. }
  616. }