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 com.steering.mes.mcp.entity; using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.Mcp.Control.Entity; using CoreFS.CA06; using Infragistics.Win.UltraWinEditors; namespace Core.StlMes.Client.Mcp.Control.Common { public delegate void AfterRowActivateHandler(object sender, PlnZyRclCEntity e); public partial class HeatPlanControl : UserControl { public event AfterRowActivateHandler AfterRowActivateHandler; public HeatPlanControl() { InitializeComponent(); EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); commHelper.RefreshAndAutoSize(ultraGrid1); commHelper.setOtherColumnReadOnly(ultraGrid1,new string[]{}); } public OpeBase Ob { get; set; } public string Gx { get; set; } public bool Status1 { get { return contorlPlanStatus1.Status1; } set { contorlPlanStatus1.Status1 = value; } } public bool Status2 { get { return contorlPlanStatus1.Status2; } set { contorlPlanStatus1.Status2 = value; } } public bool Status3 { get { return contorlPlanStatus1.Status3; } set { contorlPlanStatus1.Status3 = value; } } public bool Status4 { get { return contorlPlanStatus1.Status4; } set { contorlPlanStatus1.Status4= value; } } public bool Status5 { get { return contorlPlanStatus1.Status5; } set { contorlPlanStatus1.Status5 = value; } } /// /// 只显示主表数据 /// public bool ShowMain { get; set; } public void Query(string[] PlineCodes) { var starts = ""; var plnNo = ""; var judgeStoveNo = ""; var start = contorlPlanStatus1.statusArr; if (chkPlnNo.Checked) if (string.IsNullOrEmpty(txtRollBatchId.Text.Trim())) { MessageUtil.ShowTips("请输入炉次计划号!"); return; } else { plnNo = txtRollBatchId.Text.Trim(); start = new string[5] {"00", "10", "20", "30", "40"}; } if (chkJuNo.Checked) if (string.IsNullOrEmpty(txtZyBatchId.Text.Trim())) { MessageUtil.ShowTips("请输入炉号!"); return; } else { judgeStoveNo = txtZyBatchId.Text.Trim(); start = new string[5] { "00", "10", "20", "30", "40" }; } plnZyRclCEntityBindingSource.DataSource = EntityHelper.GetData( "com.steering.mes.mcp.common.PlanService.getSingleRclPlan", new object[] { ShowMain, plnNo, judgeStoveNo, 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_AfterRowActivate(object sender, EventArgs e) { PlnZyRclCEntity PlnZyRclCEntity = ultraGrid1.ActiveRow.ListObject as PlnZyRclCEntity; if(PlnZyRclCEntity==null) return; var handler = AfterRowActivateHandler; if (handler != null) handler(this, 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; } } private void craftImg_EditorButtonClick(object sender, EditorButtonEventArgs e) { var row = ultraGrid1.ActiveRow; var craftPath = YdmBaseClass.getQueryCraftNoRCL(row.Cells["CRAFT_FILE_NO"].Text, row.Cells["CRAFT_SEQ"].Text, 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; } } }