9162cdab1075949b67b7dfa6f2830a742b204295.svn-base 4.2 KB

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