using Core.Mes.Client.Comm.Control; using Core.StlMes.Client.Judge.Commons; using CoreFS.CA06; using Infragistics.Win; using System; using System.Data; using System.Drawing; using System.Windows.Forms; namespace Core.StlMes.Client.Judge.Controls { public partial class FinalCheckInfoCtrl : UserControl { private Dal _d; public FinalCheckInfoCtrl(Control container, OpeBase ob) { InitializeComponent(); _d = new Dal(ob); container.Controls.Add(this); this.Dock = DockStyle.Fill; ValueList stationList = new ValueList(); stationList.ValueListItems.Add("0", "合格"); stationList.ValueListItems.Add("1", "不合格"); stationList.ValueListItems.Add("2", "废品"); stationList.ValueListItems.Add("3", "扩检"); ultraGrid2.DisplayLayout.Bands[0].Columns["station"].ValueList = stationList; ValueList replayStationList = new ValueList(); replayStationList.ValueListItems.Add("0", "合格"); replayStationList.ValueListItems.Add("2", "废品"); ultraGrid2.DisplayLayout.Bands[0].Columns["replayStation"].ValueList = replayStationList; } public void Query(string judgeStoveNo, string batchNo, string plineCode, bool clearData) { dataTable2.Clear(); DataTable dt = _d.GetTableByXmlId("JdgMchFinalChekResult.getInfo", judgeStoveNo, batchNo, plineCode); GridHelper.CopyDataToDatatable(dt, dataTable1, clearData); foreach (DataRow row in dataTable1.Rows) { if (row["batchNo"].ToString() != "") continue; row["judgeStoveNo"] = judgeStoveNo; row["batchNo"] = batchNo; } GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "reportPath"); } public void ClearData() { this.dataTable1.Clear(); this.dataTable2.Clear(); } private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { string filePath = ultraGrid1.ActiveRow.GetValue("reportPath"); FormFileDown formFile = new FormFileDown(_d.Ob, filePath); formFile.DeleteButton.Visible = false; formFile.Show(); } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { var resultRow = ultraGrid1.ActiveRow; string resultNo = resultRow.GetValue("resultNo"); DataTable dt = _d.GetTableByXmlId("JdgMchFinalChekResultD.getInfo", resultNo); GridHelper.CopyDataToDatatable(dt, dataTable2, true); GridHelper.RefreshAndAutoSize(ultraGrid2); } private void UltraGrid2_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) { if (e.Row.GetValue("replayStation") == "2") { Color yellow = Color.FromArgb(255, 246, 143); e.Row.Appearance.BackColor = yellow; } } } }