6793c53c6762d2aaf3021f6cf7247e043d3d79d6.svn-base 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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 UIM010340 : FrmBase
  13. {
  14. public UIM010340()
  15. {
  16. InitializeComponent();
  17. }
  18. //工具栏事件处理
  19. public override void ToolBar_Click(object sender, string ToolbarKey)
  20. {
  21. switch (ToolbarKey)
  22. {
  23. case "Query":
  24. this.DoQuery();
  25. break;
  26. case "Save":
  27. this.DoSave();
  28. break;
  29. }
  30. }
  31. /// <summary>
  32. /// 查询待入库钢卷
  33. /// </summary>
  34. private void DoQuery()
  35. {
  36. try
  37. {
  38. this.dataSet1.Tables[0].Clear();
  39. string procuctedTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";
  40. string coilNo = this.ultraTextEditor1.Text.Trim();
  41. CoreClientParam ccp = new CoreClientParam();
  42. ccp.ServerName = "UIM.UIM010340";
  43. ccp.MethodName = "query";
  44. ccp.ServerParams = new object[] { procuctedTime, 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. //选框点击事件处理
  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. this.ultraTextEditor2.Text = e.Cell.Row.Cells["COIL_NO"].Value.ToString();
  67. yardControl1.Layer = "";
  68. yardControl1.Stock = "";
  69. yardControl1.Focus();
  70. }
  71. else
  72. {
  73. e.Cell.Value = false;
  74. this.ultraTextEditor2.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.GetYardFlag();//垛位
  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.UIM010340";
  110. ccp.MethodName = "saveCoilYard";
  111. ccp.ServerParams = new object[] { this.ultraTextEditor2.Text,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. }
  120. }