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.Server; using Core.Mes.Client.Comm.Tool; using CoreFS.CA06; namespace Core.StlMes.Client.Mcp.Treatment.HeatTreatment { public partial class FrmEntrustApproval : FrmBase { private int Type = 0; private List SubNo; private string step = ""; private string _name; public FrmEntrustApproval(OpeBase _ob, List subNo, string step, string name, bool ShowPline= true,int type= 0,string[] validDataPurviewIds=null) { InitializeComponent(); this.ob = _ob; SubNo = subNo; this.step = step; _name = name; Type = type; if (ShowPline) { if (step == "1") { chkFlag1.Visible = false; } //if (step == "3" && validDataPurviewIds!=null) //{ // comm.InitDropPlinePowerW(cmbPline, validDataPurviewIds, ob); //} //else //{ DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.frmEntrust.doQueryPlineCode", new object[] { "" }, _ob); cmbPline.DataSource = dt; cmbPline.DisplayMember = "PLINE_NAME"; cmbPline.ValueMember = "PLINE_CODE"; //} } else { plPline.Visible = false; } } public string Note { get { return txtNote.Text; } } public string PlineCode { get { return cmbPline.SelectedIndex<0?"": cmbPline.Value.ToString(); } } public string transCode { get { return cmbTrans.SelectedIndex < 0 ? "" : cmbTrans.Value.ToString(); } } private void ultraButton1_Click(object sender, EventArgs e) { if (plPline.Visible && cmbPline.SelectedIndex < 0) { MessageBox.Show("请选择需要委托的产线"); return; } /* if (plPline.Visible && cmbTrans.SelectedIndex < 0) { MessageBox.Show("请选择用车方式"); return; }*/ if (Type == 0) { var ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.common.frmEntrust"; ccp.MethodName = "ApprovalOk"; ccp.ServerParams = new object[] { SubNo, step,PlineCode, Note, _name,chkFlag1.Checked,chkFlag2.Checked,transCode }; ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { MessageUtil.ShowTips(ccp.ReturnInfo); if (ccp.ReturnInfo.Equals("审核通过成功!")) this.DialogResult = DialogResult.OK; } } if (Type == 1) { var ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.common.frmEntrust"; ccp.MethodName = "ApprovalFail"; ccp.ServerParams = new object[] { SubNo, step, Note, _name }; ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { MessageUtil.ShowTips(ccp.ReturnInfo); if (ccp.ReturnInfo.Equals("审核不通过成功!")) this.DialogResult = DialogResult.OK; } } if (Type == 2) { var ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.common.frmEntrust"; ccp.MethodName = "CancelApproval"; ccp.ServerParams = new object[] { SubNo, step, Note, _name }; ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { MessageUtil.ShowTips(ccp.ReturnInfo); if (ccp.ReturnInfo.Equals("撤销审核成功!")) this.DialogResult = DialogResult.OK; } } if (Type == 3) { var ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.common.frmEntrust"; ccp.MethodName = "MarkCompleted"; ccp.ServerParams = new object[] { SubNo, step, Note, _name }; ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { MessageUtil.ShowTips(ccp.ReturnInfo); if (ccp.ReturnInfo.Equals("委托完成!")) this.DialogResult = DialogResult.OK; } } if (Type == 4) { var ccp = new CoreClientParam(); ccp.ServerName = "com.steering.mes.mcp.common.frmEntrust"; ccp.MethodName = "CancleMarkCompleted"; ccp.ServerParams = new object[] { SubNo, step, Note, _name }; ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { MessageUtil.ShowTips(ccp.ReturnInfo); if (ccp.ReturnInfo.Equals("撤销委托完成!")) this.DialogResult = DialogResult.OK; } } } } }