FrmMonerSeq.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. using com.steering.pss.ydm.entity;
  2. using Core.Mes.Client.Comm.Format;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.YdmPipeManage.Dialog;
  5. using Core.StlMes.Client.YdmPipeManage.Entity;
  6. using CoreFS.CA06;
  7. using Infragistics.Win.UltraWinGrid;
  8. using System;
  9. using System.Collections;
  10. using System.Collections.Generic;
  11. using System.ComponentModel;
  12. using System.Data;
  13. using System.Drawing;
  14. using System.Linq;
  15. using System.Text;
  16. using System.Windows.Forms;
  17. namespace Core.StlMes.Client.YdmPipeManage
  18. {
  19. public partial class FrmMonerSeq : FrmBase
  20. {
  21. OpeBase _ob;
  22. public string disOk = "";
  23. MatZcMEntity2 matZcEntity = new MatZcMEntity2();
  24. string _userName = "";
  25. string _deptId = "";
  26. string[] _arr = null;
  27. string _acount = "";
  28. public FrmMonerSeq(OpeBase ob, MatZcMEntity matZctity, string userName, string deptId, string[] arr)
  29. {
  30. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  31. InitializeComponent();
  32. _ob = ob;
  33. _deptId = deptId;
  34. _userName = userName;
  35. _arr = arr;
  36. _acount = matZctity.ActCount.ToString3();
  37. matZcEntity.JudgeStoveNo = matZctity.JudgeStoveNo;
  38. matZcEntity.BatchNo = matZctity.BatchNo;
  39. matZcEntity.BatchGroudNo = matZctity.BatchGroudNo;
  40. matZcEntity.ProductFlag = matZctity.ProductFlag;
  41. matZcEntity.MatStatus = matZctity.MatStatus;
  42. matZcEntity.ActLenMin = matZctity.ActLenMin;
  43. matZcEntity.ActLenMax = matZctity.ActLenMax;
  44. matZcEntity.BelongCode = matZctity.BelongCode;
  45. matZcEntity.JudgeResult = matZctity.JudgeResult;
  46. matZcEntity.FixNum = matZctity.FixNum.ToString2();
  47. matZcEntity.Pipmemo = matZctity.Pipmemo;
  48. matZcEntity.StorageNo = matZctity.StorageNo;
  49. matZcEntity.LocationNo = matZctity.LocationNo;
  50. }
  51. /// <summary>
  52. /// 重写基类方法
  53. /// </summary>
  54. /// <param name="sender"></param>
  55. /// <param name="To
  56. /// olbarKey"></param>
  57. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  58. {
  59. switch (e.Tool.Key)
  60. {
  61. case "OK":
  62. doFrim();
  63. break;
  64. case "Close":
  65. this.Close();
  66. break;
  67. }
  68. }
  69. private void doQuery(MatZcMEntity2 matZcEntity2)
  70. {
  71. string matZcTity = JSONFormat.Format(matZcEntity2);
  72. List<MatZcMEntity2> listSource = EntityHelper.GetData<MatZcMEntity2>(
  73. "com.steering.pss.ydm.pipemanage.FrmPipeMagement.doQueryGoods", new object[] { matZcTity }, this._ob);
  74. matZcMEntity2BindingSource.DataSource = listSource;
  75. }
  76. /// <summary>
  77. /// 确认
  78. /// </summary>
  79. private void doFrim()
  80. {
  81. this.ultraGrid1.UpdateData();
  82. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
  83. if (checkMagRows.Count() == 0)
  84. {
  85. return;
  86. }
  87. ArrayList parmList = new ArrayList();
  88. foreach (UltraGridRow row in checkMagRows)
  89. {
  90. MatZcMEntity2 matZcTity = (MatZcMEntity2)row.ListObject;
  91. string matZcEntity = JSONFormat.Format(matZcTity);
  92. parmList.Add(matZcEntity);
  93. }
  94. MonomerDialog monomerDialog = new MonomerDialog(_ob);
  95. monomerDialog.ShowDialog();
  96. string monomerExplain = monomerDialog.monomerExplain;
  97. string monomerFinishedProduct = monomerDialog.momomerFinishedProduct;
  98. if (monomerExplain.Length == 0)
  99. {
  100. return;
  101. }
  102. string isRolling = monomerDialog.isRolling;
  103. CoreClientParam ccp = new CoreClientParam();
  104. ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmPipeMagement";
  105. ccp.MethodName = "seqMoner";
  106. ccp.ServerParams = new object[] { parmList, monomerExplain, isRolling, _userName, _deptId, _arr, monomerFinishedProduct, _acount };
  107. ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  108. if (ccp.ReturnCode != -1)
  109. {
  110. if (ccp.ReturnInfo.Equals("脱单成功!"))
  111. {
  112. disOk = "1";
  113. this.Close();
  114. MessageUtil.ShowTips(ccp.ReturnInfo);
  115. }
  116. else
  117. {
  118. MessageUtil.ShowTips(ccp.ReturnInfo);
  119. }
  120. }
  121. }
  122. private void FrmLikuSeq_Load(object sender, EventArgs e)
  123. {
  124. EntityHelper.ShowGridCaption<MatZcMEntity2>(ultraGrid1.DisplayLayout.Bands[0]);
  125. doQuery(matZcEntity);
  126. }
  127. private void ultraGrid1_CellChange(object sender, CellEventArgs e)
  128. {
  129. this.ultraGrid1.UpdateData();
  130. if (e.Cell.Column.Key == "CHK")
  131. {
  132. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
  133. if (checkMagRows.Count() == 0)
  134. {
  135. this.ultraLabel1.Text = "";
  136. return;
  137. }
  138. int acount = 0;
  139. double len = 0.0;
  140. double wgt = 0.0;
  141. foreach (UltraGridRow row in checkMagRows)
  142. {
  143. acount = acount + int.Parse(row.Cells["ActCount"].Text);
  144. wgt = wgt + double.Parse(row.Cells["ActWeight"].Text);
  145. len = len + double.Parse(row.Cells["ActLen"].Text);
  146. }
  147. this.ultraLabel1.Text = "已选信息:" + acount.ToString3() + "支" + " " + wgt.ToString3() + "吨" + " " + len.ToString3() + "米";
  148. }
  149. }
  150. }
  151. }