UIM010350.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. /*重卷废次品*/
  13. public partial class UIM010350 : FrmBase
  14. {
  15. public UIM010350()
  16. {
  17. InitializeComponent();
  18. }
  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. }
  31. }
  32. /// <summary>
  33. /// 查询待入库钢卷
  34. /// </summary>
  35. private void DoQuery()
  36. {
  37. try
  38. {
  39. this.dataSet1.Tables[0].Clear();
  40. string procuctedTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";
  41. string coilNo = this.ultraTextEditor1.Text.Trim();
  42. CoreClientParam ccp = new CoreClientParam();
  43. ccp.ServerName = "UIM.UIM010340";
  44. ccp.MethodName = "query";
  45. ccp.ServerParams = new object[] { procuctedTime, coilNo, "2" };
  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. //选框点击事件处理
  56. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  57. {
  58. if (e.Cell.Column.Key == "CHK")
  59. {
  60. if (!Convert.ToBoolean(e.Cell.Value))
  61. {
  62. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  63. {
  64. ultraGrid1.Rows[i].Cells["CHK"].Value = false;
  65. }
  66. e.Cell.Value = true;
  67. this.ultraTextEditor2.Text = e.Cell.Row.Cells["COIL_NO"].Value.ToString();
  68. yardControl1.Layer = "";
  69. yardControl1.Stock = "";
  70. yardControl1.Focus();
  71. }
  72. else
  73. {
  74. e.Cell.Value = false;
  75. this.ultraTextEditor2.Text = "";
  76. }
  77. }
  78. }
  79. private void DoSave()
  80. {
  81. bool flag = false;
  82. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  83. {
  84. if (Convert.ToBoolean(ultraGrid1.Rows[i].Cells["CHK"].Value))
  85. {
  86. flag = true;
  87. break;
  88. }
  89. }
  90. if (!flag)
  91. {
  92. MessageBox.Show("请选择需要入库的钢卷!");
  93. return;
  94. }
  95. string yardAddr = yardControl1.GetYardFlag();//垛位
  96. if (string.IsNullOrEmpty(yardAddr))
  97. {
  98. MessageBox.Show("请选择需要入库的垛位!");
  99. yardControl1.Focus();
  100. return;
  101. }
  102. string entryShift = UserInfo.GetUserOrder();//入库班次
  103. string entryGroup = UserInfo.GetUserGroup();//入库班组
  104. string entryDtime = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMddHHmmss");//入库时间
  105. string reg_id = UserInfo.GetUserID();//操作人
  106. CoreClientParam ccp = new CoreClientParam();
  107. ccp.ServerName = "UIM.UIM010340";
  108. ccp.MethodName = "saveCoilYard";
  109. ccp.ServerParams = new object[] { this.ultraTextEditor2.Text, yardAddr, entryShift, entryGroup, entryDtime, reg_id };
  110. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  111. if (0 == ccp.ReturnCode)
  112. {
  113. MessageBox.Show("入库成功!");
  114. }
  115. DoQuery();
  116. }
  117. private void ultraGrid1_AfterCellActivate(object sender, EventArgs e)
  118. {
  119. }
  120. }
  121. }