using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using CoreFS.CA06; namespace Core.LgMes.Client.LgJobMgt { public partial class frmModifySpec : Core.Mes.Client.Common.frmStyleBase { public string strHeatNO = ""; //炉号 public string strSteel = ""; //牌号 public string strBilletNo = ""; //坯料号 public string strOld_Height = ""; //原始厚度 public string strOld_Width = ""; //原始宽度 public string strOld_Length = ""; //原始长度 public string strNew_Height = ""; //新厚度 public string strNew_Width = ""; //新宽度 public string strNew_Length = ""; //新长度 public string strTheroyWeight = ""; //理论重量 public frmModifySpec() { InitializeComponent(); } private void frmModifySpec_Load(object sender, EventArgs e) { txtHeatNo.Text = strHeatNO; txtSteel.Text = strSteel; txtBilletNo.Text = strBilletNo; txtHeight.Text = strOld_Height; txtWidth.Text = strOld_Width; txtLength.Text = strOld_Length; } private void btnSend_Click(object sender, EventArgs e) { if (strHeatNO == "" ) { MessageBox.Show("请在切割计划选择要修改规格的切割计划!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } if(txtHeight_New.Text.Trim().Length == 0) { MessageBox.Show("新厚度不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } if(txtLength_New.Text.Trim().Length == 0 ) { MessageBox.Show("新长度不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } if (txtWidth_New.Text.Trim().Length == 0) { MessageBox.Show("新宽度不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } float a = Convert.ToSingle(this.txtLength_New.Text.Trim()); float b = Convert.ToSingle(this.txtWidth_New.Text.Trim()); float c = Convert.ToSingle(this.txtHeight_New.Text.Trim()); string strbilletWetght = Convert.ToString(Math.Round(a * b * c * 7.82 / 1000000000, 2)); string strError = ""; DialogResult result = DialogResult.No; result = MessageBox.Show(this, "确认要修改【炉号:" + strHeatNO + ",牌号:" + strSteel + "】\n" + " 原始规格【厚度:" + strOld_Height + ",宽度:" + strOld_Width + ",长度:" + strOld_Length + "】\n" + " 新规格【厚度:" + txtHeight_New.Text + ",宽度:" + txtWidth_New.Text + ",长度:" + txtLength_New.Text + "】的切割计划吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (result == DialogResult.Yes) { try { strNew_Height = txtHeight_New.Text; //新厚度 strNew_Width = txtWidth_New.Text; //新宽度 strNew_Length = txtLength_New.Text; //新长度 //hengxing //ClientCommon._RemotingHelp.ExecuteMethod("lgIntegrationQuery", // "Core.LgMes.Server.lgIntegrationQuery.LgGeneralInfo", // "ModifySpec", new object[] { strBilletNo, strNew_Height, strNew_Width, strNew_Length, strbilletWetght }, out strError); if (strError != "") { MessageBox.Show("切割计划规格修改失败!\n" + strError, "错误!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else this.Close(); } catch (System.Exception exp) { MessageBox.Show("切割计划规格修改失败!\n" + exp.ToString(), "错误!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } private void btnNo_Click(object sender, EventArgs e) { this.Close(); } private void txtHeight_New_KeyPress(object sender, KeyPressEventArgs e) { if (!(Char.IsNumber(e.KeyChar) || e.KeyChar == '\b')) { e.Handled = true; } } } }