UIM010240.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 UIM010240 : FrmBase
  13. {
  14. private int OUT_TYPE = 1;//出库类型,默认为上料出库
  15. public UIM010240()
  16. {
  17. InitializeComponent();
  18. }
  19. private void UIM010240_Load(object sender, EventArgs e)
  20. {
  21. this.ultraButton1.Enabled = false;
  22. this.ultraComboEditor2.SelectedIndex = 0;
  23. }
  24. public override void ToolBar_Click(object sender, string ToolbarKey)
  25. {
  26. switch (ToolbarKey)
  27. {
  28. case "Query":
  29. this.DoQuery();
  30. break;
  31. case "Save":
  32. this.DoSave();
  33. break;
  34. }
  35. }
  36. /// <summary>
  37. /// 查询中间库库存数据
  38. /// </summary>
  39. private void DoQuery()
  40. {
  41. try
  42. {
  43. this.dataSet1.Tables[0].Clear();
  44. string coilNo = textBox3.Text.Trim();
  45. CoreClientParam ccp = new CoreClientParam();
  46. ccp.ServerName = "UIM.UIM010170";
  47. //if (ultraComboEditor1.SelectedIndex < 1)
  48. //{
  49. // OUT_TYPE = 1;
  50. // this.ultraComboEditor2.Enabled = true;
  51. // ccp.MethodName = "queryMillPlan";
  52. // ccp.ServerParams = new object[] { coilNo };
  53. //}
  54. //else
  55. //{
  56. //退废出库类型为2 ,退回类型为3
  57. OUT_TYPE = 2;// ultraComboEditor1.SelectedIndex == 1 ? 2 : 3;
  58. this.ultraComboEditor2.Enabled = false;
  59. ccp.MethodName = "queryOutCoil";
  60. ccp.ServerParams = new object[] { coilNo };
  61. //}
  62. ccp.SourceDataTable = this.dataSet1.Tables[0];
  63. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  64. this.ultraButton1.Enabled = true;
  65. }
  66. catch (Exception EX)
  67. {
  68. MessageBox.Show(EX.ToString());
  69. }
  70. }
  71. /// <summary>
  72. /// 成品库出库
  73. /// </summary>
  74. private void DoSave()
  75. {
  76. try
  77. {
  78. if (this.ultraGrid1.Selected.Rows.Count < 1)
  79. {
  80. MessageBox.Show("请选择需要出库的钢卷!");
  81. }
  82. string coilNo = this.ultraGrid1.Selected.Rows[0].Cells["COIL_NO"].Text;
  83. string regID = this.UserInfo.GetUserID();//出库人
  84. string trnfShift = "A";//出库班次
  85. string trnfGroup = "1";//出库班组
  86. string trnfDtime = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMddHHmmss");//出库时间
  87. string trnfRemark = this.ultraComboEditor2.Enabled ? this.ultraComboEditor2.Value.ToString() : "";//出库去向
  88. CoreClientParam ccp = new CoreClientParam();
  89. ccp.ServerName = "UIM.UIM010170";
  90. ccp.MethodName = "saveCoilOut";
  91. ccp.ServerParams = new object[] { OUT_TYPE, coilNo, regID, trnfShift, trnfGroup, trnfDtime, trnfRemark };
  92. ccp.SourceDataTable = this.dataSet1.Tables[0];
  93. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  94. }
  95. catch (Exception EX)
  96. {
  97. MessageBox.Show(EX.ToString());
  98. }
  99. }
  100. }
  101. }