UIM070042.cs 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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 UIM070042 : FrmBase
  14. {
  15. public UIM070042()
  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 "Export":
  27. this.Export();
  28. break;
  29. case "Save":
  30. this.DoSave();
  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 = this.textBox9.Text.ToString();
  43. ArrayList al = new ArrayList();
  44. al.Add("UIM070021_02.SELECT");
  45. al.Add(coilno);
  46. al.Add(coilno);
  47. al.Add(coilno);
  48. this.dataSet1.Tables[0].Clear();
  49. CoreClientParam ccp = new CoreClientParam();
  50. ccp.ServerName = "UIB.COM.ComDBQuery";
  51. ccp.MethodName = "doSimpleQuery";
  52. ccp.ServerParams = new object[] { al };
  53. ccp.SourceDataTable = this.dataSet1.Tables[0];
  54. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  55. }
  56. catch (Exception EX)
  57. {
  58. MessageBox.Show(EX.ToString());
  59. }
  60. }
  61. public string OrderSEQ
  62. {
  63. set
  64. {
  65. textBox9.Text = value;
  66. DoQuery();
  67. }
  68. }
  69. /// <summary>
  70. /// 导出EXCEL
  71. /// </summary>
  72. private void Export()
  73. {
  74. try
  75. {
  76. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  77. {
  78. string fileName = this.saveFileDialog1.FileName;
  79. this.ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  80. System.Diagnostics.Process.Start(fileName);
  81. }
  82. }
  83. catch (Exception ex)
  84. {
  85. MessageBox.Show(ex.ToString());
  86. }
  87. }
  88. private void DoSave()
  89. {
  90. Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
  91. ArrayList list = new ArrayList();
  92. string[] param = null;
  93. CoreClientParam ccp = new CoreClientParam();
  94. rs = this.ultraGrid1.Rows;
  95. for (int i = 0; i < rs.Count; i++)
  96. {
  97. if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
  98. {
  99. param = new string[1];
  100. param[0] = rs[i].Cells["PRIGUID"].Value.ToString().Trim();
  101. list.Add(param);
  102. }
  103. }
  104. ccp.ServerName = "UIM.UIM07.UIM070020";
  105. ccp.MethodName = "deleteyard";
  106. ccp.ServerParams = new Object[] { list };
  107. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  108. }
  109. private void ultraGrid1_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
  110. {
  111. try
  112. {
  113. if (this.ultraGrid1.ActiveRow != null)
  114. {
  115. string COIL_NO = Convert.ToString(Common.FixDBManager.CheckNullStr(this.ultraGrid1.ActiveRow.Cells["H_COIL_NO"].Value));
  116. UIM010081C frm = new UIM010081C();
  117. frm.ob = this.ob;
  118. frm.Condition = COIL_NO;
  119. frm.ShowDialog();
  120. }
  121. }
  122. catch (System.Exception ex)
  123. {
  124. System.Diagnostics.Debug.WriteLine(ex.ToString());
  125. }
  126. }
  127. private void button4_Click(object sender, EventArgs e)
  128. {
  129. this.DoSave();
  130. }
  131. private void button5_Click(object sender, EventArgs e)
  132. {
  133. this.DoQuery();
  134. }
  135. private void button6_Click(object sender, EventArgs e)
  136. {
  137. /// <summary>
  138. try
  139. {
  140. this.dataSet1.Tables[0].Clear();
  141. string coilno = this.textBox9.Text.ToString();
  142. ArrayList al = new ArrayList();
  143. al.Add("UIM070021_04.SELECT");
  144. al.Add(coilno);
  145. this.dataSet1.Tables[0].Clear();
  146. CoreClientParam ccp = new CoreClientParam();
  147. ccp.ServerName = "UIB.COM.ComDBQuery";
  148. ccp.MethodName = "doSimpleQuery";
  149. ccp.ServerParams = new object[] { al };
  150. ccp.SourceDataTable = this.dataSet1.Tables[0];
  151. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  152. }
  153. catch (Exception EX)
  154. {
  155. MessageBox.Show(EX.ToString());
  156. }
  157. }
  158. private void button1_Click(object sender, EventArgs e)
  159. {
  160. this.dataSet2.Tables[0].Clear();
  161. string coilno = this.textBox9.Text.ToString();
  162. ArrayList al = new ArrayList();
  163. al.Add("UIM070021_05.SELECT");
  164. al.Add(coilno);
  165. al.Add(coilno);
  166. this.dataSet1.Tables[0].Clear();
  167. CoreClientParam ccp = new CoreClientParam();
  168. ccp.ServerName = "UIB.COM.ComDBQuery";
  169. ccp.MethodName = "doSimpleQuery";
  170. ccp.ServerParams = new object[] { al };
  171. ccp.SourceDataTable = this.dataSet2.Tables[0];
  172. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  173. }
  174. private void button2_Click(object sender, EventArgs e)
  175. {
  176. Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
  177. ArrayList list = new ArrayList();
  178. string[] param = null;
  179. CoreClientParam ccp = new CoreClientParam();
  180. rs = this.ultraGrid2.Rows;
  181. for (int i = 0; i < rs.Count; i++)
  182. {
  183. if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
  184. {
  185. param = new string[1];
  186. param[0] = rs[i].Cells["PRIGUID"].Value.ToString().Trim();
  187. list.Add(param);
  188. }
  189. }
  190. ccp.ServerName = "UIM.UIM07.UIM070020";
  191. ccp.MethodName = "returnyard";
  192. ccp.ServerParams = new Object[] { list };
  193. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  194. }
  195. private void TabControl1_SelectedIndexChanged(object sender, EventArgs e)
  196. {
  197. switch (this.TabControl1.SelectedIndex)
  198. {
  199. case 0:
  200. this.button1.Visible = false;
  201. this.button2.Visible = false;
  202. this.button4.Visible = true;
  203. this.button5.Visible = true;
  204. this.button6.Visible = true;
  205. break;
  206. case 1:
  207. this.button1.Visible = true;
  208. this.button2.Visible = true;
  209. this.button4.Visible = false;
  210. this.button5.Visible = false;
  211. this.button6.Visible = false;
  212. break;
  213. }
  214. }
  215. }
  216. }