ComCoupBugReasion.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using CoreFS.CA06;
  5. using Infragistics.Win.UltraWinGrid;
  6. using System;
  7. using System.Collections;
  8. using System.Collections.Generic;
  9. using System.ComponentModel;
  10. using System.Data;
  11. using System.Drawing;
  12. using System.Linq;
  13. using System.Text;
  14. using System.Windows.Forms;
  15. namespace Core.StlMes.Client.Mcp.Coupling
  16. {
  17. public partial class ComCoupBugReasion : FrmBase
  18. {
  19. private string _woid = "";
  20. private string _judgeNo = "";
  21. private DataTable _dtMatList = null;
  22. private OpeBase _ob = null;
  23. ArrayList list = new ArrayList();
  24. private int sumPieces = 0;
  25. private string _validflag = "";
  26. private string flag = "";
  27. public int SumPieces
  28. {
  29. get { return sumPieces; }
  30. set { sumPieces = value; }
  31. }
  32. public ArrayList List
  33. {
  34. get { return list; }
  35. set { list = value; }
  36. }
  37. public ComCoupBugReasion(string woid,string judgeNo,string validflag, OpeBase ob)
  38. {
  39. InitializeComponent();
  40. _woid = woid;
  41. _judgeNo = judgeNo;
  42. _validflag = validflag;
  43. _ob = ob;
  44. }
  45. private string strNum = "";
  46. public string strMemo = "";//备注
  47. public string StrNum
  48. {
  49. get { return strNum; }
  50. set { strNum = value; }
  51. }
  52. public string StrMemo
  53. {
  54. get { return strMemo; }
  55. set { strMemo = value; }
  56. }
  57. private string strat = "";
  58. public string Strat
  59. {
  60. get { return strat; }
  61. set { strat = value; }
  62. }
  63. private void DoSave()
  64. {
  65. UltraGridRow row = ultraGrid1.ActiveRow;
  66. if (row == null) return;
  67. ultraGrid1.UpdateData();
  68. int count = 0;
  69. foreach (UltraGridRow checkrow in ultraGrid1.Rows)
  70. {
  71. if (Convert.ToBoolean(checkrow.Cells["CHK"].Text) == true)
  72. {
  73. if (checkrow.Cells["FAILNUM"].Value == null || checkrow.Cells["FAILNUM"].Value.ToString() == "")
  74. {
  75. MessageUtil.ShowTips("请输入合理个数!");
  76. return;
  77. }
  78. count += 1;
  79. sumPieces += Convert.ToInt32(checkrow.Cells["FAILNUM"].Value.ToString());
  80. strMemo += checkrow.Cells["FAIL_TYPE_NAME"].Value.ToString();
  81. ArrayList arr = new ArrayList();
  82. arr.Add(checkrow.Cells["FAIL_TYPE_NAME"].Value.ToString());
  83. arr.Add(checkrow.Cells["FAILNUM"].Value.ToString());
  84. arr.Add(flag);
  85. list.Add(arr);
  86. }
  87. }
  88. if(count == 0)
  89. {
  90. MessageUtil.ShowTips("请勾选废品并输入合理个数!");
  91. return;
  92. }
  93. this.Close();
  94. }
  95. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  96. {
  97. switch (e.Tool.Key)
  98. {
  99. case "Save":
  100. DoSave();
  101. break;
  102. case "Close":
  103. DoClose();
  104. break;
  105. }
  106. }
  107. private void DoClose()
  108. {
  109. this.Close();
  110. }
  111. private void ComCoupBugReasion_Load(object sender, EventArgs e)
  112. {
  113. string valig = "";
  114. if(_validflag=="1")
  115. {
  116. valig = "7010";
  117. flag = "1";
  118. }
  119. else
  120. {
  121. valig = "7011";
  122. flag = "2";
  123. }
  124. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.CoupCutService.getCutResultFp", new object[] { valig }, this._ob);
  125. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
  126. }
  127. private void ultraGrid1_CellChange(object sender, CellEventArgs e)
  128. {
  129. UltraGridRow urg = ultraGrid1.ActiveRow;
  130. if(urg==null)
  131. {
  132. return;
  133. }
  134. if(e.Cell.Column.Key.Equals("FAILNUM")&&urg.Cells["FAILNUM"].Text!="")
  135. {
  136. urg.Cells["CHK"].Value = true;
  137. }
  138. }
  139. }
  140. }