FrmLikuSeq.cs 5.4 KB

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