23e72db62408c558f7694ecf366554a7005689a4.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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 UIF061060 : FrmBase
  16. {
  17. public UIF061060()
  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 "unsend":
  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. dataSet2.Clear();
  71. CoreClientParam ccp = new CoreClientParam();
  72. ccp.ServerName = "UIF.UIF06.UIF061020";
  73. switch (this.tabControl1.SelectedIndex)
  74. {
  75. case 0:
  76. ccp.MethodName = "queryHotPlanCoils";
  77. ccp.SourceDataTable = dataSet1.Tables[0];
  78. break;
  79. case 1:
  80. ccp.MethodName = "querySxPlanCoils";
  81. ccp.SourceDataTable = dataSet2.Tables[0];
  82. break;
  83. default:
  84. return;
  85. }
  86. // ccp.MethodName = "queryHotPlanCoils";
  87. CoreClientParam obj = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  88. }
  89. catch (System.Exception ex)
  90. {
  91. System.Diagnostics.Debug.WriteLine(ex.ToString());
  92. }
  93. }
  94. /// <summary>
  95. /// 酸洗计划下发
  96. /// </summary>
  97. private void Send()
  98. {
  99. try
  100. {
  101. this.ultraGrid1.UpdateData();
  102. this.ultraGrid2.UpdateData();
  103. System.Data.DataRow[] rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
  104. // System.Data.DataRow[] rows1 = this.dataSet2.Tables[0].Select("CHK='TRUE'");
  105. switch (this.tabControl1.SelectedIndex)
  106. {
  107. case 0:
  108. rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
  109. break;
  110. case 1:
  111. rows = this.dataSet2.Tables[0].Select("CHK='TRUE'");
  112. break;
  113. default:
  114. return;
  115. }
  116. if (rows.Length == 0)
  117. {
  118. MessageBox.Show("请选择你要下发的计划", Common.FixDBManager.MsgCaption);
  119. return;
  120. }
  121. string coilNos = "";
  122. foreach(System.Data.DataRow row in rows)
  123. {
  124. coilNos += row["L_COIL_NO"].ToString().Trim() + ";";
  125. }
  126. if (coilNos.Equals(""))
  127. {
  128. DoQuery();
  129. return; }
  130. coilNos = coilNos.Substring(0, coilNos.Length - 1);
  131. //string ordPro = Convert.ToString(Common.FixDBManager.CheckNullStr(this.ComboOrdProc.Value));
  132. string ComboOrdProc = Convert.ToString(Convert.ToString(Common.FixDBManager.CheckNullStr(Common.FixDBManager.splitArray(this.ComboOrdProc.Value, ','))));
  133. string ex = "";
  134. #region "校验下发可行性"
  135. Hashtable paramHsmp = new Hashtable();
  136. paramHsmp.Add("i1", coilNos);
  137. paramHsmp.Add("i2",rows.Length);
  138. paramHsmp.Add("i3", ComboOrdProc);
  139. paramHsmp.Add("o4", ex);
  140. CoreClientParam ccp = new CoreClientParam();
  141. ccp.ServerName = "UIB.COM.ComDBProcedure";
  142. ccp.MethodName = "doXmlProcedure";
  143. ccp.ServerParams = new Object[] { "UIF061020.Send_HotPan", paramHsmp };
  144. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  145. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  146. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  147. {
  148. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  149. return;
  150. }
  151. #endregion
  152. #region "执行下发"
  153. //paramHsmp = new Hashtable();
  154. //paramHsmp.Add("i1", RollNO);
  155. //paramHsmp.Add("o2", ex);
  156. //ccp = new CoreClientParam();
  157. //ccp.ServerName = "com.core.sip.xinyu.service.CalSendTelegramService";
  158. //ccp.MethodName = "sendPlanByPlanNo";
  159. //ccp.ServerParams = new Object[] { RollNO };
  160. //obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  161. //if (Common.FixDBManager.CheckNullInt(obj.ReturnObject) <= 0)
  162. //{
  163. // MessageBox.Show("下发失败", Common.FixDBManager.MsgCaption);
  164. //}
  165. //else
  166. //{
  167. // DoQuery();
  168. //}
  169. DoQuery();
  170. #endregion
  171. }
  172. catch (System.Exception ex)
  173. {
  174. System.Diagnostics.Debug.WriteLine(ex.ToString());
  175. }
  176. }
  177. /// <summary>
  178. /// 对已下发(二级)的重卷计划进行撤销
  179. /// </summary>
  180. private void UnSend()
  181. {
  182. try
  183. {
  184. this.ultraGrid1.UpdateData();
  185. System.Data.DataRow[] rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
  186. if (rows.Length == 0)
  187. {
  188. MessageBox.Show("请选择你要取消下发的计划", Common.FixDBManager.MsgCaption);
  189. return;
  190. }
  191. string coilNos = "";
  192. foreach (System.Data.DataRow row in rows)
  193. {
  194. coilNos += row["L_COIL_NO"].ToString().Trim() + ";";
  195. }
  196. coilNos = coilNos.Substring(0, coilNos.Length - 1);
  197. string ex = "";
  198. #region "校验下发可行性"
  199. Hashtable paramHsmp = new Hashtable();
  200. paramHsmp.Add("i1", coilNos);
  201. paramHsmp.Add("i2", rows.Length);
  202. paramHsmp.Add("i3", UserInfo.GetUserID());
  203. paramHsmp.Add("o4", ex);
  204. CoreClientParam ccp = new CoreClientParam();
  205. ccp.ServerName = "UIB.COM.ComDBProcedure";
  206. ccp.MethodName = "doXmlProcedure";
  207. ccp.ServerParams = new Object[] { "UIF061020.Usd_pltcmReelPlan", paramHsmp };
  208. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  209. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  210. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  211. {
  212. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  213. return;
  214. }
  215. #endregion
  216. #region "执行下发"
  217. //paramHsmp = new Hashtable();
  218. //paramHsmp.Add("i1", RollNO);
  219. //paramHsmp.Add("o2", ex);
  220. //ccp = new CoreClientParam();
  221. //ccp.ServerName = "com.core.sip.xinyu.service.CalSendTelegramService";
  222. //ccp.MethodName = "canclePlanByPlanNo";
  223. //ccp.ServerParams = new Object[] { RollNO };
  224. //obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  225. //if (Common.FixDBManager.CheckNullInt(obj.ReturnObject) <= 0)
  226. //{
  227. // MessageBox.Show("下发失败", Common.FixDBManager.MsgCaption);
  228. //}
  229. //else
  230. //{
  231. // DoQuery();
  232. //}
  233. DoQuery();
  234. #endregion
  235. }
  236. catch (System.Exception ex)
  237. {
  238. System.Diagnostics.Debug.WriteLine(ex.ToString());
  239. }
  240. }
  241. private void UIF061020_Load(object sender, EventArgs e)
  242. {
  243. init();
  244. }
  245. private void ComboOrdProc_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
  246. {
  247. UltraGridColumn checkColumn = this.ComboOrdProc.DisplayLayout.Bands[0].Columns.Add("Selected");
  248. checkColumn.DataType = typeof(bool);
  249. // Show the checkbox column at the beginning
  250. checkColumn.Header.VisiblePosition = 0;
  251. //--
  252. this.ComboOrdProc.CheckedListSettings.EditorValueSource = Infragistics.Win.EditorWithComboValueSource.CheckedItems;
  253. // Hook this column up to the CheckedListSettings
  254. this.ComboOrdProc.CheckedListSettings.CheckStateMember = checkColumn.Key;
  255. // Ensure that the ValueMember is set to our other field
  256. this.ComboOrdProc.ValueMember = "LABEL";
  257. }
  258. }
  259. }