0be76e158afef83ff9b12ef88ff93764925ac43b.svn-base 34 KB

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