using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.LgResMgt.Mcms.entity; using CoreFS.CA06; namespace Core.StlMes.Client.LgResMgt.Mcms { public partial class GradeSelect : FrmBase { public GradeSelect(OpeBase _ob, List list, string txt) { InitializeComponent(); ob = _ob; lblShow.Text = txt; if (list==null || !list.Any()) { list = EntityHelper.GetData( "com.steering.Mcms.BlankPredictionServer.doQueryGrades", new object[] { }, ob); } all = list; comBaseGradeEntityBindingSource.DataSource = list; } private ComBaseGradeEntity selectRow = null; private List all; public ComBaseGradeEntity SelectRow { get { return selectRow; } set { selectRow = value; } } private void ugStation_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e) { selectRow = e.Row.ListObject as ComBaseGradeEntity; this.DialogResult = DialogResult.OK; } private void txtQuery_KeyUp(object sender, KeyEventArgs e) { if(all==null) return; comBaseGradeEntityBindingSource.DataSource = string.IsNullOrWhiteSpace(txtQuery.Text.Trim()) ? all : all.Where(p => p.Gradename.IndexOf(txtQuery.Text.Trim(), StringComparison.Ordinal) >= 0).ToList(); ugStation.UpdateData(); ugStation.Update(); ugStation.Refresh(); } } }