using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using CoreFS.CA06; using Infragistics.Win.UltraWinGrid; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Core.StlMes.Client.Mcp.Coupling { public partial class ComCoupBug : FrmBase { private string _woid = ""; private string _judgeNo = ""; private DataTable _dtMatList = null; private OpeBase _ob = null; ArrayList list = new ArrayList(); private int sumPieces = 0; public int SumPieces { get { return sumPieces; } set { sumPieces = value; } } public ArrayList List { get { return list; } set { list = value; } } public ComCoupBug(string woid,string judgeNo,OpeBase ob) { InitializeComponent(); _woid = woid; _judgeNo = judgeNo; _ob = ob; } private string strNum = ""; private string strMemo = "";//备注 public string StrNum { get { return strNum; } set { strNum = value; } } public string StrMemo { get { return strMemo; } set { strMemo = value; } } private string strat = ""; public string Strat { get { return strat; } set { strat = value; } } private void DoSave() { UltraGridRow row = ultraGrid1.ActiveRow; if (row == null) return; ultraGrid1.UpdateData(); int count = 0; foreach (UltraGridRow checkrow in ultraGrid1.Rows) { if (Convert.ToBoolean(checkrow.Cells["CHK"].Text) == true) { if (checkrow.Cells["FAILNUM"].Value == null || checkrow.Cells["FAILNUM"].Value.ToString() == "") { MessageUtil.ShowTips("请输入合理个数!"); return; } count += 1; sumPieces += Convert.ToInt32(checkrow.Cells["FAILNUM"].Value.ToString()); ArrayList arr = new ArrayList(); arr.Add(checkrow.Cells["FAIL_TYPE_NAME"].Value.ToString()); arr.Add(checkrow.Cells["FAILNUM"].Value.ToString()); list.Add(arr); } } if(count == 0) { MessageUtil.ShowTips("请勾选废品并输入合理个数!"); return; } this.Close(); } private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { switch (e.Tool.Key) { case "Save": DoSave(); break; case "Close": DoClose(); break; } } private void DoClose() { this.Close(); } private void ComCoupBug_Load(object sender, EventArgs e) { DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.ThreadInspectResultService.getQueryComInfo", new object[] { "7024" }, this._ob); GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true); } private void ultraGrid1_CellChange(object sender, CellEventArgs e) { UltraGridRow urg = ultraGrid1.ActiveRow; if(urg==null) { return; } if(e.Cell.Column.Key.Equals("FAILNUM")&&urg.Cells["FAILNUM"].Text!="") { urg.Cells["CHK"].Value = true; } } } }