97d9871b8898d1e8ab32a16d31d9ae6b4117c2fd.svn-base 3.8 KB

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