ComCoupBug.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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 ComCoupBug : 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. public int SumPieces
  26. {
  27. get { return sumPieces; }
  28. set { sumPieces = value; }
  29. }
  30. public ArrayList List
  31. {
  32. get { return list; }
  33. set { list = value; }
  34. }
  35. public ComCoupBug(string woid,string judgeNo,OpeBase ob)
  36. {
  37. InitializeComponent();
  38. _woid = woid;
  39. _judgeNo = judgeNo;
  40. _ob = ob;
  41. }
  42. private string strNum = "";
  43. private string strMemo = "";//备注
  44. public string StrNum
  45. {
  46. get { return strNum; }
  47. set { strNum = value; }
  48. }
  49. public string StrMemo
  50. {
  51. get { return strMemo; }
  52. set { strMemo = value; }
  53. }
  54. private string strat = "";
  55. public string Strat
  56. {
  57. get { return strat; }
  58. set { strat = value; }
  59. }
  60. private void DoSave()
  61. {
  62. UltraGridRow row = ultraGrid1.ActiveRow;
  63. if (row == null) return;
  64. ultraGrid1.UpdateData();
  65. int count = 0;
  66. foreach (UltraGridRow checkrow in ultraGrid1.Rows)
  67. {
  68. if (Convert.ToBoolean(checkrow.Cells["CHK"].Text) == true)
  69. {
  70. if (checkrow.Cells["FAILNUM"].Value == null || checkrow.Cells["FAILNUM"].Value.ToString() == "")
  71. {
  72. MessageUtil.ShowTips("请输入合理个数!");
  73. return;
  74. }
  75. count += 1;
  76. sumPieces += Convert.ToInt32(checkrow.Cells["FAILNUM"].Value.ToString());
  77. ArrayList arr = new ArrayList();
  78. arr.Add(checkrow.Cells["FAIL_TYPE_NAME"].Value.ToString());
  79. arr.Add(checkrow.Cells["FAILNUM"].Value.ToString());
  80. list.Add(arr);
  81. }
  82. }
  83. if(count == 0)
  84. {
  85. MessageUtil.ShowTips("请勾选废品并输入合理个数!");
  86. return;
  87. }
  88. this.Close();
  89. }
  90. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  91. {
  92. switch (e.Tool.Key)
  93. {
  94. case "Save":
  95. DoSave();
  96. break;
  97. case "Close":
  98. DoClose();
  99. break;
  100. }
  101. }
  102. private void DoClose()
  103. {
  104. this.Close();
  105. }
  106. private void ComCoupBug_Load(object sender, EventArgs e)
  107. {
  108. DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.ThreadInspectResultService.getQueryComInfo", new object[] { "7024" }, this._ob);
  109. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
  110. }
  111. private void ultraGrid1_CellChange(object sender, CellEventArgs e)
  112. {
  113. UltraGridRow urg = ultraGrid1.ActiveRow;
  114. if(urg==null)
  115. {
  116. return;
  117. }
  118. if(e.Cell.Column.Key.Equals("FAILNUM")&&urg.Cells["FAILNUM"].Text!="")
  119. {
  120. urg.Cells["CHK"].Value = true;
  121. }
  122. }
  123. }
  124. }