frmModifySpec.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using CoreFS.CA06;
  9. namespace Core.LgMes.Client.LgJobMgt
  10. {
  11. public partial class frmModifySpec : Core.Mes.Client.Common.frmStyleBase
  12. {
  13. public string strHeatNO = ""; //炉号
  14. public string strSteel = ""; //牌号
  15. public string strBilletNo = ""; //坯料号
  16. public string strOld_Height = ""; //原始厚度
  17. public string strOld_Width = ""; //原始宽度
  18. public string strOld_Length = ""; //原始长度
  19. public string strNew_Height = ""; //新厚度
  20. public string strNew_Width = ""; //新宽度
  21. public string strNew_Length = ""; //新长度
  22. public string strTheroyWeight = ""; //理论重量
  23. public frmModifySpec()
  24. {
  25. InitializeComponent();
  26. }
  27. private void frmModifySpec_Load(object sender, EventArgs e)
  28. {
  29. txtHeatNo.Text = strHeatNO;
  30. txtSteel.Text = strSteel;
  31. txtBilletNo.Text = strBilletNo;
  32. txtHeight.Text = strOld_Height;
  33. txtWidth.Text = strOld_Width;
  34. txtLength.Text = strOld_Length;
  35. }
  36. private void btnSend_Click(object sender, EventArgs e)
  37. {
  38. if (strHeatNO == "" )
  39. {
  40. MessageBox.Show("请在切割计划选择要修改规格的切割计划!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  41. return;
  42. }
  43. if(txtHeight_New.Text.Trim().Length == 0)
  44. {
  45. MessageBox.Show("新厚度不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  46. return;
  47. }
  48. if(txtLength_New.Text.Trim().Length == 0 )
  49. {
  50. MessageBox.Show("新长度不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  51. return;
  52. }
  53. if (txtWidth_New.Text.Trim().Length == 0)
  54. {
  55. MessageBox.Show("新宽度不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  56. return;
  57. }
  58. float a = Convert.ToSingle(this.txtLength_New.Text.Trim());
  59. float b = Convert.ToSingle(this.txtWidth_New.Text.Trim());
  60. float c = Convert.ToSingle(this.txtHeight_New.Text.Trim());
  61. string strbilletWetght = Convert.ToString(Math.Round(a * b * c * 7.82 / 1000000000, 2));
  62. string strError = "";
  63. DialogResult result = DialogResult.No;
  64. result = MessageBox.Show(this, "确认要修改【炉号:" + strHeatNO + ",牌号:" + strSteel + "】\n" +
  65. " 原始规格【厚度:" + strOld_Height + ",宽度:" + strOld_Width + ",长度:" + strOld_Length + "】\n" +
  66. " 新规格【厚度:" + txtHeight_New.Text + ",宽度:" + txtWidth_New.Text + ",长度:" + txtLength_New.Text + "】的切割计划吗?",
  67. "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
  68. if (result == DialogResult.Yes)
  69. {
  70. try
  71. {
  72. strNew_Height = txtHeight_New.Text; //新厚度
  73. strNew_Width = txtWidth_New.Text; //新宽度
  74. strNew_Length = txtLength_New.Text; //新长度
  75. //hengxing
  76. //ClientCommon._RemotingHelp.ExecuteMethod("lgIntegrationQuery",
  77. // "Core.LgMes.Server.lgIntegrationQuery.LgGeneralInfo",
  78. // "ModifySpec", new object[] { strBilletNo, strNew_Height, strNew_Width, strNew_Length, strbilletWetght }, out strError);
  79. if (strError != "")
  80. {
  81. MessageBox.Show("切割计划规格修改失败!\n" + strError, "错误!", MessageBoxButtons.OK, MessageBoxIcon.Error);
  82. return;
  83. }
  84. else
  85. this.Close();
  86. }
  87. catch (System.Exception exp)
  88. {
  89. MessageBox.Show("切割计划规格修改失败!\n" + exp.ToString(), "错误!", MessageBoxButtons.OK, MessageBoxIcon.Error);
  90. }
  91. }
  92. }
  93. private void btnNo_Click(object sender, EventArgs e)
  94. {
  95. this.Close();
  96. }
  97. private void txtHeight_New_KeyPress(object sender, KeyPressEventArgs e)
  98. {
  99. if (!(Char.IsNumber(e.KeyChar) || e.KeyChar == '\b'))
  100. {
  101. e.Handled = true;
  102. }
  103. }
  104. }
  105. }