using Core.Mes.Client.Comm.Format; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.YdmBcPipeManage.Entity; using CoreFS.CA06; using Infragistics.Win.UltraWinGrid; using System; using System.Collections; using System.Collections.Generic; using System.Data; namespace Core.StlMes.Client.YdmBcPipeManage { public partial class FrmOfflineVrp : FrmBase { public FrmOfflineVrp(OpeBase ob, string[] valid) { this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; InitializeComponent(); _ob = ob; _valid = valid; } private string currentPlineCode; private string[] plineCode = null; private string[] _valid = null; private void FrmOfflineZg_Load(object sender, EventArgs e) { EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); plineCode = BaseMethod.getPCodePline(_valid, _ob); doQueryMilPlan(); } OpeBase _ob; /// /// 重写基类方法 /// /// /// private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { switch (e.Tool.Key) { case "DoQuery": doQueryMilPlan(); break; case"DoOffline": doOffline(); break; case"DoBack": doBack(); break; case "Close": this.Close(); break; } } /// /// 查询可离线数据 /// private void doQueryMilPlan() { string lotNo = ""; string judgeNo = ""; if(chkBatch.Checked && this.txtBatch.Text.Trim() != "") { lotNo = this.txtBatch.Text.Trim(); } if(this.chkFurnace.Checked && this.txtFurnace.Text != "") { judgeNo = this.txtFurnace.Text.Trim(); } List listSource = EntityHelper.GetData( "com.steering.mes.mcp.common.OfflineHelper.QueryVrpCanOffLineData", new object[] { lotNo, judgeNo, plineCode }, _ob); plnZyDbkMWithGroupPortBindingSource.DataSource = listSource; } /// /// 离线 /// private void doOffline() { this.ultraGrid1.UpdateData(); PlnZyDbkMWithGroupPort PlnZyRclMWithGroupPort = this.ultraGrid1.ActiveRow.ListObject as PlnZyDbkMWithGroupPort; if (PlnZyRclMWithGroupPort == null) return; if (cmbProcess.Text == "") { MessageUtil.ShowTips("离线时请选择离线工序点!"); return; } if (PlnZyRclMWithGroupPort.EditCount==null) { MessageUtil.ShowTips("请输入离线支数!"); return; } string gx = cmbProcess.SelectedItem.DataValue.ToString(); ArrayList list = new ArrayList(); list.Add(PlnZyRclMWithGroupPort.HeatPlanNo); list.Add(PlnZyRclMWithGroupPort.PhyBatchNo); list.Add(gx); list.Add(this.UserInfo.GetUserName()); list.Add(this.UserInfo.GetUserOrder()); list.Add(this.UserInfo.GetUserGroup()); list.Add((int)PlnZyRclMWithGroupPort.EditCount); list.Add(PlnZyRclMWithGroupPort.PlineCode); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.common.OfflineHelper"; ccp.MethodName = "VrpOffLine"; ccp.ServerParams = new object[] { list }; ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("离线成功!")) { doQueryMilPlan(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 撤销离线 /// private void doBack() { } private void chkLotNo_CheckedChanged(object sender, EventArgs e) { this.txtBatch.Enabled = this.chkBatch.Checked; } private void chkFurnace_CheckedChanged(object sender, EventArgs e) { this.txtFurnace.Enabled = this.chkFurnace.Checked; } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { PlnZyDbkMWithGroupPort PlnZyRclMWithGroupPort = this.ultraGrid1.ActiveRow.ListObject as PlnZyDbkMWithGroupPort; if (PlnZyRclMWithGroupPort != null && PlnZyRclMWithGroupPort.PlineCode != currentPlineCode) { currentPlineCode = PlnZyRclMWithGroupPort.PlineCode; object[] para = null; switch (currentPlineCode) { case"": break; case "C018": para = new object[] { "6501", new string[] { "650101", "650102", "650103", "650104", "650106", "650107" } }; break; case "C013": case "C080": para = new object[] { "6505", new string[] { "650501", "650502", "650504", "650505" } }; break; case "C014": para = new object[] { "6506", new string[] { "650601", "650602", "650604", "650605" } }; break; case "C021": case "C067": para = new object[] { "6504", new string[] { "650401", "650402", "650404", "650405" } }; break; case "C070": para = new object[] { "6507", new string[] { "650701", "650702", "650704", "650705" } }; break; default: para = new object[] { "6504", new string[] { "650401", "650402", "650404", "650405" } }; break; } if (para != null) { var dt5 = ServerHelper.GetData("com.steering.mes.mcp.heatTreatment.ScrapHelper.doQuery", para, _ob); cmbProcess.DataSource = dt5; cmbProcess.DisplayMember = "BASENAME"; cmbProcess.ValueMember = "BASECODE"; } else { cmbProcess.DataSource = null; } } } } }