56bb6fb8ec67b4ab8057d2208f48d11017c45fba.svn-base 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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. namespace Core.LZMes.Client.UIF.UIF07
  12. {
  13. public partial class UIF071020 : FrmBase
  14. {
  15. public UIF071020()
  16. {
  17. InitializeComponent();
  18. }
  19. #region "ToolBar Event"
  20. public override void ToolBar_Click(object sender, string ToolbarKey)
  21. {
  22. switch (ToolbarKey)
  23. {
  24. case "Query":
  25. this.DoQuery();
  26. break;
  27. case "Delete":
  28. Delete();
  29. break;
  30. case "Send":
  31. Send();
  32. break;
  33. case "UnSend":
  34. UnSend();
  35. break;
  36. case "Exit":
  37. this.dataSet1.Dispose();
  38. this.dataSet2.Dispose();
  39. this.dataSet1 = null;
  40. this.dataSet2 = null;
  41. this.Close();
  42. break;
  43. }
  44. }
  45. /// <summary>
  46. /// 查询轧辊单元计划信息
  47. /// </summary>
  48. private void DoQuery()
  49. {
  50. try
  51. {
  52. this.dataSet1.Tables[0].Clear();
  53. CoreClientParam ccp = new CoreClientParam();
  54. ccp.ServerName = "UIF.UIF07.UIF071020";
  55. ccp.MethodName = "queryPkgPlan";
  56. ccp.ServerParams = new object[] { };
  57. ccp.SourceDataTable = this.dataSet1.Tables[0];
  58. CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  59. if (obj.ReturnInfo.Length == 0)
  60. {
  61. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(obj.ReturnObject as System.Collections.ArrayList, this.dataSet1.Tables["L_TBF03_SPEC_PACK"]);
  62. tab0.TableName = "L_TBF03_SPEC_PACK";
  63. this.dataSet1.Tables["L_TBF03_SPEC_PACK"].Merge(tab0);
  64. this.dataSet1.AcceptChanges();
  65. };
  66. }
  67. catch (Exception EX)
  68. {
  69. MessageBox.Show(EX.ToString());
  70. }
  71. }
  72. /// <summary>
  73. /// 删除轧辊单元计划
  74. /// </summary>
  75. private void Delete()
  76. {
  77. try
  78. {
  79. this.ugrd_CalInfo.UpdateData();
  80. System.Data.DataRow[] rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
  81. if (rows.Length == 0)
  82. {
  83. MessageBox.Show("请选择你要下发的计划", Common.FixDBManager.MsgCaption);
  84. return;
  85. }
  86. string pkgNO = rows[0]["PKG_NO"].ToString();
  87. System.Windows.Forms.DialogResult rt = MessageBox.Show("是否确认删除所选包装单元计划?", Common.FixDBManager.MsgCaption, MessageBoxButtons.YesNo);
  88. if (rt == DialogResult.No)
  89. {
  90. return;
  91. }
  92. string Ex = "";
  93. Hashtable paramHsmp = new Hashtable();
  94. paramHsmp.Add("i1", pkgNO);
  95. paramHsmp.Add("i2", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
  96. paramHsmp.Add("o3", Ex);
  97. CoreClientParam ccp = new CoreClientParam();
  98. ccp.ServerName = "UIB.COM.ComDBProcedure";
  99. ccp.MethodName = "doXmlProcedure";
  100. ccp.ServerParams = new Object[] { "UIF071020.Del_PkgUnit", paramHsmp };
  101. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  102. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  103. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  104. {
  105. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  106. }
  107. else
  108. {
  109. DoQuery();
  110. }
  111. }
  112. catch (System.Exception ex)
  113. {
  114. System.Diagnostics.Debug.WriteLine(ex.ToString());
  115. }
  116. }
  117. /// <summary>
  118. /// 轧辊单元计划指令下发(二级)
  119. /// 支持≤2调计划指令下发
  120. /// </summary>
  121. private void Send()
  122. {
  123. try
  124. {
  125. this.ugrd_CalInfo.UpdateData();
  126. System.Data.DataRow[] rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
  127. if (rows.Length == 0)
  128. {
  129. MessageBox.Show("请选择你要下发的计划", Common.FixDBManager.MsgCaption);
  130. return;
  131. }
  132. string pkgNO = rows[0]["PKG_NO"].ToString();
  133. string ex = "";
  134. #region "校验下发可行性"
  135. Hashtable paramHsmp = new Hashtable();
  136. paramHsmp.Add("i1", pkgNO);
  137. paramHsmp.Add("o2", ex);
  138. CoreClientParam ccp = new CoreClientParam();
  139. ccp.ServerName = "UIB.COM.ComDBProcedure";
  140. ccp.MethodName = "doXmlProcedure";
  141. ccp.ServerParams = new Object[] { "UIF071020.Send_PkgUnit", paramHsmp };
  142. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  143. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  144. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  145. {
  146. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  147. return;
  148. }
  149. #endregion
  150. //#region "执行下发"
  151. //paramHsmp = new Hashtable();
  152. //paramHsmp.Add("i1", RollNO);
  153. //paramHsmp.Add("o2", ex);
  154. //ccp = new CoreClientParam();
  155. //ccp.ServerName = "com.core.sip.xinyu.service.CalSendTelegramService";
  156. //ccp.MethodName = "sendPlanByPlanNo";
  157. //ccp.ServerParams = new Object[] { RollNO };
  158. //obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  159. //if (Common.FixDBManager.CheckNullInt(obj.ReturnObject)<=0)
  160. //{
  161. // MessageBox.Show("下发失败", Common.FixDBManager.MsgCaption);
  162. //}
  163. //else
  164. //{
  165. DoQuery();
  166. //}
  167. //#endregion
  168. }
  169. catch (System.Exception ex)
  170. {
  171. System.Diagnostics.Debug.WriteLine(ex.ToString());
  172. }
  173. }
  174. /// <summary>
  175. /// 对已下发(二级)的轧辊单元计划进行撤销
  176. /// </summary>
  177. private void UnSend()
  178. {
  179. try
  180. {
  181. this.ugrd_CalInfo.UpdateData();
  182. System.Data.DataRow[] rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
  183. if (rows.Length == 0)
  184. {
  185. MessageBox.Show("请选择你要下发的计划", Common.FixDBManager.MsgCaption);
  186. return;
  187. }
  188. string pkgNO = rows[0]["PKG_NO"].ToString();
  189. string ex = "";
  190. #region "校验下发可行性"
  191. Hashtable paramHsmp = new Hashtable();
  192. paramHsmp.Add("i1", pkgNO);
  193. paramHsmp.Add("i2", UserInfo.GetUserID());
  194. paramHsmp.Add("o3", ex);
  195. CoreClientParam ccp = new CoreClientParam();
  196. ccp.ServerName = "UIB.COM.ComDBProcedure";
  197. ccp.MethodName = "doXmlProcedure";
  198. ccp.ServerParams = new Object[] { "UIF071020.Usd_PkgUnit", paramHsmp };
  199. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  200. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  201. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  202. {
  203. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  204. return;
  205. }
  206. #endregion
  207. //#region "执行下发"
  208. //paramHsmp = new Hashtable();
  209. //paramHsmp.Add("i1", RollNO);
  210. //paramHsmp.Add("o2", ex);
  211. //ccp = new CoreClientParam();
  212. //ccp.ServerName = "com.core.sip.xinyu.service.CalSendTelegramService";
  213. //ccp.MethodName = "canclePlanByPlanNo";
  214. //ccp.ServerParams = new Object[] { RollNO };
  215. //obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  216. //if (Common.FixDBManager.CheckNullInt(obj.ReturnObject) <= 0)
  217. //{
  218. // MessageBox.Show("下发失败", Common.FixDBManager.MsgCaption);
  219. //}
  220. //else
  221. //{
  222. DoQuery();
  223. //}
  224. //#endregion
  225. }
  226. catch (System.Exception ex)
  227. {
  228. System.Diagnostics.Debug.WriteLine(ex.ToString());
  229. }
  230. }
  231. #endregion
  232. private void UIF071020_Load(object sender, EventArgs e)
  233. {
  234. Init_Grid();
  235. }
  236. private void Init_Grid()
  237. {
  238. try
  239. {
  240. Common.FixDBManager.SetGridCheckBox("CHK", "L_TBF03_SPEC_PACK", 0, this.ugrd_CalInfo);
  241. foreach (Infragistics.Win.UltraWinGrid.UltraGridColumn col in this.ugrd_CalInfo.DisplayLayout.Bands[0].Columns)
  242. {
  243. if (col.Key == "CHK")
  244. {
  245. Common.FixDBManager.SetCellActivation(col.Key, "L_TBF03_SPEC_PACK", this.ugrd_CalInfo, "ALLOWEDIT");
  246. }
  247. else
  248. {
  249. Common.FixDBManager.SetCellActivation(col.Key, "L_TBF03_SPEC_PACK", this.ugrd_CalInfo, "ALLOWEDIT");
  250. }
  251. }
  252. }
  253. catch (System.Exception ex)
  254. {
  255. System.Diagnostics.Debug.WriteLine(ex.ToString());
  256. }
  257. }
  258. }
  259. }