UIF061020.cs 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using CoreFS.CA06;
  11. using Common;
  12. using Infragistics.Win.UltraWinGrid;
  13. namespace Core.LZMes.Client.UIF.UIF06
  14. {
  15. public partial class UIF061020 : FrmBase
  16. {
  17. public UIF061020()
  18. {
  19. InitializeComponent();
  20. }
  21. public override void ToolBar_Click(object sender, string ToolbarKey)
  22. {
  23. try
  24. {
  25. switch (ToolbarKey)
  26. {
  27. case "Query":
  28. DoQuery();
  29. break;
  30. case "Send":
  31. Send();
  32. break;
  33. case "Cancel":
  34. UnSend();
  35. break;
  36. case "Save":
  37. break;
  38. case "Exit":
  39. this.dataSet1.Dispose();
  40. this.dataSet1 = null;
  41. this.Close();
  42. break;
  43. }
  44. }
  45. catch (System.Exception ex)
  46. {
  47. System.Diagnostics.Debug.WriteLine(ex.ToString());
  48. }
  49. }
  50. private void init()
  51. {
  52. string commCodeCd = "F02004";
  53. DataTable dt = new DataTable();
  54. CoreClientParam ccp = new CoreClientParam();
  55. ccp.ServerName = "UIB.COM.ComDBQuery";
  56. ccp.MethodName = "doSimpleQuery";
  57. ArrayList paramArray = new ArrayList();
  58. paramArray.Add("UIECOMM00_SELECT.COMM_CODE");
  59. paramArray.Add(commCodeCd);
  60. ccp.ServerParams = new object[] { paramArray };
  61. ccp.SourceDataTable = dt;
  62. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  63. Core.LZMes.Client.UIE.UIE041.UIEBase.Init_ComboControl(this.ComboOrdProc, ref dt, "F02004");
  64. }
  65. private void DoQuery()
  66. {
  67. try
  68. {
  69. dataSet1.Clear();
  70. CoreClientParam ccp = new CoreClientParam();
  71. ccp.ServerName = "UIF.UIF06.UIF061020";
  72. ccp.MethodName = "queryReelPlanCoils";
  73. ccp.SourceDataTable = dataSet1.Tables[0];
  74. CoreClientParam obj = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  75. }
  76. catch (System.Exception ex)
  77. {
  78. System.Diagnostics.Debug.WriteLine(ex.ToString());
  79. }
  80. }
  81. /// <summary>
  82. /// 重卷计划下发
  83. /// </summary>
  84. private void Send()
  85. {
  86. try
  87. {
  88. this.ultraGrid1.UpdateData();
  89. System.Data.DataRow[] rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
  90. if (rows.Length == 0)
  91. {
  92. MessageBox.Show("请选择你要下发的计划", Common.FixDBManager.MsgCaption);
  93. return;
  94. }
  95. string coilNos = "";
  96. foreach(System.Data.DataRow row in rows)
  97. {
  98. //if (row["PACKAGE_LEVEL"].ToString().Trim().Equals("2") ||
  99. // row["PACKAGE_LEVEL"].ToString().Trim().Equals("3") ||
  100. // row["PACKAGE_LEVEL"].ToString().Trim().Equals("4")) {
  101. // MessageBox.Show(row["L_COIL_NO"].ToString().Trim()+"下发计划失败,请取消包装操作!", Common.FixDBManager.MsgCaption);
  102. // continue;
  103. //}
  104. coilNos += row["L_COIL_NO"].ToString().Trim() + ";";
  105. }
  106. if (coilNos.Equals(""))
  107. {
  108. DoQuery();
  109. return; }
  110. coilNos = coilNos.Substring(0, coilNos.Length - 1);
  111. //string ordPro = Convert.ToString(Common.FixDBManager.CheckNullStr(this.ComboOrdProc.Value));
  112. string ComboOrdProc = Convert.ToString(Convert.ToString(Common.FixDBManager.CheckNullStr(Common.FixDBManager.splitArray(this.ComboOrdProc.Value, ','))));
  113. string ex = "";
  114. #region "校验下发可行性"
  115. Hashtable paramHsmp = new Hashtable();
  116. paramHsmp.Add("i1", coilNos);
  117. paramHsmp.Add("i2",rows.Length);
  118. paramHsmp.Add("i3", ComboOrdProc);
  119. paramHsmp.Add("o4", ex);
  120. CoreClientParam ccp = new CoreClientParam();
  121. ccp.ServerName = "UIB.COM.ComDBProcedure";
  122. ccp.MethodName = "doXmlProcedure";
  123. ccp.ServerParams = new Object[] { "UIF061020.Send_ReelPan", paramHsmp };
  124. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  125. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  126. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  127. {
  128. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  129. return;
  130. }
  131. #endregion
  132. #region "执行下发"
  133. //paramHsmp = new Hashtable();
  134. //paramHsmp.Add("i1", RollNO);
  135. //paramHsmp.Add("o2", ex);
  136. //ccp = new CoreClientParam();
  137. //ccp.ServerName = "com.core.sip.xinyu.service.CalSendTelegramService";
  138. //ccp.MethodName = "sendPlanByPlanNo";
  139. //ccp.ServerParams = new Object[] { RollNO };
  140. //obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  141. //if (Common.FixDBManager.CheckNullInt(obj.ReturnObject) <= 0)
  142. //{
  143. // MessageBox.Show("下发失败", Common.FixDBManager.MsgCaption);
  144. //}
  145. //else
  146. //{
  147. // DoQuery();
  148. //}
  149. DoQuery();
  150. #endregion
  151. }
  152. catch (System.Exception ex)
  153. {
  154. System.Diagnostics.Debug.WriteLine(ex.ToString());
  155. }
  156. }
  157. /// <summary>
  158. /// 对已下发(二级)的重卷计划进行撤销
  159. /// </summary>
  160. private void UnSend()
  161. {
  162. try
  163. {
  164. this.ultraGrid1.UpdateData();
  165. System.Data.DataRow[] rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
  166. if (rows.Length == 0)
  167. {
  168. MessageBox.Show("请选择你要取消下发的计划", Common.FixDBManager.MsgCaption);
  169. return;
  170. }
  171. string coilNos = "";
  172. foreach (System.Data.DataRow row in rows)
  173. {
  174. coilNos += row["L_COIL_NO"].ToString().Trim() + ";";
  175. }
  176. coilNos = coilNos.Substring(0, coilNos.Length - 1);
  177. string ex = "";
  178. #region "校验下发可行性"
  179. Hashtable paramHsmp = new Hashtable();
  180. paramHsmp.Add("i1", coilNos);
  181. paramHsmp.Add("i2", rows.Length);
  182. paramHsmp.Add("i3", UserInfo.GetUserID());
  183. paramHsmp.Add("o4", ex);
  184. CoreClientParam ccp = new CoreClientParam();
  185. ccp.ServerName = "UIB.COM.ComDBProcedure";
  186. ccp.MethodName = "doXmlProcedure";
  187. ccp.ServerParams = new Object[] { "UIF061020.Usd_ReelPlan", paramHsmp };
  188. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  189. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  190. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  191. {
  192. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  193. return;
  194. }
  195. #endregion
  196. #region "执行下发"
  197. //paramHsmp = new Hashtable();
  198. //paramHsmp.Add("i1", RollNO);
  199. //paramHsmp.Add("o2", ex);
  200. //ccp = new CoreClientParam();
  201. //ccp.ServerName = "com.core.sip.xinyu.service.CalSendTelegramService";
  202. //ccp.MethodName = "canclePlanByPlanNo";
  203. //ccp.ServerParams = new Object[] { RollNO };
  204. //obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  205. //if (Common.FixDBManager.CheckNullInt(obj.ReturnObject) <= 0)
  206. //{
  207. // MessageBox.Show("下发失败", Common.FixDBManager.MsgCaption);
  208. //}
  209. //else
  210. //{
  211. // DoQuery();
  212. //}
  213. DoQuery();
  214. #endregion
  215. }
  216. catch (System.Exception ex)
  217. {
  218. System.Diagnostics.Debug.WriteLine(ex.ToString());
  219. }
  220. }
  221. private void UIF061020_Load(object sender, EventArgs e)
  222. {
  223. init();
  224. }
  225. private void ComboOrdProc_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
  226. {
  227. UltraGridColumn checkColumn = this.ComboOrdProc.DisplayLayout.Bands[0].Columns.Add("Selected");
  228. checkColumn.DataType = typeof(bool);
  229. // Show the checkbox column at the beginning
  230. checkColumn.Header.VisiblePosition = 0;
  231. //--
  232. this.ComboOrdProc.CheckedListSettings.EditorValueSource = Infragistics.Win.EditorWithComboValueSource.CheckedItems;
  233. // Hook this column up to the CheckedListSettings
  234. this.ComboOrdProc.CheckedListSettings.CheckStateMember = checkColumn.Key;
  235. // Ensure that the ValueMember is set to our other field
  236. this.ComboOrdProc.ValueMember = "LABEL";
  237. }
  238. }
  239. }