frmPipeMoveStoreButress.cs 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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 CoreFS.CA06;
  10. using Core.Mes.Client.Comm.Control;
  11. using Core.StlMes.Client.YdmBase;
  12. using Infragistics.Win.UltraWinEditors;
  13. using Infragistics.Win.UltraWinGrid;
  14. using System.Collections;
  15. using Core.Mes.Client.Comm.Tool;
  16. using Core.StlMes.Client.YdmPipeManage.Tool;
  17. namespace Core.StlMes.Client.YdmPipeManage
  18. {
  19. public partial class frmPipeMoveStoreButress : FrmBase
  20. {
  21. public frmPipeMoveStoreButress(OpeBase ob)
  22. {
  23. this.ob = ob;
  24. InitializeComponent();
  25. }
  26. UltraComboEditor uceReson = new UltraComboEditor();
  27. public string buttonValue = "";
  28. private DataTable dt;
  29. public DataTable Dt
  30. {
  31. get { return dt; }
  32. set { dt = value; }
  33. }
  34. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  35. {
  36. switch (e.Tool.Key)
  37. {
  38. case"OK":
  39. updateStoreButress();
  40. break;
  41. case"Close":
  42. this.Close();
  43. break;
  44. }
  45. }
  46. /// <summary>
  47. /// 确认
  48. /// </summary>
  49. private void updateStoreButress()
  50. {
  51. this.ultraGrid3.UpdateData();
  52. int numCount = int.Parse(this.ultraGrid1.ActiveRow.Cells["UNIT"].Value.ToString());//总支数
  53. int num = 0;
  54. foreach (UltraGridRow row in ultraGrid3.Rows)
  55. {
  56. if (Convert.ToBoolean(row.Cells["CHK"].Text) == true)
  57. {
  58. num += int.Parse(row.Cells["COUNT"].Value.ToString());
  59. }
  60. }
  61. if (num > numCount)
  62. {
  63. MessageUtil.ShowTips("调整支数不能大于库存支数!");
  64. return;
  65. }
  66. ArrayList parm = new ArrayList();
  67. foreach (UltraGridRow row in ultraGrid3.Rows)
  68. {
  69. if (Convert.ToBoolean(row.Cells["CHK"].Text) == true)
  70. {
  71. if (row.Cells["COUNT"].Value.ToString() == "" || row.Cells["COUNT"].Value.ToString() == "0")
  72. {
  73. MessageUtil.ShowTips("请输入正确的支数!");
  74. return;
  75. }
  76. if (row.Cells["STORENO"].Value.ToString() == "")
  77. {
  78. MessageUtil.ShowTips("目标仓库不能为空!");
  79. return;
  80. }
  81. ArrayList list = new ArrayList();
  82. list.Add(this.ultraGrid1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString());//炉批组
  83. list.Add(this.ultraGrid1.ActiveRow.Cells["BATCH_NO"].Value.ToString());
  84. list.Add(this.ultraGrid1.ActiveRow.Cells["BATCH_GROUD_NO"].Value.ToString());
  85. if (this.ultraGrid1.ActiveRow.Cells["PRODUCT_FLAG"].Value.ToString() == "商品")
  86. {
  87. list.Add("801403");
  88. }
  89. else if (this.ultraGrid1.ActiveRow.Cells["PRODUCT_FLAG"].Value.ToString() == "成品")
  90. {
  91. list.Add("801402");
  92. }
  93. else if (this.ultraGrid1.ActiveRow.Cells["PRODUCT_FLAG"].Value.ToString() == "在制品")
  94. {
  95. list.Add("801401");
  96. }
  97. list.Add(this.ultraGrid1.ActiveRow.Cells["STORAGE_NO"].Value.ToString());//原仓库
  98. list.Add(row.Cells["COUNT"].Value.ToString());//支数
  99. list.Add(row.Cells["STORENO"].Value.ToString());//目标仓库
  100. list.Add(this.ultraGrid1.ActiveRow.Cells["FINISHPRO_MOLD"].Value.ToString());
  101. list.Add(this.ultraGrid1.ActiveRow.Cells["IN_MOLD"].Value.ToString());
  102. parm.Add(list);
  103. }
  104. }
  105. CoreClientParam ccp = new CoreClientParam();
  106. ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmPipupdateStoreButress";
  107. ccp.MethodName = "updateStore";
  108. ccp.ServerParams = new object[] { parm };
  109. ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
  110. if(ccp.ReturnCode != -1)
  111. {
  112. if (ccp.ReturnInfo.Equals("修改成功!"))
  113. {
  114. buttonValue = "1";
  115. this.Close();
  116. }
  117. }
  118. }
  119. /// <summary>
  120. /// 获取目标仓库
  121. /// </summary>
  122. UltraComboEditor storeNo = new UltraComboEditor();
  123. private void InintStoreNo()
  124. {
  125. YdmBaseClass.InitComboEditor(storeNo, "com.steering.pss.ydm.pipemanage.CorePipeInTemp.getStorageDetail", "STORAGE_NO", this.ob, true);
  126. YdmBaseClass.BindColumn(storeNo, "STORENO", this.Controls, this.ultraGrid3, 0);
  127. }
  128. private void frmPipeMoveStoreButress_Load(object sender, EventArgs e)
  129. {
  130. InintStoreNo();
  131. YdmBaseClass.InitComboEditor(uceReson, "com.steering.pss.ydm.pipemanage.CorePipeInTemp.getStorageDetail", "STORAGE_NO", this.ob, false);
  132. YdmBaseClass.BindColumn(uceReson, "STORAGE_NO", this.Controls, this.ultraGrid1, 0);
  133. GridHelper.CopyDataToDatatable(ref dt, ref dataTable2,true);
  134. }
  135. //private void ultraGrid3_CellChange(object sender, CellEventArgs e)
  136. //{
  137. // if (e.Cell.Row.Cells["COUNT"].Value == "")
  138. // {
  139. // e.Cell.Row.Cells["WEIGHT"].Value = "0";
  140. // }
  141. // else
  142. // {
  143. // ArrayList list = new ArrayList();
  144. // list.Add(this.ultraGrid1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString());
  145. // list.Add(this.ultraGrid1.ActiveRow.Cells["BATCH_NO"].Value.ToString());
  146. // list.Add(this.ultraGrid1.ActiveRow.Cells["BATCH_GROUD_NO"].Value.ToString());
  147. // list.Add(this.ultraGrid1.ActiveRow.Cells["PRODUCT_FLAG"].Value.ToString());
  148. // DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipeleavefactory.CorePipeCarBill.checkMatWeight", new object[] { list }, this.ob);
  149. // if (dt != null && dt.Rows.Count > 0)
  150. // {
  151. // e.Cell.Row.Cells["WEIGHT"].Value = dt.Rows[0][1].ToString();
  152. // }
  153. // else
  154. // {
  155. // e.Cell.Row.Cells["WEIGHT"].Value = "0";
  156. // }
  157. // }
  158. //}
  159. }
  160. }