using System.Collections.Generic; using System.Linq; using com.steering.mes.mcp.entity; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.Mcp.Control.Entity; using Core.StlMes.Client.Mcp.Control.Machining; namespace Core.StlMes.Client.Mcp.Control { public partial class BundingControl : MchControlBase { public BundingControl() { InitializeComponent(); EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); gx = "701312"; Value = null; } protected override string ScrapCode { get { return ""; } } public MchBundlingResultEntity Value { get { var list = MchBundlingResultEntityBindingSource.DataSource as List; return (list == null) || !list.Any() ? new MchBundlingResultEntity() : list.FirstOrDefault(); } set { if (value == null) { MchBundlingResultEntityBindingSource.DataSource = new List { new MchBundlingResultEntity() }; ScrappedList = new List(); } else { value.ProWt = comm.GetWeight1(PortHttBatchSampleResultEntitys, gx, (int)(value.ProNum ?? 0), (int)(PlnZyJgxCEntity.ProCount ?? 0)); MchBundlingResultEntityBindingSource.DataSource = new List { value.Clone() }; if (_plineCode != Value.PlineCode) { Names = EntityHelper.GetData( "com.steering.mes.mcp.heatTreatment.FrmHttCrackDetectResult.getHttSign", new object[] { Value.PlineCode, "10" }, Ob); name.DisplayMember = "UserName"; name.ValueMember = "UserName"; YdmBaseClass.SetComboItemHeight(name); _plineCode = Value.PlineCode; } name.DataSource = Names.Where(p => p.ColGroup == value.ProGroup).ToList(); if (value.FailNum == 0) ScrappedList = new List(); } } } private void ultraGrid1_CellChange_1(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { if (e.Cell.Column.Key == "BundingTypeCode") { e.Cell.Row.Cells["BundingTypeName"].Value = e.Cell.Text; } } } }