UIF042010.cs 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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.UIF
  12. {
  13. public partial class UIF042010 : FrmBase
  14. {
  15. string thd_grp_cd = "";
  16. string wth_grp_cd = "";
  17. public UIF042010()
  18. {
  19. InitializeComponent();
  20. }
  21. public override void ToolBar_Click(object sender, string ToolbarKey)
  22. {
  23. switch (ToolbarKey)
  24. {
  25. case "Query":
  26. this.DoQuery();
  27. break;
  28. case "Save":
  29. this.update01();
  30. break;
  31. case "cancel":
  32. this.update02();
  33. break;
  34. case "confirm":
  35. this.update03();
  36. break;
  37. }
  38. }
  39. private void DoQuery()
  40. {
  41. try
  42. {
  43. this.dataSet1.Tables[0].Clear();
  44. CoreClientParam ccp = new CoreClientParam();
  45. ccp.ServerName = "UIF.UIF04.UIF042010";
  46. ccp.MethodName = "query01";
  47. ccp.ServerParams = new object[] {};
  48. ccp.SourceDataTable = this.dataSet1.Tables[0];
  49. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  50. Console.WriteLine(this.dataSet1.Tables[0].ToString());
  51. }
  52. catch (Exception EX)
  53. {
  54. MessageBox.Show(EX.ToString());
  55. }
  56. }
  57. private void ultraGrid1_ClickCell(object sender, Infragistics.Win.UltraWinGrid.ClickCellEventArgs e)
  58. {
  59. string columnID = Convert.ToString(this.楷.ActiveCell.Column.Key);
  60. if(columnID.Substring(4,3).Equals("CNT"))
  61. {
  62. //宽度组上下限
  63. string grpWthMin = Convert.ToString(this.楷.ActiveCell.Row.Cells["WTH_MINI"].Value);
  64. string grpWthMax = Convert.ToString(this.楷.ActiveCell.Row.Cells["WTH_MAXI"].Value);
  65. //厚度组上下限
  66. this.thd_grp_cd = columnID.Substring(0, 3);
  67. this.wth_grp_cd = Convert.ToString(this.楷.ActiveCell.Row.Cells["WTH_GRP_CD"].Value);
  68. string columnKey01 = columnID.Substring(0, 4) + "CNT";
  69. string columnKey02 = columnID.Substring(0, 4) + "WGT";
  70. string grpThkMin = Convert.ToString(this.楷.Rows[0].Cells[columnKey01].Value);
  71. string grpThkMax = Convert.ToString(this.楷.Rows[0].Cells[columnKey02].Value);
  72. string stl_grd = Convert.ToString(Common.FixDBManager.CheckNullStr(this.combo_stl.Text));
  73. string ord_no = Convert.ToString(Common.FixDBManager.CheckNullStr(this.combo_ord_no.Text));
  74. string ord_seq = Convert.ToString(Common.FixDBManager.CheckNullStr(this.combo_ord_seq.Text));
  75. string entry_time = Convert.ToString(Common.FixDBManager.CheckNullStr(this.combo_entry_dtime.Text));
  76. string cur_loc = Convert.ToString(Common.FixDBManager.CheckNullStr(this.combo_cur_loc.Text));
  77. string prod_line = Convert.ToString(Common.FixDBManager.CheckNullStr(this.combo_prod_line.Text));
  78. string exshape_grd = Convert.ToString(Common.FixDBManager.CheckNullStr(this.combo_exshape_grd.Text));
  79. this.dataSet2.Tables[0].Clear();
  80. CoreClientParam ccp = new CoreClientParam();
  81. ccp.ServerName = "UIF.UIF04.UIF042010";
  82. ccp.MethodName = "query02";
  83. ccp.ServerParams = new object[] { cur_loc, ord_no, ord_seq, entry_time, exshape_grd, stl_grd, prod_line, grpThkMin, grpThkMax, grpWthMin, grpWthMax };
  84. ccp.SourceDataTable = this.dataSet2.Tables[0];
  85. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  86. Console.WriteLine(this.dataSet2.Tables[0].ToString());
  87. }else if(columnID.Substring(4,3).Equals("WGT")){
  88. this.thd_grp_cd = columnID.Substring(0, 3);
  89. this.wth_grp_cd = Convert.ToString(this.楷.ActiveCell.Row.Cells["WTH_GRP_CD"].Value);
  90. this.dataSet2.Tables[0].Clear();
  91. CoreClientParam ccp = new CoreClientParam();
  92. ccp.ServerName = "UIF.UIF04.UIF042010";
  93. ccp.MethodName = "query03";
  94. ccp.ServerParams = new object[] { thd_grp_cd, wth_grp_cd };
  95. ccp.SourceDataTable = this.dataSet2.Tables[0];
  96. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  97. Console.WriteLine(this.dataSet2.Tables[0].ToString());
  98. }
  99. }
  100. private void update01()
  101. {
  102. try
  103. {
  104. ArrayList chk = new ArrayList();
  105. ArrayList coil_no = new ArrayList();
  106. System.Data.DataRow[] row = this.dataSet2.Tables[0].Select("CHK='true'");
  107. int len = row.Length;
  108. for (int i = 0; i < len; i++)
  109. {
  110. chk.Add(row[i]["CHK"]);
  111. coil_no.Add(row[i]["COIL_NO"]);
  112. }
  113. CoreClientParam ccp = new CoreClientParam();
  114. ccp.ServerName = "UIF.UIF04.UIF042010";
  115. ccp.MethodName = "update01";
  116. ccp.ServerParams = new object[] {coil_no,this.thd_grp_cd,this.wth_grp_cd};
  117. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  118. //if (ccp.ReturnCode != 0) return;
  119. this.dataSet2.Tables[0].Clear();
  120. DoQuery();
  121. }
  122. catch (Exception EX)
  123. {
  124. MessageBox.Show(EX.ToString());
  125. }
  126. }
  127. private void update02()
  128. {
  129. try
  130. {
  131. ArrayList chk = new ArrayList();
  132. ArrayList coil_no = new ArrayList();
  133. System.Data.DataRow[] row = this.dataSet2.Tables[0].Select("CHK='true'");
  134. int len = row.Length;
  135. for (int i = 0; i < len; i++)
  136. {
  137. chk.Add(row[i]["CHK"]);
  138. coil_no.Add(row[i]["COIL_NO"]);
  139. }
  140. CoreClientParam ccp = new CoreClientParam();
  141. ccp.ServerName = "UIF.UIF04.UIF042010";
  142. ccp.MethodName = "update02";
  143. ccp.ServerParams = new object[] { coil_no};
  144. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  145. //if (ccp.ReturnCode != 0) return;
  146. }
  147. catch (Exception EX)
  148. {
  149. MessageBox.Show(EX.ToString());
  150. }
  151. }
  152. //confirm pltcm_indication
  153. private void update03()
  154. {
  155. try
  156. {
  157. CoreClientParam ccp = new CoreClientParam();
  158. ccp.ServerName = "UIF.UIF04.UIF042010";
  159. ccp.MethodName = "update03";
  160. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  161. //if (ccp.ReturnCode != 0) return;
  162. this.dataSet1.Tables[0].Clear();
  163. this.dataSet2.Tables[0].Clear();
  164. }
  165. catch (Exception EX)
  166. {
  167. MessageBox.Show(EX.ToString());
  168. }
  169. }
  170. private void ultraGrid2_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  171. {
  172. this.ultraGrid2.Update();
  173. }
  174. }
  175. }