private void btnOK_Click(object sender, EventArgs e) { bsHeatData.EndEdit(); if ((rbtnOnline.Checked) && (cbxPath.Text.Trim() == "")) { MessageBox.Show("请选择去向!"); return; } if ((rbtnOffline.Checked) && (cbxReason.Text.Trim() == "")) { MessageBox.Show("请选择下线理由!"); return; } cmdPath.Object = "XGMESLogic\\QualityMag\\CQA_HeatSufaceAssume_Mag\\QA_HeatSufaceAssume_Mag"; if ((rbtnOffline.Checked) && (!rbtnOnline.Checked)) { cmdPath.Method = "BloomOffLine"; } else if ((!rbtnOffline.Checked) && (rbtnOnline.Checked)) { cmdPath.Method = "BloomHotSend"; } else { MessageBox.Show("请选择去向!"); return; } if (MessageBox.Show("确认出坯?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString() != "Yes") { return; } cmdPath.Parameters.Clear(); dsHeatData.AcceptChanges(); AppSvrHMI.L3CommandParameter l3CommandParameter1 = new AppSvrHMI.L3CommandParameter(); cmdPath.Parameters.Add(l3CommandParameter1); cmdPath.Parameters[0].SourceObject = dsHeatData; int iRet = cmdPath.Execute(); String returnFlag = cmdPath.Command.Return.ToString(); string strReasultShow = CommDataMag.CommonMethed.GetErrorDescByErrorCode(dsError, returnFlag); if (iRet != 0 || Convert.ToInt16(cmdPath.Command.Return) < 0) { MessageBox.Show("失败!" + strReasultShow); //MessageBox.Show(string.Format("失败!错误:{0:X},{1:X}", cmdPath.Command.ErrorCode, iRet)); } else { MessageBox.Show("出坯成功!", "提示"); this.Close(); } }
private void btnOK_Click(object sender, EventArgs e) { string check = MessageBox.Show("确认炉次分割申请?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question).ToString(); if (check != "OK") { return; } if (cbxReason.SelectedValue == null) { MessageBox.Show("请选择炉次分割原因!"); return; } cmdApply.Object = Class_URI; cmdApply.Method = "DivideHeatApp"; cmdApply.Parameters.Clear(); int nUnitType = Convert.ToInt16((curUnitID.Substring(1, 1))); int nUnitID = Convert.ToInt16((curUnitID.Substring(2, 1))); if (nUnitType < 6) { MessageBox.Show("申请工位不允许!"); return; } AppSvrHMI.L3CommandParameter l3CommandParameter1 = new AppSvrHMI.L3CommandParameter(); cmdApply.Parameters.Add(l3CommandParameter1); cmdApply.Parameters[0].ConstantValue = cbxReason.SelectedValue.ToString(); cmdApply.Object = Class_URI; int iRet = cmdApply.Execute(); if (iRet != 0 || (Convert.ToInt16(cmdApply.Command.Return)) == 0) { MessageBox.Show(string.Format("失败!错误:{0:X},{1:X}", cmdApply.Command.ErrorCode, iRet)); } else { MessageBox.Show("申请成功,等待调度炉次分割!"); Close(); } return; }
private void btnConfirm_Click(object sender, EventArgs e) { if (cbxReason.SelectedValue == null) { MessageBox.Show("请选择改钢原因!"); return; } string check = MessageBox.Show("确认改钢申请?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString(); if (check != "Yes") { return; } cmdApply.Object = Class_URI; cmdApply.Method = "ChangeSteelGradeApp"; cmdApply.Parameters.Clear(); int nUnitType = Convert.ToInt16((curUnitID.Substring(1, 1))); int nUnitID = Convert.ToInt16((curUnitID.Substring(2, 1))); if (nUnitType > 6 || nUnitType < 2) { MessageBox.Show("申请工位不允许!"); return; } if (nUnitType < 4) { AppSvrHMI.L3CommandParameter l3CommandParameter1 = new AppSvrHMI.L3CommandParameter(); cmdApply.Parameters.Add(l3CommandParameter1); AppSvrHMI.L3CommandParameter l3CommandParameter2 = new AppSvrHMI.L3CommandParameter(); cmdApply.Parameters.Add(l3CommandParameter2); cmdApply.Parameters[0].ConstantValue = cbxReason.SelectedValue.ToString(); if (nUnitID == 4) { cmdApply.Parameters[1].ConstantValue = "80"; } else { cmdApply.Parameters[1].ConstantValue = "50"; } } else { AppSvrHMI.L3CommandParameter l3CommandParameter1 = new AppSvrHMI.L3CommandParameter(); cmdApply.Parameters.Add(l3CommandParameter1); cmdApply.Parameters[0].ConstantValue = cbxReason.SelectedValue.ToString(); } cmdApply.Object = Class_URI; int iRet = cmdApply.Execute(); if (iRet != 0 || ((short)cmdApply.Command.Return) == 0) { // [12/28/2008 sun] string strReasultShow = CommDataMag.CommonMethed.GetErrorDescByErrorCode(dsError, string.Format("{0:X}", cmdApply.Command.ErrorCode)); //MessageBox.Show(string.Format("失败!错误:{0:X},{1:X}", cmdApply.Command.ErrorCode, iRet)); MessageBox.Show("失败!" + strReasultShow); } else { MessageBox.Show("申请成功,等待调度改钢!"); Close(); } return; }
private void btnOK_Click(object sender, EventArgs e) { string check = MessageBox.Show("确认返送申请?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question).ToString(); if (check != "OK") { return; } if (cbxReason.SelectedValue == null || cbxHeatID.Text.Trim() == "") { MessageBox.Show("请选择返送原因和炉号!"); return; } cmdApply.Object = Class_URI; cmdApply.Method = "SteelBackApp"; cmdApply.Parameters.Clear(); int nUnitType = Convert.ToInt16((curUnitID.Substring(1, 1))); int nUnitID = Convert.ToInt16((curUnitID.Substring(2, 1))); cmdApply.Parameters.Clear(); if (nUnitType < 4) { MessageBox.Show("申请工位不允许!"); return; } if (nUnitType > 3 && nUnitType < 6) { AppSvrHMI.L3CommandParameter l3CommandParameter1 = new AppSvrHMI.L3CommandParameter(); cmdApply.Parameters.Add(l3CommandParameter1); AppSvrHMI.L3CommandParameter l3CommandParameter2 = new AppSvrHMI.L3CommandParameter(); cmdApply.Parameters.Add(l3CommandParameter2); cmdApply.Parameters[0].ConstantValue = cbxReason.SelectedValue.ToString(); cmdApply.Parameters[1].ConstantValue = cbxHeatID.Text.Trim(); } else { AppSvrHMI.L3CommandParameter l3CommandParameter1 = new AppSvrHMI.L3CommandParameter(); cmdApply.Parameters.Add(l3CommandParameter1); cmdApply.Parameters[0].ConstantValue = cbxReason.SelectedValue.ToString(); } cmdApply.Object = Class_URI; int iRet = cmdApply.Execute(); if (iRet != 0 || (Convert.ToInt16(cmdApply.Command.Return)) == 0) { // [12/28/2008 sun] string strReasultShow = CommDataMag.CommonMethed.GetErrorDescByErrorCode(dsError, string.Format("{0:X}", cmdApply.Command.ErrorCode)); //MessageBox.Show(string.Format("失败!错误:{0:X},{1:X}", cmdApply.Command.ErrorCode, iRet)); MessageBox.Show("失败!" + strReasultShow); } else { MessageBox.Show("申请成功,等待调度返送!"); Close(); } return; }