using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using Core.Mes.Client.Comm.Control; using com.steering.mes.mcp.entity; using Infragistics.Win.UltraWinGrid; using Core.Mes.Client.Comm.Tool; using Core.Mes.Client.Comm.Server; using Core.StlMes.Client.Mcp.Control.Entity; using CoreFS.CA06; using Infragistics.Win; using Infragistics.Win.UltraWinEditors; namespace Core.StlMes.Client.Mcp.Control { public partial class DetectResultControlManual : UserControl { public DetectResultControlManual() { InitializeComponent(); EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); ScrappedList = new DataSourceList(); } public OpeBase Ob { get; set; } public void SetFont(Font f1) { ultraGrid1.Font = f1; foreach (UltraGridColumn UltraGridColumn in ultraGrid1.DisplayLayout.Bands[0].Columns) { UltraGridColumn.Header.Appearance.FontData.Bold = f1.Bold ? DefaultableBoolean.True : DefaultableBoolean.False; UltraGridColumn.Header.Appearance.FontData.Name = f1.Name; UltraGridColumn.Header.Appearance.FontData.SizeInPoints = f1.SizeInPoints; } } /// /// 废品 /// public List ScrappedList { get; set; } public string gx { get; set; } public HttCrackDetectionEtEntity Value { get { var list = httCrackDetectionEtEntityBindingSource.DataSource as List; return (list == null) || !list.Any() ? new HttCrackDetectionEtEntity() : list.FirstOrDefault(); } set { if (value == null) { httCrackDetectionEtEntityBindingSource.DataSource = new List { new HttCrackDetectionEtEntity() }; ScrappedList = new List(); } else { httCrackDetectionEtEntityBindingSource.DataSource = new List { value}; if (value.RejectNum == null || value.RejectNum == 0) { ScrappedList = new List(); } } ultraGrid1.Refresh(); } } public void DisableFiltering() { ultraGrid1.DisplayLayout.Override.AllowRowFiltering = DefaultableBoolean.False; foreach (var ugc in ultraGrid1.DisplayLayout.Bands[0].Columns) ugc.SortIndicator = SortIndicator.Disabled; } private void ultraGrid1_CellChange(object sender, CellEventArgs e) { ultraGrid1.UpdateData(); } private void craftImg_EditorButtonClick(object sender, EditorButtonEventArgs e) { if (Value.HeatPlanNo == null) return; if (Value.PlineCode == null) return; var matfrm = new FrmScrapHttNew(Ob, new List(), ScrappedList, false, Value.HeatPlanNo, int.Parse(Value.ProcessSeq.ToString3()), "600405", Value.BatchNo); matfrm.ShowDialog(); if (matfrm.DialogResult == DialogResult.OK) { ScrappedList = matfrm.ScrappedList; Value.RejectNum = ScrappedList.Sum(p => p.DefFillNum); Value.EwasteWt = ScrappedList.Sum(p => p.DefFillWt); // SuspiciousList = matfrm.SuspiciousList; // Value.DubiousNum = SuspiciousList.Sum(p => p.DefFillNum); Value.EwasteReason = ScrappedList.Any() ? ScrappedList.Select(p => p.DefFillName).Distinct().Aggregate((a, b) => (string.IsNullOrEmpty(a) ? "" : (a + ",")) + b) : "/"; } Value.EwasteNum = Value.EwasteNum ?? 0; Value.EpassNum = Value.TestingNum - Value.EwasteNum; // Value.DubiousNum = Value.DubiousNum ?? 0; ultraGrid1.PerformAction(UltraGridAction.ExitEditMode); ultraGrid1.UpdateData(); } } }