UIF061090.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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 UIF061090 : FrmBase
  14. {
  15. public UIF061090()
  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 "Save":
  28. this.Save();
  29. break;
  30. case "Delete":
  31. Delete();
  32. break;
  33. case "Send":
  34. Send();
  35. break;
  36. case "UnSend":
  37. UnSend();
  38. break;
  39. case "Exit":
  40. this.Close();
  41. break;
  42. }
  43. }
  44. /// <summary>
  45. /// 查询轧辊单元计划信息
  46. /// </summary>
  47. private void DoQuery()
  48. {
  49. try
  50. {
  51. this.dataSet1.Tables[0].Clear();
  52. CoreClientParam ccp = new CoreClientParam();
  53. ccp.ServerName = "UIF.UIF06.UIF061090";
  54. ccp.MethodName = "QueryRollPlan";
  55. ccp.ServerParams = new object[] { };
  56. ccp.SourceDataTable = this.dataSet1.Tables[0];
  57. CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  58. if (obj.ReturnInfo.Length == 0)
  59. {
  60. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(obj.ReturnObject as System.Collections.ArrayList, this.dataSet1.Tables["C_TBF03_SPEC_ROLL"]);
  61. tab0.TableName = "C_TBF03_SPEC_ROLL";
  62. this.dataSet1.Tables["C_TBF03_SPEC_ROLL"].Merge(tab0);
  63. this.dataSet1.AcceptChanges();
  64. };
  65. }
  66. catch (Exception EX)
  67. {
  68. MessageBox.Show(EX.ToString());
  69. }
  70. }
  71. /// <summary>
  72. /// 保存轧辊单元计划的顺序调整
  73. /// </summary>
  74. private void Save()
  75. {
  76. try
  77. {
  78. string rollNO = Convert.ToString(Common.FixDBManager.CheckNullStr(this.textTarget.Text));
  79. string pos = Convert.ToString(Common.FixDBManager.CheckNullStr(this.comboPosition.Value));
  80. string type = Convert.ToString(Common.FixDBManager.CheckNullStr(this.optionBF.Value));
  81. if (rollNO == "" || pos == "" || type == "")
  82. {
  83. MessageBox.Show(" 条件不能为空! ");
  84. }
  85. string ex = "";
  86. Hashtable paramHsmp = new Hashtable();
  87. paramHsmp.Add("i1", rollNO);
  88. paramHsmp.Add("i2", pos);
  89. paramHsmp.Add("i3", type);
  90. paramHsmp.Add("o4", ex);
  91. CoreClientParam ccp = new CoreClientParam();
  92. ccp.ServerName = "UIB.COM.ComDBProcedure";
  93. ccp.MethodName = "doXmlProcedure";
  94. ccp.ServerParams = new Object[] { "UIF061090.Adj_RollUnit", paramHsmp };
  95. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  96. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  97. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  98. {
  99. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  100. }
  101. else
  102. {
  103. DoQuery();
  104. }
  105. }
  106. catch (Exception EX)
  107. {
  108. MessageBox.Show(EX.ToString());
  109. }
  110. }
  111. /// <summary>
  112. /// 删除轧辊单元计划
  113. /// </summary>
  114. private void Delete()
  115. {
  116. try
  117. {
  118. this.ugrd_RollInfo.UpdateData();
  119. System.Data.DataRow[] rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
  120. if (rows.Length == 0)
  121. {
  122. MessageBox.Show("请选择你要下发的计划", Common.FixDBManager.MsgCaption);
  123. return;
  124. }
  125. string RollNO = rows[0]["ROLL_MANA_NO"].ToString();
  126. System.Windows.Forms.DialogResult rt = MessageBox.Show("是否确认删除所选轧制单元计划?", Common.FixDBManager.MsgCaption, MessageBoxButtons.YesNo);
  127. if (rt == DialogResult.No)
  128. {
  129. return;
  130. }
  131. string Ex = "";
  132. Hashtable paramHsmp = new Hashtable();
  133. paramHsmp.Add("i1", RollNO);
  134. paramHsmp.Add("i2", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
  135. paramHsmp.Add("o3", Ex);
  136. CoreClientParam ccp = new CoreClientParam();
  137. ccp.ServerName = "UIB.COM.ComDBProcedure";
  138. ccp.MethodName = "doXmlProcedure";
  139. ccp.ServerParams = new Object[] { "UIF061090.Del_RollUnit", paramHsmp };
  140. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  141. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  142. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  143. {
  144. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  145. }
  146. else
  147. {
  148. DoQuery();
  149. }
  150. }
  151. catch (System.Exception ex)
  152. {
  153. System.Diagnostics.Debug.WriteLine(ex.ToString());
  154. }
  155. }
  156. /// <summary>
  157. /// 轧辊单元计划指令下发(二级)
  158. /// 支持≤2调计划指令下发
  159. /// </summary>
  160. private void Send()
  161. {
  162. try
  163. {
  164. this.ugrd_RollInfo.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 RollNO = rows[0]["ROLL_MANA_NO"].ToString();
  172. string ex = "";
  173. Hashtable paramHsmp = new Hashtable();
  174. paramHsmp.Add("i1", RollNO);
  175. paramHsmp.Add("o2", ex);
  176. CoreClientParam ccp = new CoreClientParam();
  177. ccp.ServerName = "UIB.COM.ComDBProcedure";
  178. ccp.MethodName = "doXmlProcedure";
  179. ccp.ServerParams = new Object[] { "UIF061090.Sed_RollUnit", paramHsmp };
  180. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  181. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  182. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  183. {
  184. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  185. }
  186. else
  187. {
  188. DoQuery();
  189. }
  190. }
  191. catch (System.Exception ex)
  192. {
  193. System.Diagnostics.Debug.WriteLine(ex.ToString());
  194. }
  195. }
  196. /// <summary>
  197. /// 对已下发(二级)的轧辊单元计划进行撤销
  198. /// </summary>
  199. private void UnSend()
  200. {
  201. try
  202. {
  203. this.ugrd_RollInfo.UpdateData();
  204. System.Data.DataRow[] rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
  205. if (rows.Length == 0)
  206. {
  207. MessageBox.Show("请选择你要下发的计划", Common.FixDBManager.MsgCaption);
  208. return;
  209. }
  210. string RollNO = rows[0]["ROLL_MANA_NO"].ToString();
  211. string ex = "";
  212. Hashtable paramHsmp = new Hashtable();
  213. paramHsmp.Add("i1", RollNO);
  214. paramHsmp.Add("i2", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
  215. paramHsmp.Add("o3", ex);
  216. CoreClientParam ccp = new CoreClientParam();
  217. ccp.ServerName = "UIB.COM.ComDBProcedure";
  218. ccp.MethodName = "doXmlProcedure";
  219. ccp.ServerParams = new Object[] { "UIF061090.Usd_RollUnit", paramHsmp };
  220. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  221. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  222. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  223. {
  224. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  225. }
  226. else
  227. {
  228. DoQuery();
  229. }
  230. }
  231. catch (System.Exception ex)
  232. {
  233. System.Diagnostics.Debug.WriteLine(ex.ToString());
  234. }
  235. }
  236. #endregion
  237. #region "Init"
  238. private void UIF061090_Load(object sender, EventArgs e)
  239. {
  240. try
  241. {
  242. GetInitData();
  243. Init_Grid();
  244. Common.FixDBManager.Init_ComboControl(this.comboPosition, "SCM_BASE_INFO", "NAME_", "ID_", ref dataSet2);
  245. }
  246. catch (System.Exception ex)
  247. {
  248. System.Diagnostics.Debug.WriteLine(ex.ToString());
  249. }
  250. }
  251. private void GetInitData()
  252. {
  253. try
  254. {
  255. this.dataSet2.Tables[0].Clear();
  256. CoreClientParam ccp = new CoreClientParam();
  257. ccp.ServerName = "UIF.UIF06.UIF061090";
  258. ccp.MethodName = "queryInitdata";
  259. ccp.ServerParams = new object[] { };
  260. ccp.SourceDataTable = this.dataSet2.Tables[0];
  261. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  262. dataSet2.Tables[0].TableName = "SCM_BASE_INFO";
  263. }
  264. catch (System.Exception ex)
  265. {
  266. System.Diagnostics.Debug.WriteLine(ex.ToString());
  267. }
  268. }
  269. private void Init_Grid()
  270. {
  271. try
  272. {
  273. Common.FixDBManager.SetGridCheckBox("CHK", "C_TBF03_SPEC_ROLL", 0, this.ugrd_RollInfo);
  274. foreach (Infragistics.Win.UltraWinGrid.UltraGridColumn col in this.ugrd_RollInfo.DisplayLayout.Bands[0].Columns)
  275. {
  276. if (col.Key == "CHK")
  277. {
  278. Common.FixDBManager.SetCellActivation(col.Key, "C_TBF03_SPEC_ROLL", this.ugrd_RollInfo, "ALLOWEDIT");
  279. }
  280. else
  281. {
  282. Common.FixDBManager.SetCellActivation(col.Key, "C_TBF03_SPEC_ROLL", this.ugrd_RollInfo, "ALLOWEDIT");
  283. }
  284. }
  285. }
  286. catch (System.Exception ex)
  287. {
  288. System.Diagnostics.Debug.WriteLine(ex.ToString());
  289. }
  290. }
  291. #endregion
  292. #region "Grid Event"
  293. private void ugrd_RollInfo_AfterRowActivate(object sender, EventArgs e)
  294. {
  295. try
  296. {
  297. this.textTarget.Text = Convert.ToString(this.ugrd_RollInfo.ActiveRow.Cells["ROLL_MANA_NO"].Value);
  298. }
  299. catch (System.Exception ex)
  300. {
  301. System.Diagnostics.Debug.WriteLine(ex.ToString());
  302. }
  303. }
  304. private void ugrd_RollInfo_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  305. {
  306. try
  307. {
  308. this.ugrd_RollInfo.UpdateData();
  309. if (e.Cell.Column.Key == "CHK")
  310. {
  311. if (e.Cell.Value.ToString().ToUpper() == "TRUE")
  312. {
  313. string RollNO = e.Cell.Row.Cells["ROLL_MANA_NO"].Value.ToString();
  314. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_RollInfo.Rows)
  315. {
  316. if (row.Cells["ROLL_MANA_NO"].Value.ToString() != RollNO)
  317. {
  318. row.Cells["CHK"].Value = "FALSE";
  319. }
  320. }
  321. this.ugrd_RollInfo.UpdateData();
  322. }
  323. }
  324. }
  325. catch (System.Exception ex)
  326. {
  327. System.Diagnostics.Debug.WriteLine(ex.ToString());
  328. }
  329. }
  330. #endregion
  331. }
  332. }