FrmJgxGroup.cs 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 System.Collections;
  10. using CoreFS.CA06;
  11. using Core.Mes.Client.Comm.Server;
  12. using Core.Mes.Client.Comm.Control;
  13. namespace Core.StlMes.Client.Plan.Order
  14. {
  15. public partial class FrmJgxGroup : FrmBase
  16. {
  17. public FrmJgxGroup()
  18. {
  19. InitializeComponent();
  20. }
  21. public FrmJgxGroup(OpeBase ops)
  22. {
  23. this.ob = ops;
  24. InitializeComponent();
  25. }
  26. private void FrmJgxGroup_Load(object sender, EventArgs e)
  27. {
  28. queryPlanWeight();
  29. }
  30. private void queryPlanWeight()
  31. {
  32. DataTable dtGroup = ServerHelper.GetData("com.steering.pss.plan.order.CoreSaleOrderOP.queryBaseinfoSort",
  33. new object[] { "2005" }, this.ob);
  34. DataTable dt1 = ServerHelper.GetData("com.steering.pss.plan.order.CoreSaleOrderOP.queryJgxPlanWeight",
  35. new object[] { DateTime.Now.AddMonths(-1).ToString("yyyy-MM") }, this.ob);
  36. DataTable dt2 = ServerHelper.GetData("com.steering.pss.plan.order.CoreSaleOrderOP.queryJgxPlanWeight",
  37. new object[] { DateTime.Now.ToString("yyyy-MM") }, this.ob);
  38. DataTable dt3 = ServerHelper.GetData("com.steering.pss.plan.order.CoreSaleOrderOP.queryJgxPlanWeight",
  39. new object[] { DateTime.Now.AddMonths(1).ToString("yyyy-MM") }, this.ob);
  40. DataTable dt = new DataTable();
  41. dt.Columns.Add("GROUP_JGX");
  42. dt.Columns.Add("PLANWEIGHT1");
  43. dt.Columns.Add("PLANWEIGHT2");
  44. dt.Columns.Add("PLANWEIGHT3");
  45. foreach (DataRow row in dtGroup.Rows)
  46. {
  47. DataRow dr = dt.NewRow();
  48. dr["GROUP_JGX"] = row["BASENAME"].ToString();
  49. dt1.DefaultView.RowFilter = "GROUP_JGX='" + row["BASENAME"].ToString() + "'";
  50. if (dt1.DefaultView.ToTable() != null && dt1.DefaultView.ToTable().Rows.Count > 0)
  51. {
  52. dr["PLANWEIGHT1"] = dt1.DefaultView.ToTable().Rows[0]["PLANWEIGHT"].ToString();
  53. }
  54. dt2.DefaultView.RowFilter = "GROUP_JGX='" + row["BASENAME"].ToString() + "'";
  55. if (dt2.DefaultView.ToTable() != null && dt2.DefaultView.ToTable().Rows.Count > 0)
  56. {
  57. dr["PLANWEIGHT2"] = dt2.DefaultView.ToTable().Rows[0]["PLANWEIGHT"].ToString();
  58. }
  59. dt3.DefaultView.RowFilter = "GROUP_JGX='" + row["BASENAME"].ToString() + "'";
  60. if (dt3.DefaultView.ToTable() != null && dt3.DefaultView.ToTable().Rows.Count > 0)
  61. {
  62. dr["PLANWEIGHT3"] = dt3.DefaultView.ToTable().Rows[0]["PLANWEIGHT"].ToString();
  63. }
  64. dt.Rows.Add(dr);
  65. }
  66. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  67. PlanComm.setGridActivation(ultraGrid1.DisplayLayout.Bands[0]);
  68. }
  69. }
  70. }