ComPlanEndJgx.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using Core.Mes.Client.Comm.Tool;
  10. using Core.StlMes.Client.PlnSaleOrd.炉计划.Entity;
  11. using Core.Mes.Client.Comm.Control;
  12. using Infragistics.Win.UltraWinGrid;
  13. using CoreFS.CA06;
  14. using System.Collections;
  15. using Core.StlMes.Client.PlnSaleOrd.工序排产.entity;
  16. namespace Core.StlMes.Client.PlnSaleOrd.炉计划
  17. {
  18. public partial class ComPlanEndJgx : UserControl
  19. {
  20. public string ordLnDlyPk = "";
  21. public string indexSeq = "";
  22. public string carftSeq = "";
  23. public bool flag = false;
  24. public ComPlanEndJgx()
  25. {
  26. InitializeComponent();
  27. }
  28. private void ComPlanEndJgx_Load(object sender, EventArgs e)
  29. {
  30. EntityHelper.ShowGridCaption<PlnOrderJgxSOEntity>(entityGrid1.DisplayLayout.Bands[0]);
  31. }
  32. /// <summary>
  33. /// 查询轧管订单信息
  34. /// </summary>
  35. public void QueryPlanZg(string materialNo,string gradecode,OpeBase ob)
  36. {
  37. List<PlnOrderJgxSOEntity> listSource = EntityHelper.GetData<PlnOrderJgxSOEntity>("com.steering.pss.plnsaleord.planStove.FrmEndLibrary.getPlnOrderZgS",
  38. new object[] { materialNo, gradecode, "G" }, ob);
  39. plnOrderJgxSOEntityBindingSource.DataSource = listSource;
  40. GridHelper.RefreshAndAutoSize(entityGrid1);
  41. //plnOrderJgxSOEntityBindingSource.DataSource = listSource.Where(w => w.ReallWt > 0).ToList();
  42. if (listSource.Count == 0)
  43. {
  44. ordLnDlyPk = "";
  45. }
  46. }
  47. /// <summary>
  48. /// 利库
  49. /// </summary>
  50. /// <param name="materialNo"></param>
  51. /// <param name="ob"></param>
  52. public void doAddLibrary(ArrayList list, string userName, OpeBase ob, int countCic, string specCic)
  53. {
  54. UltraGridRow row = entityGrid1.ActiveRow;
  55. if (row == null) return;
  56. int count = 0;
  57. string proPlanId = "";
  58. string gxPlanNo = "";
  59. foreach (UltraGridRow ugr in entityGrid1.Rows)
  60. {
  61. if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
  62. {
  63. count++;
  64. proPlanId = ugr.Cells["ProPlanId"].Value.ToString();
  65. gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString();
  66. }
  67. }
  68. if (count == 0 || count > 1)
  69. {
  70. MessageUtil.ShowTips("请选择一个加工订单!");
  71. return;
  72. }
  73. if (specCic.Equals("") && countCic == 0)
  74. {
  75. MessageUtil.ShowTips("库存CIC在订单炼钢CIC集合里没有,请指定CIC!");
  76. return;
  77. }
  78. if (MessageUtil.ShowYesNoAndQuestion("是否确认利库?") ==
  79. DialogResult.No)
  80. return;
  81. PlanComm.WaitFromOpen(this.Cursor);
  82. CoreClientParam ccp = new CoreClientParam();
  83. ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
  84. ccp.MethodName = "doAddLibrary";
  85. ccp.ServerParams = new object[] { list,proPlanId,gxPlanNo,userName };
  86. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  87. PlanComm.WaitFromColse(this.Cursor);
  88. if (ccp.ReturnCode == -1) return;
  89. MessageUtil.ShowTips(ccp.ReturnInfo);
  90. if (ccp.ReturnInfo.Equals("利库成功!"))
  91. {
  92. flag = true;
  93. }
  94. }
  95. /// <summary>
  96. /// 物料改判
  97. /// </summary>
  98. /// <param name="materialNo"></param>
  99. /// <param name="ob"></param>
  100. public void doSentence(ArrayList list, string userName, OpeBase ob)
  101. {
  102. UltraGridRow row = entityGrid1.ActiveRow;
  103. if (row == null) return;
  104. int count = 0;
  105. string proPlanId = "";
  106. string gxPlanNo = "";
  107. foreach (UltraGridRow ugr in entityGrid1.Rows)
  108. {
  109. if (Convert.ToBoolean(ugr.Cells["CHC"].Text) == true)
  110. {
  111. count++;
  112. proPlanId = ugr.Cells["ProPlanId"].Value.ToString();
  113. gxPlanNo = ugr.Cells["GxPlanNo"].Value.ToString();
  114. }
  115. }
  116. if (count == 0 || count > 1)
  117. {
  118. MessageUtil.ShowTips("请选择一个轧管订单!");
  119. return;
  120. }
  121. if (MessageUtil.ShowYesNoAndQuestion("是否确认改判?") ==
  122. DialogResult.No)
  123. return;
  124. PlanComm.WaitFromOpen(this.Cursor);
  125. CoreClientParam ccp = new CoreClientParam();
  126. ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary";
  127. ccp.MethodName = "doSentence";
  128. ccp.ServerParams = new object[] { list, proPlanId, gxPlanNo, userName };
  129. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  130. PlanComm.WaitFromColse(this.Cursor);
  131. if (ccp.ReturnCode == -1) return;
  132. MessageUtil.ShowTips(ccp.ReturnInfo);
  133. if (ccp.ReturnInfo.Equals("改判成功!"))
  134. {
  135. flag = true;
  136. }
  137. }
  138. private void entityGrid1_AfterRowActivate(object sender, EventArgs e)
  139. {
  140. UltraGridRow row = entityGrid1.ActiveRow;
  141. if (row == null) return;
  142. ordLnDlyPk = row.Cells["OrdLnDlyPk"].Value.ToString();
  143. indexSeq = row.Cells["IndexSeq"].Value.ToString();
  144. carftSeq = row.Cells["CraftSeq"].Value.ToString();
  145. }
  146. }
  147. }