using com.steering.mes.mcp.entity; using Core.Mes.Client.Comm.Tool; using CoreFS.CA06; using Infragistics.Win.UltraWinGrid; using System; 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.CollarLibrary { public partial class FrmOrderJg : FrmBase { private OpeBase _ob; private PlnOrderJgEntity baseEntity = null; private string orderNo = ""; private string codeJg = ""; private string dealOrde = ""; private int num = 0; private string ordLnDyPk = ""; private string codeJgBl=""; private string gowhereName = ""; public PlnOrderJgEntity BaseEntity { get { return baseEntity; } set { baseEntity = value; } } public FrmOrderJg(OpeBase ob) { _ob = ob; InitializeComponent(); } public FrmOrderJg(OpeBase ob, string _orderNo, string _codeJg, string _dealOrde, int _num, string _ordLnDyPk, string _codeJgBl, string _gowhereName) { _ob = ob; orderNo = _orderNo; codeJg = _codeJg; dealOrde = _dealOrde; num = _num; ordLnDyPk = _ordLnDyPk; codeJgBl = _codeJgBl; gowhereName = _gowhereName; InitializeComponent(); } private void FrmOrderJg_Load(object sender, EventArgs e) { EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); if (orderNo.Equals("")) { doQuery(); } else { doQueryOrder(); } } private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { switch (e.Tool.Key) { case "Add"://确认 doAdd(); break; case "Close": this.Close(); break; default: break; } } private void doQuery() { List listSource = EntityHelper.GetData( "com.steering.mes.mcp.CollarLibrary.FrmDealOut.getQuery", null, _ob); plnOrderJgEntityBindingSource.DataSource = listSource; } private void doQueryOrder() { List listSource = EntityHelper.GetData( "com.steering.mes.mcp.CollarLibrary.FrmDealOut.getQueryOrder", new object[] { codeJg, dealOrde, ordLnDyPk, codeJgBl, gowhereName }, _ob); plnOrderJgEntityBindingSource.DataSource = listSource; foreach (UltraGridRow item in ultraGrid1.Rows) { item.Cells["Num"].Value=num; string ordersqe=item.Cells["OrderNo"].Text.Trim()+"/"+item.Cells["OrderSeq"].Text.Trim(); if (ordersqe.Equals(orderNo)) { item.Appearance.BackColor = Color.Wheat; item.Activate(); } } } private void doAdd() { UltraGridRow ugrM = ultraGrid1.ActiveRow; if (ugrM == null) return; baseEntity = (PlnOrderJgEntity)ugrM.ListObject; this.Close(); } private void ultraGrid1_CellChange(object sender, CellEventArgs e) { ultraGrid1.UpdateData(); if (e.Cell.Column.Key.Equals("Num")) { if (e.Cell.Row.Cells["Num"].Value == null) { e.Cell.Row.Cells["Num"].Value = num; } else { string actCount = e.Cell.Row.Cells["Num"].Value.ToString(); if (!StringUtil.IsDouble(actCount) || actCount == "0") { e.Cell.Row.Cells["Num"].Value = num; } else { if (num < int.Parse(actCount)) { e.Cell.Row.Cells["Num"].Value = num; } } } } } } }