FrmSpitPlanJg.cs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. using Core.Mes.Client.Comm.Server;
  2. using Core.Mes.Client.Comm.Tool;
  3. using Core.StlMes.Client.PlnSaleOrd.BaseMethod;
  4. using Core.StlMes.Client.PlnSaleOrd.工序排产.entity;
  5. using Core.StlMes.Client.PlnSaleOrd.炉计划.Entity;
  6. using Core.StlMes.Client.PlnSaleOrd.炉计划.Tool;
  7. using CoreFS.CA06;
  8. using Infragistics.Win.UltraWinGrid;
  9. using System;
  10. using System.Collections;
  11. using System.Collections.Generic;
  12. using System.ComponentModel;
  13. using System.Data;
  14. using System.Drawing;
  15. using System.Linq;
  16. using System.Text;
  17. using System.Windows.Forms;
  18. namespace Core.StlMes.Client.PlnSaleOrd.窗体
  19. {
  20. public partial class FrmSpitPlanJg : FrmBase
  21. {
  22. private string proPlanId = "";
  23. private string gxPlanNo = "";
  24. private OpeBase ob;
  25. public FrmSpitPlanJg(string _proPlanId, string _gxPlanNo, OpeBase _ob)
  26. {
  27. proPlanId = _proPlanId;
  28. gxPlanNo = _gxPlanNo;
  29. ob = _ob;
  30. InitializeComponent();
  31. }
  32. private string heatPlanNo = "";
  33. /// <summary>
  34. /// 炉计划ID
  35. /// </summary>
  36. public string HeatPlanNo
  37. {
  38. get { return heatPlanNo; }
  39. set { heatPlanNo = value; }
  40. }
  41. private string judgeStoveNo = "";
  42. /// <summary>
  43. /// 上料炉号
  44. /// </summary>
  45. public string JudgeStoveNo
  46. {
  47. get { return judgeStoveNo; }
  48. set { judgeStoveNo = value; }
  49. }
  50. private double reducedWtKc = 0;
  51. /// <summary>
  52. /// 折算吨
  53. /// </summary>
  54. public double ReducedWtKc
  55. {
  56. get { return reducedWtKc; }
  57. set { reducedWtKc = value; }
  58. }
  59. private double reducedWt = 0;
  60. /// <summary>
  61. /// 折算吨
  62. /// </summary>
  63. public double ReducedWt
  64. {
  65. get { return reducedWt; }
  66. set { reducedWt = value; }
  67. }
  68. private ArrayList list = null;
  69. public ArrayList List
  70. {
  71. get { return list; }
  72. set { list = value; }
  73. }
  74. private void FrmSpitPlanJg_Load(object sender, EventArgs e)
  75. {
  76. //订单排产
  77. EntityHelper.ShowGridCaption<PlnZyJgMEntity>(ultraGridZy.DisplayLayout.Bands[0]);
  78. BaseHelper.setUltraGridColumnMaxInput(ultraGridZy, new string[] { "PlanBlWt" });
  79. BaseHelper.setUltraGridColumnBits(ultraGridZy, new string[] { "PlanBlNum", "PlanJgNum" });
  80. BaseHelper.InitCellPosition(ultraGridZy, new string[] { "GxProSeq", "GxPlanNo", "PlanBlWt", "PlanBlNum", "PlanJgNum", "CraftSeq" });
  81. BaseHelper.GridColumnSum(ultraGridZy, new string[] { "PlanBlWt" });
  82. BaseHelper.GridColumnCount(ultraGridZy, new string[] { "PlanJgNum", "PlanBlNum" });
  83. StoveHelper.ForbidSort(ultraGridZy);
  84. DoQuery();
  85. }
  86. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  87. {
  88. switch (e.Tool.Key)
  89. {
  90. case "Query": //刷新
  91. DoQuery();
  92. break;
  93. case "Confirm": // 确认
  94. DoConfirm();
  95. break;
  96. case "Close": // 关闭
  97. this.Close();
  98. break;
  99. default:
  100. break;
  101. }
  102. }
  103. /// <summary>
  104. /// 查询
  105. /// </summary>
  106. private void DoQuery()
  107. {
  108. List<PlnZyJgMEntity> listSourceM = EntityHelper.GetData<PlnZyJgMEntity>
  109. ("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.doQueryStarM", new object[] { proPlanId, gxPlanNo, "H" }, ob);
  110. plnZyJgMEntityBindingSource.DataSource = listSourceM;
  111. foreach (UltraGridRow urg in ultraGridZy.Rows)
  112. {
  113. if (!urg.Cells["Planstatus"].Value.ToString().Equals("计划"))
  114. {
  115. urg.Cells["CHC"].Value = true;
  116. }
  117. }
  118. }
  119. /// <summary>
  120. /// 确认
  121. /// </summary>
  122. private void DoConfirm()
  123. {
  124. UltraGridRow row = ultraGridZy.ActiveRow;
  125. if (row == null) return;
  126. int count = 0;
  127. string planstrat="";
  128. foreach (UltraGridRow urg in ultraGridZy.Rows)
  129. {
  130. ArrayList list1 = new ArrayList();
  131. if (Convert.ToBoolean(urg.Cells["CHC"].Text) == true)
  132. {
  133. count++;
  134. //if (planstrat.Equals(""))
  135. //{
  136. // planstrat = urg.Cells["Planstatus"].Value.ToString();
  137. //}
  138. //if (!planstrat.Equals(urg.Cells["Planstatus"].Value.ToString()))
  139. //{
  140. // MessageUtil.ShowTips("请选择同一状态的炉号!");
  141. // return;
  142. //}
  143. //ReducedWt += double.Parse(urg.Cells["PlnOutsingleW"].Value.ToString());
  144. if (JudgeStoveNo.Equals(""))
  145. {
  146. JudgeStoveNo = urg.Cells["JudgeStoveNo"].Value.ToString();
  147. }
  148. else
  149. {
  150. JudgeStoveNo = JudgeStoveNo + "," + urg.Cells["JudgeStoveNo"].Value.ToString();
  151. }
  152. }
  153. else
  154. {
  155. //ReducedWtKc += double.Parse(urg.Cells["PlanBlWt"].Value.ToString());
  156. if (!urg.Cells["Planstatus"].Value.ToString().Equals("计划") && !urg.Cells["Planstatus"].Value.ToString().Equals("下发"))
  157. {
  158. MessageUtil.ShowTips("炉计划状态不是计划或下发中的必须勾选!");
  159. return;
  160. }
  161. if (HeatPlanNo.Equals(""))
  162. {
  163. HeatPlanNo = urg.Cells["HeatPlanNo"].Value.ToString();
  164. }
  165. else
  166. {
  167. HeatPlanNo = HeatPlanNo + "," + urg.Cells["HeatPlanNo"].Value.ToString();
  168. }
  169. }
  170. }
  171. //if (count == 0)
  172. //{
  173. // MessageUtil.ShowTips("请选择需拆分上料炉号!");
  174. // return;
  175. //}
  176. this.Close();
  177. }
  178. }
  179. }