UIM010090.cs 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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. using System.Collections;
  11. namespace Core.LZMes.Client.UIM
  12. {
  13. public partial class UIM010090 : FrmBase
  14. {
  15. private int OUT_TYPE = 1;//出库类型,默认为上料出库
  16. public UIM010090()
  17. {
  18. InitializeComponent();
  19. }
  20. private void UIM010090_Load(object sender, EventArgs e)
  21. {
  22. this.ultraComboEditor1.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. case "Export":
  35. this.Export();
  36. break;
  37. case "DoQueryReturn":
  38. this.DoQueryReturn();
  39. break;
  40. case "DoSaveReturn":
  41. this.DoSaveReturn();
  42. break;
  43. case "Exit":
  44. this.Close();
  45. break;
  46. }
  47. }
  48. /// <summary>
  49. /// 查询原料库库存数据
  50. /// </summary>
  51. private void DoQuery()
  52. {
  53. try
  54. {
  55. this.dataSet1.Tables[0].Clear();
  56. string coilNo = textBox3.Text.Trim();
  57. string ordNo = this.textBox1.Text.Trim();
  58. string ordSeq = this.textBox2.Text.Trim();
  59. CoreClientParam ccp = new CoreClientParam();
  60. ccp.ServerName = "UIM.UIM010090";
  61. ccp.MethodName = "queryOutCoil";
  62. ccp.ServerParams = new object[] { ordNo,ordSeq,coilNo };
  63. ccp.SourceDataTable = this.dataSet1.Tables[0];
  64. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  65. }
  66. catch (Exception EX)
  67. {
  68. MessageBox.Show(EX.ToString());
  69. }
  70. }
  71. private void DoQueryReturn()
  72. {
  73. try
  74. {
  75. this.dataSet1.Tables[0].Clear();
  76. string coilNo = textBox3.Text.Trim();
  77. string ordNo = this.textBox1.Text.Trim();
  78. string ordSeq = this.textBox2.Text.Trim();
  79. CoreClientParam ccp = new CoreClientParam();
  80. ccp.ServerName = "UIB.COM.ComDBQuery";
  81. ccp.MethodName = "doSimpleQuery";
  82. ArrayList paramArray = new ArrayList();
  83. paramArray.Add("UIM010090_04.SELECT");
  84. paramArray.Add(ordNo);
  85. paramArray.Add(ordSeq);
  86. paramArray.Add(coilNo);
  87. ccp.ServerParams = new object[] { paramArray };
  88. ccp.SourceDataTable = this.dataSet1.Tables[0];
  89. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  90. }
  91. catch (Exception EX)
  92. {
  93. MessageBox.Show(EX.ToString());
  94. }
  95. }
  96. /// <summary>
  97. /// 原料库出库
  98. /// </summary>
  99. private void DoSave()
  100. {
  101. try
  102. {
  103. if (this.ultraGrid1.ActiveRow == null)
  104. {
  105. MessageBox.Show("请选择需要出库的钢卷!");
  106. }
  107. string coilNo = this.ultraGrid1.ActiveRow.Cells["OLD_SAMPL_NO"].Text;
  108. if (MessageBox.Show("是否确定将" + coilNo + "退回热轧?", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
  109. {
  110. string regID = this.UserInfo.GetUserID();//出库人
  111. string trnfShift = this.UserInfo.GetUserOrder();//出库班次
  112. string trnfGroup = this.UserInfo.GetUserGroup();//出库班组
  113. string trnfDtime = this.ultraDateTimeEditor1.Value != null ? this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMddHHmmss") : "";//出库时间
  114. int trnfType = int.Parse(this.ultraComboEditor1.Value.ToString());//0退实物 1退账面
  115. CoreClientParam ccp = new CoreClientParam();
  116. ccp.ServerName = "UIM.UIM010090";
  117. ccp.MethodName = "saveCoilOut";
  118. ccp.ServerParams = new object[] { coilNo, regID, trnfShift, trnfGroup, trnfDtime, trnfType };
  119. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  120. this.DoQuery();
  121. }
  122. }
  123. catch (Exception EX)
  124. {
  125. MessageBox.Show(EX.ToString());
  126. }
  127. }
  128. private void Export()
  129. {
  130. try
  131. {
  132. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  133. {
  134. string fileName = this.saveFileDialog1.FileName;
  135. this.ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  136. System.Diagnostics.Process.Start(fileName);
  137. }
  138. }
  139. catch (Exception ex)
  140. {
  141. MessageBox.Show(ex.ToString());
  142. }
  143. }
  144. private void DoSaveReturn()
  145. {
  146. try
  147. {
  148. if (this.ultraGrid1.ActiveRow == null)
  149. {
  150. MessageBox.Show("请选择需要出库的钢卷!");
  151. }
  152. string coilNo = this.ultraGrid1.ActiveRow.Cells["OLD_SAMPL_NO"].Text;
  153. if (MessageBox.Show("是否确定将" + coilNo + "撤销退回?", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
  154. {
  155. string regID = this.UserInfo.GetUserID();//出库人
  156. string trnfShift = this.UserInfo.GetUserOrder();//出库班次
  157. string trnfGroup = this.UserInfo.GetUserGroup();//出库班组
  158. string trnfDtime = this.ultraDateTimeEditor1.Value != null ? this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMddHHmmss") : "";//出库时间
  159. int trnfType = int.Parse(this.ultraComboEditor1.Value.ToString());//0退实物 1退账面
  160. //CoreClientParam ccp = new CoreClientParam();
  161. //ccp.ServerName = "UIB.COM.ComDBSave";
  162. //ccp.MethodName = "doXmlSave";
  163. //ArrayList paramArray = new ArrayList();
  164. //paramArray.Add("UIM010090_05.UPDATE");
  165. //paramArray.Add(coilNo);
  166. //ccp.ServerParams = new object[] { paramArray };
  167. ////ccp.ServerParams = new object[] { coilNo, regID, trnfShift, trnfGroup, trnfDtime, trnfType };
  168. //this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  169. CoreClientParam ccp = new CoreClientParam();
  170. ccp.ServerName = "UIM.UIM010090";
  171. ccp.MethodName = "deletereturn";
  172. ccp.ServerParams = new object[] { coilNo,regID, trnfShift, trnfGroup, trnfDtime };
  173. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  174. this.DoQueryReturn();
  175. }
  176. }
  177. catch (Exception EX)
  178. {
  179. MessageBox.Show(EX.ToString());
  180. }
  181. }
  182. }
  183. }