using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using CoreFS.CA06; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Core.StlMes.Client.Mcp.Entity { public partial class FrmOutPrce : Form { OpeBase _ob = null; private string zYgNo = ""; bool _falg = false; public FrmOutPrce(OpeBase ob,String planNo,bool falg) { InitializeComponent(); _ob = ob; zYgNo = planNo; _falg = falg; } private void button1_Click(object sender, EventArgs e) { if (cmbGx.Text.ToString().Equals("")) { MessageUtil.ShowTips("请选择需要结炉的委外工序"); return; } string gx = ""; DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryGX", new object[] { cmbGx.Value.ToString() }, _ob); if (dt2.Rows.Count > 0) { gx = dt2.Rows[0]["BASECODE"].ToString(); } ArrayList list = new ArrayList(); list.Add(zYgNo); list.Add(gx); list.Add(cmbGx.Text.ToString()); if (MessageUtil.ShowYesNoAndQuestion("是否结炉?") == DialogResult.No) { return; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.coup.FrmOutSourPerfor"; ccp.MethodName = "doBeside"; ccp.ServerParams = new object[] { list }; ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("结炉成功!")) { MessageUtil.ShowTips(ccp.ReturnInfo); this.Close(); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } private void FrmOutPrce_Load(object sender, EventArgs e) { if (_falg == true) { button2.Visible = false; button1.Visible = true; } else { button2.Visible = true; button1.Visible = false; } } private void button2_Click(object sender, EventArgs e) { if (cmbGx.Text.ToString().Equals("")) { MessageUtil.ShowTips("请选择需要撤销结炉的委外工序"); return; } string gx = ""; DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryGX", new object[] { cmbGx.Value.ToString() }, _ob); if (dt2.Rows.Count > 0) { gx = dt2.Rows[0]["BASECODE"].ToString(); } ArrayList list = new ArrayList(); list.Add(zYgNo); list.Add(gx); list.Add(cmbGx.Text.ToString()); if (MessageUtil.ShowYesNoAndQuestion("是否撤销结炉?") == DialogResult.No) { return; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.coup.FrmOutSourPerfor"; ccp.MethodName = "undoBeside"; ccp.ServerParams = new object[] { list }; ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("撤销结炉成功!")) { MessageUtil.ShowTips(ccp.ReturnInfo); this.Close(); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } } }