be6741b97a26c3a691f55ae07a961859cfff0e72.svn-base 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. namespace Core.LZMes.Client.UIM
  11. {
  12. public partial class UIM010130 : FrmBase
  13. {
  14. //钢卷号
  15. private string COIL_NO = "";
  16. public UIM010130()
  17. {
  18. InitializeComponent();
  19. }
  20. public override void ToolBar_Click(object sender, string ToolbarKey)
  21. {
  22. switch (ToolbarKey)
  23. {
  24. case "Query":
  25. this.DoQuery();
  26. break;
  27. case "Save":
  28. this.DoSave();
  29. break;
  30. case "Exit":
  31. this.Close();
  32. break;
  33. }
  34. }
  35. /// <summary>
  36. /// 查询钢卷在系统中的位置
  37. /// </summary>
  38. private void DoQuery()
  39. {
  40. try
  41. {
  42. this.dataSet1.Tables[0].Clear();
  43. string coilNo = "R" + this.textBox1.Text.Trim() + "-" + this.textBox2.Text.Trim()
  44. + "A" + this.textBox3.Text.Trim();
  45. //外购卷入库可以直接调用中间库入库查询钢卷信息
  46. CoreClientParam ccp = new CoreClientParam();
  47. ccp.ServerName = "UIM.UIM010120";
  48. ccp.MethodName = "queryCoilStatus";
  49. ccp.ServerParams = new object[] { coilNo };
  50. ccp.SourceDataTable = this.dataSet1.Tables[0];
  51. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  52. COIL_NO = coilNo;
  53. }
  54. catch (Exception EX)
  55. {
  56. MessageBox.Show(EX.ToString());
  57. }
  58. }
  59. /// <summary>
  60. /// 中间库外购卷入库
  61. /// </summary>
  62. private void DoSave()
  63. {
  64. if (this.dataTable1.Rows.Count < 1)
  65. {
  66. MessageBox.Show("没有查询到相应的钢卷信息!");
  67. return;
  68. }
  69. //判断入库班次、班组、入库人、时间输入是否正确
  70. if (-1 == this.ultraComboEditor1.SelectedIndex)
  71. {
  72. MessageBox.Show("请选择相应的入库班次!");
  73. this.ultraComboEditor1.Focus();
  74. return;
  75. }
  76. if (-1 == this.ultraComboEditor2.SelectedIndex)
  77. {
  78. MessageBox.Show("请选择相应的入库班组!");
  79. this.ultraComboEditor2.Focus();
  80. return;
  81. }
  82. //判断成份信息是否输入
  83. if (null == this.textBox4.Text || "".Equals(this.textBox4.Text))
  84. {
  85. MessageBox.Show("请输入炉号!");
  86. this.textBox4.Focus();
  87. return;
  88. }
  89. if (null == this.textBox5.Text || "".Equals(this.textBox5.Text))
  90. {
  91. MessageBox.Show("请输入工序!");
  92. this.textBox5.Focus();
  93. return;
  94. }
  95. if (null == this.textBox6.Text || "".Equals(this.textBox6.Text))
  96. {
  97. MessageBox.Show("请输入次数!");
  98. this.textBox6.Focus();
  99. return;
  100. }
  101. if (null == this.textBox7.Text || "".Equals(this.textBox7.Text))
  102. {
  103. MessageBox.Show("请输入元素名!");
  104. this.textBox7.Focus();
  105. return;
  106. }
  107. if (null == this.textBox8.Text || "".Equals(this.textBox8.Text))
  108. {
  109. MessageBox.Show("请输入实际值!");
  110. this.textBox8.Focus();
  111. return;
  112. }
  113. UIM010041 dlg = null;// new UIM010041("2");
  114. if (DialogResult.OK == dlg.ShowDialog(this))
  115. {
  116. string yardAddr = dlg.YARD_ADDR;//垛位
  117. string entryShift = this.ultraComboEditor1.Text;//入库班次
  118. string entryGroup = this.ultraComboEditor2.Text;//入库班组
  119. string entryDtime = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMddHHmmss");//入库时间
  120. string reg_id = this.UserInfo.GetUserID();//操作人
  121. //成份信息
  122. string chargeNo = this.textBox4.Text;//炉号
  123. string procCd = this.textBox5.Text;//工序
  124. string chemSeq = this.textBox6.Text;//次数
  125. string chemCd = this.textBox7.Text;//元素名
  126. string chemVar = this.textBox8.Text;//实际值
  127. string imgrRmk = this.textBox10.Text;//备注
  128. string element = chargeNo + "|" + procCd + "|" + chemSeq + "|" + chemCd + "|" + chemVar + "|" + imgrRmk;
  129. //性能信息
  130. string performance = "";
  131. //录入入库信息
  132. CoreClientParam ccp = new CoreClientParam();
  133. ccp.ServerName = "UIM.UIM010130";
  134. ccp.MethodName = "saveCoilYard";
  135. ccp.ServerParams = new object[] { COIL_NO, yardAddr, entryShift, entryGroup, entryDtime, reg_id, element, performance };
  136. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  137. }
  138. }
  139. }
  140. }