using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.Mcp.Control.Entity; using CoreFS.CA06; using Infragistics.Win.UltraWinEditors; using Infragistics.Win.UltraWinGrid; namespace Core.StlMes.Client.Mcp.Control.Common { public partial class FrmHttBase : FrmBase { public FrmHttBase() { InitializeComponent(); // EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); /* commHelper.RefreshAndAutoSize(ultraGrid1);*/ commHelper.setOtherColumnReadOnly(ultraGrid1, new string[] { }); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); commHelper.RefreshAndAutoSize(ultraGrid1); ultraGrid1.DisplayLayout.Bands[0].Override.HeaderClickAction = HeaderClickAction.Select; /* commHelper.setOtherColumnReadOnly(ultraGrid1, new string[] { });*/ } public string Gx { get; set; } /// /// 只显示主表数据 /// public bool ShowMain { get; set; } public void Query(string[] PlineCodes) { var starts = ""; var plnNo = ""; var judgeStoveNo = ""; var feedStoveNo = ""; var start = contorlPlanStatus1.statusArr; if (chkPlnNo.Checked) if (string.IsNullOrEmpty(txtRollBatchId.Text.Trim())) { MessageUtil.ShowTips("请输入炉次计划号!"); return; } else { plnNo = txtRollBatchId.Text.Trim(); start = new string[4] { "10", "20", "30", "40" }; } if (chkJuNo.Checked) if (string.IsNullOrEmpty(txtZyBatchId.Text.Trim())) { MessageUtil.ShowTips("请输入炉号!"); return; } else { judgeStoveNo = txtZyBatchId.Text.Trim(); start = new string[4] { "10", "20", "30", "40" }; } if (chkFeedNo.Checked) if (string.IsNullOrEmpty(txtFeedNo.Text.Trim())) { MessageUtil.ShowTips("请输入上料炉号!"); return; } else { feedStoveNo = txtFeedNo.Text.Trim(); start = new string[4] { "10", "20", "30", "40" }; } plnZyRclCEntityBindingSource.DataSource = EntityHelper.GetData( "com.steering.mes.mcp.common.PlanService.getSingleRclPlan", new object[] { ShowMain, plnNo, judgeStoveNo,feedStoveNo, PlineCodes, start, Gx, ultraOptionSet2.Value.ToString2() }, ob); commHelper.RefreshAndAutoSize(ultraGrid1); } public PlnZyRclCEntity ActiveRow { get { if (ultraGrid1.ActiveRow == null) return null; return ultraGrid1.ActiveRow.ListObject as PlnZyRclCEntity; } } private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) { PlnZyRclCEntity PlnZyRclCEntity = e.Row.ListObject as PlnZyRclCEntity; if (PlnZyRclCEntity == null) return; if (PlnZyRclCEntity.Planstatus == "20") { e.Row.Cells["Planstatus"].Appearance.BackColor = Color.LightGreen; } else if (PlnZyRclCEntity.Planstatus == "30" || PlnZyRclCEntity.Planstatus == "40") { e.Row.Cells["Planstatus"].Appearance.BackColor = Color.Red; e.Row.Appearance.BackColor = Color.LightGray; } if (PlnZyRclCEntity.ActCount > 0) { e.Row.Cells["ActCount"].Appearance.BackColor = Color.LightGreen; } if (!string.IsNullOrEmpty(PlnZyRclCEntity.CycleBatch)) { e.Row.Cells["CycleBatch"].Appearance.BackColor = Color.Red; PlnZyRclCEntity.CycleBatch = "批号:" + PlnZyRclCEntity.CycleBatch + "不合,要求重新热处理"; } } private void craftImg_EditorButtonClick(object sender, EditorButtonEventArgs e) { if(ActiveRow==null) return; var craftPath = YdmBaseClass.getQueryCraftNoRCL(ActiveRow.CraftFileNo, ActiveRow.CraftSeq.ToString3(), ob); if (e.Button.Key.ToLower().Equals("select")) { var down = new FormFileDown(ob, craftPath); down.CtrlFileDown1.Button3.Visible = false; down.ShowDialog(); } } private void chkStarts_CheckedChanged(object sender, EventArgs e) { if (chkPlnNo.Checked) txtRollBatchId.Enabled = true; else txtRollBatchId.Enabled = false; if (chkJuNo.Checked) txtZyBatchId.Enabled = true; else txtZyBatchId.Enabled = false; if (chkFeedNo.Checked) txtFeedNo.Enabled = true; else txtFeedNo.Enabled = false; } private void uteCraft2_EditorButtonClick(object sender, EditorButtonEventArgs e) { if (ActiveRow==null) return; if (e.Button.Key.ToLower().Equals("select")) { var down = new FormFileDown(ob, "Qcm/CraftLv2/" + ActiveRow.OrderNoSeq + "/" + ActiveRow.SecCraftFileNo); down.CtrlFileDown1.Button3.Visible = false; down.ShowDialog(); } } } }