using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.Mcp.Mch.Mcms.entity; using CoreFS.CA06; namespace Core.StlMes.Client.Mcp.Mch.Mcms { public partial class NameSelect : FrmBase { public NameSelect(OpeBase _ob, string name,string text) { InitializeComponent(); var dic = new Dictionary(); dic.Add("recordType", name == "OrderName" ? new List() {"3"} : name == "ShippersName" ? new List() {"4"} : name == "ReceiveName" ? new List() {"5"} : name == "TransportName" ? new List() {"6"} : new List() {""}); all = EntityHelper.GetData( "com.steering.Mcms.InputRecordServer.doQuery", new object[] { dic }, _ob); ugStation.DisplayLayout.Bands[0].Columns["RecordValue"].Header.Caption = text; cmmInputRecordEntityBindingSource.DataSource = all; } private CmmInputRecordEntity selectRow = null; private List all; public CmmInputRecordEntity SelectRow { get { return selectRow; } set { selectRow = value; } } private void ugStation_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e) { selectRow = e.Row.ListObject as CmmInputRecordEntity; this.DialogResult = DialogResult.OK; } private void txtQuery_KeyUp(object sender, KeyEventArgs e) { if(all==null) return; cmmInputRecordEntityBindingSource.DataSource = string.IsNullOrWhiteSpace(txtQuery.Text.Trim()) ? all : all.Where(p => p.RecordValue.IndexOf(txtQuery.Text.Trim(), StringComparison.Ordinal) >= 0).ToList(); ugStation.UpdateData(); ugStation.Update(); ugStation.Refresh(); } } }