8c0d5a3ad2edabb25618e7525e37609095de933d.svn-base 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  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. namespace Core.LZMes.Client.UIF.UIF06
  13. {
  14. public partial class UIF061050 : FrmBase
  15. {
  16. public UIF061050()
  17. {
  18. InitializeComponent();
  19. }
  20. private void UIF061050_Load(object sender, EventArgs e)
  21. {
  22. try
  23. {
  24. Get_BaseData();
  25. Get_ReelPlan_Info();
  26. Get_ReelPlan_List();
  27. this.Cmb_PM.DisplayLayout.Bands[0].Columns["FLAG"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  28. this.Cmb_BM.DisplayLayout.Bands[0].Columns["FLAG"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  29. Common.FixDBManager.SetGridCheckBox("FLAG", "TAB_CCOILLIST", 25, this.ugrd_CoilList);
  30. string ColumnName = "";
  31. for (int i = 0; i < this.ugrd_CoilList.DisplayLayout.Bands[0].Columns.Count; i++)
  32. {
  33. ColumnName = this.ugrd_CoilList.DisplayLayout.Bands[0].Columns[i].Key;
  34. if (ColumnName == "FLAG")
  35. {
  36. Common.FixDBManager.SetCellActivation(ColumnName, "TAB_CCOILLIST", this.ugrd_CoilList, "ALLOWEDIT");
  37. }
  38. else
  39. {
  40. Common.FixDBManager.SetCellActivation(ColumnName, "TAB_CCOILLIST", this.ugrd_CoilList, "ACTIVATEONLY");
  41. }
  42. }
  43. this.ugrd_CalList.DisplayLayout.Override.SupportDataErrorInfo = Infragistics.Win.UltraWinGrid.SupportDataErrorInfo.RowsAndCells;
  44. }
  45. catch (System.Exception ex)
  46. {
  47. System.Diagnostics.Debug.WriteLine(ex.ToString());
  48. }
  49. }
  50. private void Get_BaseData()
  51. {
  52. try
  53. {
  54. CoreClientParam ccp = new CoreClientParam();
  55. ccp.ServerName = "UIF.UIF06.UIF061050";
  56. ccp.MethodName = "queryBaseData";
  57. CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  58. if (obj.ReturnInfo.Length == 0)
  59. {
  60. System.Collections.ArrayList rtnobj = obj.ReturnObject as System.Collections.ArrayList;
  61. if (rtnobj[0] != null)
  62. {
  63. this.dataSet1.Tables["TAB_PM"].Clear();
  64. System.Data.DataTable tab0 = FixDBManager.ConvertToDataTable(rtnobj[0] as System.Collections.ArrayList, this.dataSet1.Tables["TAB_PM"]);
  65. tab0.TableName = "TAB_PM";
  66. this.dataSet1.Tables["TAB_PM"].Merge(tab0);
  67. }
  68. if (rtnobj[1] != null)
  69. {
  70. this.dataSet1.Tables["TAB_BM"].Clear();
  71. System.Data.DataTable tab1 = FixDBManager.ConvertToDataTable(rtnobj[1] as System.Collections.ArrayList, this.dataSet1.Tables["TAB_BM"]);
  72. tab1.TableName = "TAB_BM";
  73. this.dataSet1.Tables["TAB_BM"].Merge(tab1);
  74. }
  75. if (rtnobj[2] != null)
  76. {
  77. this.dataSet1.Tables["TAB_SLEEVE"].Clear();
  78. System.Data.DataTable tab1 = FixDBManager.ConvertToDataTable(rtnobj[2] as System.Collections.ArrayList, this.dataSet1.Tables["TAB_SLEEVE"]);
  79. tab1.TableName = "TAB_SLEEVE";
  80. this.dataSet1.Tables["TAB_SLEEVE"].Merge(tab1);
  81. }
  82. if (rtnobj[3] != null)
  83. {
  84. this.dataSet1.Tables["SPM_MODE"].Clear();
  85. System.Data.DataTable tab1 = FixDBManager.ConvertToDataTable(rtnobj[3] as System.Collections.ArrayList, this.dataSet1.Tables["SPM_MODE"]);
  86. tab1.TableName = "SPM_MODE";
  87. this.dataSet1.Tables["SPM_MODE"].Merge(tab1);
  88. }
  89. if (rtnobj[4] != null)
  90. {
  91. this.dataSet1.Tables["SPM_WET_SYSTEM"].Clear();
  92. System.Data.DataTable tab1 = FixDBManager.ConvertToDataTable(rtnobj[4] as System.Collections.ArrayList, this.dataSet1.Tables["SPM_WET_SYSTEM"]);
  93. tab1.TableName = "SPM_WET_SYSTEM";
  94. this.dataSet1.Tables["SPM_WET_SYSTEM"].Merge(tab1);
  95. }
  96. }
  97. this.dataSet1.Tables["TAB_PULL"].Rows.Add(new string[] { "0", "否" });
  98. this.dataSet1.Tables["TAB_PULL"].Rows.Add(new string[] { "1", "是" });
  99. this.dataSet1.Tables["TAB_PULL"].AcceptChanges();
  100. }
  101. catch (System.Exception ex)
  102. {
  103. System.Diagnostics.Debug.WriteLine(ex.ToString());
  104. }
  105. }
  106. private void Get_ReelPlan_Info()
  107. {
  108. try
  109. {
  110. CoreClientParam ccp = new CoreClientParam();
  111. ccp.ServerName = "UIF.UIF06.UIF061050";
  112. ccp.MethodName = "queryReelData";
  113. CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  114. if (obj.ReturnInfo.Length == 0)
  115. {
  116. this.dataSet1.Tables["TAB_CALINFO"].Clear();
  117. System.Data.DataTable tab0 = FixDBManager.ConvertToDataTable(obj.ReturnObject as System.Collections.ArrayList, this.dataSet1.Tables["TAB_CALINFO"]);
  118. tab0.TableName = "TAB_CALINFO";
  119. this.dataSet1.Tables["TAB_CALINFO"].Merge(tab0);
  120. this.dataSet1.AcceptChanges();
  121. }
  122. }
  123. catch (System.Exception ex)
  124. {
  125. System.Diagnostics.Debug.WriteLine(ex.ToString());
  126. }
  127. }
  128. private void Get_ReelPlan_List()//查询计划缓存表
  129. {
  130. try
  131. {
  132. CoreClientParam ccp = new CoreClientParam();
  133. ccp.ServerName = "UIF.UIF06.UIF061050";
  134. ccp.MethodName = "queryHotList";
  135. CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  136. if (obj.ReturnInfo.Length == 0)
  137. {
  138. this.dataSet1.Tables["TAB_CALLIST"].Clear();
  139. System.Data.DataTable tab0 = FixDBManager.ConvertToDataTable(obj.ReturnObject as System.Collections.ArrayList, this.dataSet1.Tables["TAB_CALLIST"]);
  140. tab0.TableName = "TAB_CALLIST";
  141. this.dataSet1.Tables["TAB_CALLIST"].Merge(tab0);
  142. this.dataSet1.AcceptChanges();
  143. }
  144. }
  145. catch (System.Exception ex)
  146. {
  147. System.Diagnostics.Debug.WriteLine(ex.ToString());
  148. }
  149. }
  150. public override void ToolBar_Click(object sender, string ToolbarKey)
  151. {
  152. try
  153. {
  154. switch (ToolbarKey)
  155. {
  156. case "Query":
  157. this.dataSet1.Tables["TAB_CCOILLIST"].Clear();
  158. Query("");
  159. Get_ReelPlan_List();
  160. Get_ReelPlan_Info();
  161. break;
  162. case "Add":
  163. Add();
  164. break;
  165. case "Delete":
  166. Delete();
  167. break;
  168. case "Save":
  169. Save();
  170. break;
  171. case "Merge":
  172. Merge();
  173. break;
  174. case "Up":
  175. Up();
  176. break;
  177. case "Down":
  178. Down();
  179. break;
  180. case "CMerge":
  181. CMerge();
  182. break;
  183. case "Exit":
  184. this.dataSet1.Dispose();
  185. this.dataSet1 = null;
  186. this.Close();
  187. break;
  188. }
  189. }
  190. catch (System.Exception ex)
  191. {
  192. System.Diagnostics.Debug.WriteLine(ex.ToString());
  193. }
  194. }
  195. private void Query(string where)//查询原料表(可编制原料信息)
  196. {
  197. try
  198. {
  199. string Condition = GetCondition(where);
  200. CoreClientParam ccp = new CoreClientParam();
  201. ccp.ServerName = "UIF.UIF06.UIF061050";
  202. ccp.MethodName = "queryHotCoil";
  203. ccp.ServerParams = new object[] { Condition };
  204. CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  205. if (obj.ReturnInfo.Length == 0)
  206. {
  207. System.Data.DataTable tab0 = FixDBManager.ConvertToDataTable(obj.ReturnObject as System.Collections.ArrayList, this.dataSet1.Tables["TAB_CCOILLIST"]);
  208. tab0.TableName = "TAB_CCOILLIST";
  209. this.dataSet1.Tables["TAB_CCOILLIST"].Merge(tab0);
  210. this.dataSet1.AcceptChanges();
  211. }
  212. }
  213. catch (System.Exception ex)
  214. {
  215. System.Diagnostics.Debug.WriteLine(ex.ToString());
  216. }
  217. }
  218. private void Add()
  219. {
  220. try
  221. {
  222. this.ugrd_CoilList.UpdateData();
  223. System.Data.DataRow[] rows = this.dataSet1.Tables["TAB_CCOILLIST"].Select("FLAG='TRUE'");
  224. if (rows.Length == 0)
  225. {
  226. MessageBox.Show("您还未选择酸轧卷,请选择");
  227. return;
  228. }
  229. string CoilNOS = "";
  230. string ex = "";
  231. for (int i = 0; i < this.ugrd_CoilList.Rows.Count; i++)
  232. {
  233. if (Common.FixDBManager.CheckNullStr(ugrd_CoilList.Rows[i].Cells["FLAG"].Value).ToUpper() == "TRUE")
  234. {
  235. CoilNOS = CoilNOS + ugrd_CoilList.Rows[i].Cells["COIL_NO"].Value.ToString() + ";";
  236. }
  237. }
  238. CoilNOS = CoilNOS.Substring(0, CoilNOS.Length - 1);
  239. string paras = "";
  240. if (Common.FixDBManager.CheckNullStr(this.Cmb_Sleeve.Value).Length > 0)
  241. paras = Common.FixDBManager.CheckNullStr(this.Cmb_Sleeve.Value);
  242. paras += ";";
  243. if (Common.FixDBManager.CheckNullStr(this.Cmb_Pull.Value).Length > 0)
  244. paras += Common.FixDBManager.CheckNullStr(this.Cmb_Pull.Value);
  245. paras += ";";
  246. paras += this.txt_CALMemo.Text;
  247. string paran = "1";
  248. Hashtable paramHsmp = new Hashtable();
  249. paramHsmp.Add("i1", CoilNOS);
  250. paramHsmp.Add("i2", rows.Length.ToString());
  251. paramHsmp.Add("i3", paran);
  252. paramHsmp.Add("o4", ex);
  253. CoreClientParam ccp = new CoreClientParam();
  254. ccp.ServerName = "UIB.COM.ComDBProcedure";
  255. ccp.MethodName = "doXmlProcedure";
  256. ccp.ServerParams = new Object[] { "UIF061050.Add_HotPlan", paramHsmp };
  257. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  258. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  259. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  260. {
  261. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  262. }
  263. else
  264. {
  265. this.dataSet1.Tables["TAB_CCOILLIST"].Clear();
  266. Query("");
  267. Get_ReelPlan_List();
  268. Get_ReelPlan_Info();
  269. }
  270. }
  271. catch (System.Exception ex)
  272. {
  273. System.Diagnostics.Debug.WriteLine(ex.ToString());
  274. }
  275. }
  276. private void Delete()
  277. {
  278. try
  279. {
  280. if (this.ugrd_CalList.Selected.Rows.Count == 0)
  281. {
  282. MessageBox.Show("请选择您要移除的记录");
  283. return;
  284. }
  285. string RollNO = this.ugrd_CalList.Rows[0].Cells["CAL_NO"].Value.ToString();
  286. string CoilNOS = "";
  287. string Condition = "";
  288. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_CalList.Selected.Rows)
  289. {
  290. CoilNOS = CoilNOS + Common.FixDBManager.CheckNullStr(row.Cells["C_COIL_NO"].Value) + ";";
  291. Condition = Condition + "'" + Common.FixDBManager.CheckNullStr(row.Cells["C_COIL_NO"].Value) + "',";
  292. }
  293. CoilNOS = CoilNOS.Substring(0, CoilNOS.Length - 1);
  294. Condition = Condition.Substring(0, Condition.Length - 1);
  295. Condition = " AND A.COIL_NO IN(" + Condition + ") ";
  296. Hashtable paramHsmp = new Hashtable();
  297. paramHsmp.Add("i1", RollNO);
  298. paramHsmp.Add("i2", CoilNOS);
  299. paramHsmp.Add("i3", this.ugrd_CalList.Selected.Rows.Count.ToString());
  300. CoreClientParam ccp = new CoreClientParam();
  301. ccp.ServerName = "UIB.COM.ComDBProcedure";
  302. ccp.MethodName = "doXmlProcedure";
  303. ccp.ServerParams = new Object[] { "UIF061050.Del_HotPlan", paramHsmp };
  304. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  305. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  306. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  307. {
  308. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  309. }
  310. else
  311. {
  312. this.dataSet1.Tables["TAB_CCOILLIST"].Clear();
  313. Get_ReelPlan_Info();
  314. Get_ReelPlan_List();
  315. Query("");
  316. }
  317. }
  318. catch (System.Exception ex)
  319. {
  320. System.Diagnostics.Debug.WriteLine(ex.ToString());
  321. }
  322. }
  323. private void Up()
  324. {
  325. try
  326. {
  327. if (this.ugrd_CalList.Selected.Rows.Count == 0)
  328. {
  329. MessageBox.Show("请确定您要前移的酸轧卷");
  330. return;
  331. }
  332. string ex = "";
  333. string Index_ = "";
  334. string RollNO = this.ugrd_CalList.Rows[0].Cells["CAL_NO"].Value.ToString();
  335. System.Collections.ArrayList HCoil_ary = new ArrayList();
  336. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_CalList.Selected.Rows)
  337. {
  338. Index_ = Index_ + Common.FixDBManager.CheckNullStr(row.Cells["COIL_EDT_SEQ"].Value) + ";";
  339. HCoil_ary.Add(row.Cells["C_COIL_NO"].Value);
  340. }
  341. Index_ = Index_.Substring(0, Index_.Length - 1);
  342. string[] Indexs_ = Index_.Split(';');
  343. if (Check_Index_Order(Indexs_))
  344. {
  345. Hashtable paramHsmp = new Hashtable();
  346. paramHsmp.Add("i1", RollNO);
  347. paramHsmp.Add("i2", this.ugrd_CalList.Selected.Rows.Count.ToString());
  348. paramHsmp.Add("i3", Get_Index_Min(Indexs_));
  349. paramHsmp.Add("i4", Get_Index_Max(Indexs_));
  350. paramHsmp.Add("i5", "-1");
  351. paramHsmp.Add("o6", ex);
  352. CoreClientParam ccp = new CoreClientParam();
  353. ccp.ServerName = "UIB.COM.ComDBProcedure";
  354. ccp.MethodName = "doXmlProcedure";
  355. ccp.ServerParams = new Object[] { "UIF061050.Adj_HotPlan", paramHsmp };
  356. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  357. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  358. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  359. {
  360. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  361. }
  362. else
  363. {
  364. //Get_ReelPlan_Info();
  365. Get_ReelPlan_List();
  366. ReSet_SelectRow(HCoil_ary);
  367. }
  368. }
  369. }
  370. catch (System.Exception ex)
  371. {
  372. System.Diagnostics.Debug.WriteLine(ex.ToString());
  373. }
  374. }
  375. private void Down()
  376. {
  377. try
  378. {
  379. if (this.ugrd_CalList.Selected.Rows.Count == 0)
  380. {
  381. MessageBox.Show("请确定您要前移的酸轧卷");
  382. return;
  383. }
  384. string ex = "";
  385. string Index_ = "";
  386. string RollNO = this.ugrd_CalList.Rows[0].Cells["CAL_NO"].Value.ToString();
  387. System.Collections.ArrayList HCoil_ary = new ArrayList();
  388. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_CalList.Selected.Rows)
  389. {
  390. Index_ = Index_ + Common.FixDBManager.CheckNullStr(row.Cells["COIL_EDT_SEQ"].Value) + ";";
  391. HCoil_ary.Add(row.Cells["C_COIL_NO"].Value);
  392. }
  393. Index_ = Index_.Substring(0, Index_.Length - 1);
  394. string[] Indexs_ = Index_.Split(';');
  395. if (Check_Index_Order(Indexs_))
  396. {
  397. Hashtable paramHsmp = new Hashtable();
  398. paramHsmp.Add("i1", RollNO);
  399. paramHsmp.Add("i2", this.ugrd_CalList.Selected.Rows.Count.ToString());
  400. paramHsmp.Add("i3", Get_Index_Min(Indexs_));
  401. paramHsmp.Add("i4", Get_Index_Max(Indexs_));
  402. paramHsmp.Add("i5", "1");
  403. paramHsmp.Add("o6", ex);
  404. CoreClientParam ccp = new CoreClientParam();
  405. ccp.ServerName = "UIB.COM.ComDBProcedure";
  406. ccp.MethodName = "doXmlProcedure";
  407. ccp.ServerParams = new Object[] { "UIF061050.Adj_HotPlan", paramHsmp };
  408. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  409. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  410. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  411. {
  412. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  413. }
  414. else
  415. {
  416. //Get_ReelPlan_Info();
  417. Get_ReelPlan_List();
  418. ReSet_SelectRow(HCoil_ary);
  419. }
  420. }
  421. }
  422. catch (System.Exception ex)
  423. {
  424. System.Diagnostics.Debug.WriteLine(ex.ToString());
  425. }
  426. }
  427. private void Save()
  428. {
  429. try
  430. {
  431. string chk_flag = "00000";
  432. string RollNO = this.ugrd_CalList.Rows[0].Cells["CAL_NO"].Value.ToString();
  433. //if (this.CHK_CHEM.Checked)
  434. // chk_flag = "1";
  435. //else
  436. // chk_flag = "0";
  437. //if (this.CHK_PHY.Checked)
  438. // chk_flag = chk_flag + "1";
  439. //else
  440. // chk_flag = chk_flag + "0";
  441. //chk_flag=chk_flag + "000";
  442. string ex = "";
  443. string chk_ex = "";
  444. Hashtable paramHsmp = new Hashtable();
  445. paramHsmp.Add("i1", RollNO);
  446. paramHsmp.Add("i2", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
  447. paramHsmp.Add("i3", chk_flag);
  448. paramHsmp.Add("o4", chk_ex);
  449. paramHsmp.Add("o5", ex);
  450. CoreClientParam ccp = new CoreClientParam();
  451. ccp.ServerName = "UIB.COM.ComDBProcedure";
  452. ccp.MethodName = "doXmlProcedure";
  453. ccp.ServerParams = new Object[] { "UIF061050.Affirm_SuanPlan", paramHsmp };
  454. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  455. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  456. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  457. {
  458. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  459. if (err.Count > 1 && Common.FixDBManager.CheckNullStr(err[1]) != "1")
  460. {
  461. string[] err_Coil = Common.FixDBManager.CheckNullStr(err[1]).Split('#');
  462. SetDataErrorRow(err_Coil);
  463. }
  464. }
  465. else
  466. {
  467. Get_ReelPlan_Info();
  468. Get_ReelPlan_List();
  469. }
  470. }
  471. catch (System.Exception ex)
  472. {
  473. System.Diagnostics.Debug.WriteLine(ex.ToString());
  474. }
  475. }
  476. private void Merge()
  477. {
  478. try
  479. {
  480. if (this.ugrd_CalList.Selected.Rows.Count == 0)
  481. {
  482. MessageBox.Show("请确定您要并卷的酸轧卷");
  483. return;
  484. }
  485. string Index_ = "";
  486. string HCoilNOS = "";
  487. string ex = "";
  488. string RollNO = this.ugrd_CalList.Rows[0].Cells["CAL_NO"].Value.ToString();
  489. System.Collections.ArrayList HCoil_ary = new ArrayList();
  490. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_CalList.Selected.Rows)
  491. {
  492. Index_ = Index_ + Common.FixDBManager.CheckNullStr(row.Cells["COIL_EDT_SEQ"].Value) + ";";
  493. HCoilNOS = HCoilNOS + Common.FixDBManager.CheckNullStr(row.Cells["C_COIL_NO"].Value) + ";";
  494. HCoil_ary.Add(row.Cells["C_COIL_NO"].Value);
  495. }
  496. Index_ = Index_.Substring(0, Index_.Length - 1);
  497. string[] Indexs_ = Index_.Split(';');
  498. if (Check_Index_Order(Indexs_))
  499. {
  500. Hashtable paramHsmp = new Hashtable();
  501. paramHsmp.Add("i1", RollNO);
  502. paramHsmp.Add("i2", this.ugrd_CalList.Selected.Rows.Count.ToString());
  503. paramHsmp.Add("i3", HCoilNOS);
  504. paramHsmp.Add("o4", ex);
  505. CoreClientParam ccp = new CoreClientParam();
  506. ccp.ServerName = "UIB.COM.ComDBProcedure";
  507. ccp.MethodName = "doXmlProcedure";
  508. ccp.ServerParams = new Object[] { "UIF061050.Merge_CalPlan", paramHsmp };
  509. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  510. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  511. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  512. {
  513. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  514. }
  515. else
  516. {
  517. Get_ReelPlan_Info();
  518. Get_ReelPlan_List();
  519. ReSet_SelectRow(HCoil_ary);
  520. }
  521. }
  522. }
  523. catch (System.Exception ex)
  524. {
  525. System.Diagnostics.Debug.WriteLine(ex.ToString());
  526. }
  527. }
  528. private void CMerge()
  529. {
  530. try
  531. {
  532. if (this.ugrd_CalList.Selected.Rows.Count == 0)
  533. {
  534. MessageBox.Show("请确定您要并卷的基料卷");
  535. return;
  536. }
  537. string Index_ = "";
  538. string HCoilNOS = "";
  539. string RollNO = this.ugrd_CalList.Rows[0].Cells["CAL_NO"].Value.ToString();
  540. System.Collections.ArrayList HCoil_ary = new ArrayList();
  541. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_CalList.Selected.Rows)
  542. {
  543. Index_ = Index_ + Common.FixDBManager.CheckNullStr(row.Cells["COIL_EDT_SEQ"].Value) + ";";
  544. HCoilNOS = HCoilNOS + Common.FixDBManager.CheckNullStr(row.Cells["C_COIL_NO"].Value) + ";";
  545. HCoil_ary.Add(row.Cells["C_COIL_NO"].Value);
  546. }
  547. Index_ = Index_.Substring(0, Index_.Length - 1);
  548. string[] Indexs_ = Index_.Split(';');
  549. string ex = "";
  550. if (Check_Index_Order(Indexs_))
  551. {
  552. Hashtable paramHsmp = new Hashtable();
  553. paramHsmp.Add("i1", RollNO);
  554. paramHsmp.Add("i2", this.ugrd_CalList.Selected.Rows.Count.ToString());
  555. paramHsmp.Add("i3", HCoilNOS);
  556. paramHsmp.Add("o4", ex);
  557. CoreClientParam ccp = new CoreClientParam();
  558. ccp.ServerName = "UIB.COM.ComDBProcedure";
  559. ccp.MethodName = "doXmlProcedure";
  560. ccp.ServerParams = new Object[] { "UIF061050.CMerge_CalPlan", paramHsmp };
  561. CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  562. System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
  563. if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
  564. {
  565. MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
  566. }
  567. else
  568. {
  569. Get_ReelPlan_Info();
  570. Get_ReelPlan_List();
  571. ReSet_SelectRow(HCoil_ary);
  572. }
  573. }
  574. }
  575. catch (System.Exception ex)
  576. {
  577. System.Diagnostics.Debug.WriteLine(ex.ToString());
  578. }
  579. }
  580. private string GetCondition(string InitCondition)
  581. {
  582. try
  583. {
  584. if (InitCondition.Length > 0)
  585. return InitCondition;
  586. string Condition = "";
  587. string tmp = "";
  588. if (FixDBManager.CheckNullStr(this.Cmb_BM.Text).Length > 0)
  589. {
  590. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.Cmb_BM.CheckedRows)
  591. {
  592. tmp += "'" + row.Cells["SM_CD"].Value.ToString() + "',";
  593. }
  594. tmp = tmp.Substring(0, tmp.Length - 1);
  595. Condition += " AND B.C_EXTSHAPE_REQ IN(" + tmp + ") ";
  596. }
  597. if (FixDBManager.CheckNullStr(this.Cmb_PM.Text).Length > 0)
  598. {
  599. tmp = "";
  600. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.Cmb_PM.CheckedRows)
  601. {
  602. tmp += "'" + row.Cells["SM_CD"].Value.ToString() + "',";
  603. }
  604. tmp = tmp.Substring(0, tmp.Length - 1);
  605. Condition += " AND B.PRODNM_CD IN(" + tmp + ") ";
  606. }
  607. string[] height = txt_Height.Text.Split('~');
  608. string min_height = height[0].Replace(" ", "");
  609. min_height = min_height == "." ? "0" : min_height;
  610. string max_height = height[1].Replace(" ", "");
  611. max_height = max_height == "." ? "99" : max_height;
  612. Condition += " AND B.C_ORD_THK BETWEEN " + min_height + " AND " + max_height;
  613. string[] width = txt_Width.Text.Split('~');
  614. string min_width = width[0].Replace(" ", "").Length == 0 ? "0" : width[0];
  615. string max_width = width[1].Replace(" ", "").Length == 0 ? "1500" : width[1];
  616. Condition += " AND B.C_ORD_WTH BETWEEN " + min_width + " AND " + max_width;
  617. string[] senddate = mtx_SendDate.Text.Split('~');
  618. string min_senddate = senddate[0].Replace(" ", "") == "--" ? "2010-01-01" : senddate[0];
  619. string max_senddate = senddate[1].Replace(" ", "") == "--" ? "2099-01-01" : senddate[1];
  620. Condition += " AND B.DEL_TO_DATE BETWEEN TO_CHAR(TO_DATE('" + min_senddate + "','YYYY-MM-DD'),'YYYYMMDD') "
  621. + " AND TO_CHAR(TO_DATE('" + max_senddate + "','YYYY-MM-DD'),'YYYYMMDD') ";
  622. return Condition;
  623. }
  624. catch (System.Exception ex)
  625. {
  626. System.Diagnostics.Debug.WriteLine(ex.ToString());
  627. return "";
  628. }
  629. }
  630. private bool Check_Index_Order(string[] Index_)
  631. {
  632. try
  633. {
  634. if (Index_.Length < 2)
  635. return true;
  636. int value = 0;
  637. for (int i = 0; i < Index_.Length - 1; i++)
  638. {
  639. value = Common.FixDBManager.CheckNullInt(Index_[i + 1]) - Common.FixDBManager.CheckNullInt(Index_[i]);
  640. if (value > 1)
  641. {
  642. MessageBox.Show("所操作的酸轧卷的顺序不能跳跃");
  643. return false;
  644. }
  645. }
  646. return true;
  647. }
  648. catch (System.Exception ex)
  649. {
  650. System.Diagnostics.Debug.WriteLine(ex.ToString());
  651. return false;
  652. }
  653. }
  654. private string Get_Index_Min(string[] Index_)
  655. {
  656. string Index_Min = Index_[0];
  657. for (int i = 1; i < Index_.Length; i++)
  658. {
  659. if (Common.FixDBManager.CheckNullInt(Index_Min) > Common.FixDBManager.CheckNullInt(Index_[i]))
  660. {
  661. Index_Min = Index_[i];
  662. }
  663. }
  664. return Index_Min;
  665. }
  666. private string Get_Index_Max(string[] Index_)
  667. {
  668. string Index_Max = Index_[0];
  669. for (int i = 1; i < Index_.Length; i++)
  670. {
  671. if (Common.FixDBManager.CheckNullInt(Index_Max) < Common.FixDBManager.CheckNullInt(Index_[i]))
  672. {
  673. Index_Max = Index_[i];
  674. }
  675. }
  676. return Index_Max;
  677. }
  678. private void ReSet_SelectRow(System.Collections.ArrayList HCoil_ary)
  679. {
  680. try
  681. {
  682. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_CalList.Rows)
  683. {
  684. if (HCoil_ary.Contains(row.Cells["C_COIL_NO"].Value))
  685. {
  686. row.Selected = true;
  687. }
  688. }
  689. }
  690. catch (System.Exception ex)
  691. {
  692. System.Diagnostics.Debug.WriteLine(ex.ToString());
  693. }
  694. }
  695. private void SetDataErrorRow(string[] err_Coil)
  696. {
  697. try
  698. {
  699. System.Collections.Hashtable err_hsb = new Hashtable();
  700. foreach (string Coil in err_Coil)
  701. {
  702. if (Coil.Length > 2)
  703. {
  704. string err_no = Coil.Split(':')[0];
  705. string Coil_no = Coil.Split(':')[1];
  706. System.Collections.ArrayList err_list;
  707. if (err_hsb.Contains(Coil_no))
  708. {
  709. err_list = err_hsb[Coil_no] as System.Collections.ArrayList;
  710. err_list.Add(err_no);
  711. err_hsb[Coil_no] = err_list;
  712. }
  713. else
  714. {
  715. err_list = new ArrayList();
  716. err_list.Add(err_no);
  717. err_hsb.Add(Coil_no, err_list);
  718. }
  719. }
  720. }
  721. foreach (System.Data.DataRow row in this.dataSet1.Tables["TAB_CALLIST"].Rows)
  722. {
  723. if (err_hsb.Contains(row["C_COIL_NO"].ToString()))
  724. {
  725. string err_Info = "";
  726. System.Collections.ArrayList err_lst = err_hsb[row["C_COIL_NO"].ToString()] as System.Collections.ArrayList;
  727. for (int i = 0; i < err_lst.Count; i++)
  728. {
  729. switch (err_lst[i].ToString())
  730. {
  731. case "10000":
  732. err_Info = err_Info + "基料卷成分不满足要求,不能确认计划" + "\n";
  733. break;
  734. case "01000":
  735. err_Info = err_Info + "基料卷性能不满足要求,不能确认计划" + "\n";
  736. break;
  737. }
  738. }
  739. row.SetColumnError(this.dataSet1.Tables["TAB_CALLIST"].Columns["COIL_EDT_SEQ"], err_Info);
  740. }
  741. }
  742. }
  743. catch (System.Exception ex)
  744. {
  745. System.Diagnostics.Debug.WriteLine(ex.ToString());
  746. }
  747. }
  748. }
  749. }