1a39574d302363338d88bbfbf5b85e0ff3caec9d.svn-base 4.2 KB

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