e0a8ab851ec4410e89343e009ad2366e51e499b7.svn-base 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 UIM060030 : FrmBase
  13. {
  14. public UIM060030()
  15. {
  16. InitializeComponent();
  17. }
  18. public override void ToolBar_Click(object sender, string ToolbarKey)
  19. {
  20. switch (ToolbarKey)
  21. {
  22. case "Query":
  23. this.DoQuery();
  24. break;
  25. case "Save":
  26. this.DoSave();
  27. break;
  28. }
  29. }
  30. /// <summary>
  31. /// 查询待入库钢卷
  32. /// </summary>
  33. private void DoQuery()
  34. {
  35. try
  36. {
  37. this.dataSet1.Tables[0].Clear();
  38. this.dataSet1.Tables[1].Clear();
  39. string procuctedTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";
  40. string toprocuctedTime = ultraDateTimeEditor3.Value != null ? ultraDateTimeEditor3.DateTime.ToString("yyyyMMdd") : "";
  41. string coilNo = textBox9.Text.Trim();
  42. CoreClientParam ccp = new CoreClientParam();
  43. ccp.ServerName = "UIM.UIM06.UIM060030";
  44. ccp.MethodName = "queryCoilsInStock";
  45. ccp.ServerParams = new object[] { procuctedTime, toprocuctedTime, coilNo, "1" };
  46. ccp.SourceDataTable = this.dataSet1.Tables[0];
  47. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  48. textBox1.Text = "";
  49. }
  50. catch (Exception EX)
  51. {
  52. MessageBox.Show(EX.ToString());
  53. }
  54. }
  55. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  56. {
  57. if (e.Cell.Column.Key == "CHK")
  58. {
  59. if (!Convert.ToBoolean(e.Cell.Value))
  60. {
  61. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  62. {
  63. ultraGrid1.Rows[i].Cells["CHK"].Value = false;
  64. }
  65. e.Cell.Value = true;
  66. textBox1.Text = e.Cell.Row.Cells["COIL_NO"].Value.ToString();
  67. yardControl1.Layer = "A";
  68. yardControl1.Stock = "7";
  69. yardControl1.Focus();
  70. }
  71. else
  72. {
  73. e.Cell.Value = false;
  74. textBox1.Text = "";
  75. }
  76. }
  77. }
  78. /// <summary>
  79. /// 成品库钢卷入库
  80. /// </summary>
  81. private void DoSave()
  82. {
  83. bool flag = false;
  84. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  85. {
  86. if (Convert.ToBoolean(ultraGrid1.Rows[i].Cells["CHK"].Value))
  87. {
  88. flag = true;
  89. break;
  90. }
  91. }
  92. if (!flag)
  93. {
  94. MessageBox.Show("请选择需要入库的钢卷!");
  95. return;
  96. }
  97. string yardAddr = yardControl1.GetYardFlagZJ();//垛位
  98. if (string.IsNullOrEmpty(yardAddr))
  99. {
  100. MessageBox.Show("请选择需要入库的垛位!");
  101. yardControl1.Focus();
  102. return;
  103. }
  104. string entryShift = UserInfo.GetUserOrder();//入库班次
  105. string entryGroup = UserInfo.GetUserGroup();//入库班组
  106. string entryDtime = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMddHHmmss");//入库时间
  107. string reg_id = UserInfo.GetUserID();//操作人
  108. CoreClientParam ccp = new CoreClientParam();
  109. ccp.ServerName = "UIM.UIM06.UIM060030";
  110. ccp.MethodName = "saveCoilYardN";
  111. ccp.ServerParams = new object[] { textBox1.Text.Trim(), yardAddr, entryShift, entryGroup, entryDtime, reg_id };
  112. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  113. if (0 == ccp.ReturnCode)
  114. {
  115. MessageBox.Show("入库成功!");
  116. }
  117. DoQuery();
  118. }
  119. private void button1_Click(object sender, EventArgs e)
  120. {
  121. this.DoSave();
  122. }
  123. }
  124. }