UIJ030020.cs 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093
  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.Collections;
  9. using System.Windows.Forms;
  10. using CoreFS.CA06;
  11. using PrintSolution;
  12. using Infragistics.Win.UltraWinGrid;
  13. namespace Core.LZMes.Client.UIJ
  14. {
  15. public partial class UIJ030020 : FrmBase
  16. {
  17. #region
  18. public UIJ030020()
  19. {
  20. InitializeComponent();
  21. }
  22. public override void ToolBar_Click(object sender, string ToolbarKey)
  23. {
  24. switch (ToolbarKey)
  25. {
  26. case "Query":
  27. this.DoQuery();
  28. break;
  29. case "Save":
  30. this.DoSave();
  31. break;
  32. case "Comfirm":
  33. this.DoComfirm();
  34. break;
  35. case "Print":
  36. DoPrint();
  37. break;
  38. case "Exit":
  39. this.Close();
  40. break;
  41. }
  42. }
  43. #endregion
  44. private void UIJ030020_Load(object sender, EventArgs e)
  45. {
  46. initParam();
  47. this.tabControl1.SelectedIndex = 1;
  48. }
  49. private void initParam()
  50. {
  51. try
  52. {
  53. CoreClientParam ccp = new CoreClientParam();
  54. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  55. ccp.MethodName = "queryTransUnits";
  56. ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  57. ArrayList transList = (ArrayList)ccp.ReturnObject;
  58. int listSize = transList.Count;
  59. Infragistics.Win.ValueListItem[] valueListItems = new Infragistics.Win.ValueListItem[listSize];
  60. for (int i = 0; i < listSize; i++)
  61. {
  62. Infragistics.Win.ValueListItem item = new Infragistics.Win.ValueListItem();
  63. Hashtable ht = (Hashtable)transList[i];
  64. item.DataValue = ht["VALUE"].ToString();
  65. item.DisplayText = ht["LABEL"].ToString(); ;
  66. valueListItems[i] = item;
  67. }
  68. this.ultraComboEditor1.Items.AddRange(valueListItems);
  69. }
  70. catch (Exception e)
  71. {
  72. MessageBox.Show(e.Message);
  73. }
  74. }
  75. /// <summary>
  76. /// 查询装车计划
  77. /// </summary>
  78. private void DoQuery()
  79. {
  80. string shipProgCd = "03";//发货指示状态
  81. string fromDate = this.ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";
  82. //this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  83. string toDate = this.ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") : "";
  84. //this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  85. string shipDirNo = this.textBox1.Text.Trim();//发货指示号
  86. string curProgCd = "DFB";//物料进度
  87. string laneTp = "";//火车入库道次
  88. string entranceSeq = "";//装车次数
  89. string shipCompNm = 0 > this.ultraComboEditor1.SelectedIndex ? "" : this.ultraComboEditor1.SelectedItem.DataValue.ToString();//运输单位
  90. CoreClientParam ccp = new CoreClientParam();
  91. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  92. ccp.MethodName = "queryTransPlan";
  93. DataRowCollection drs = null;
  94. string dlivTp = "";//运输方式
  95. switch (this.tabControl1.SelectedIndex)
  96. {
  97. case 0:
  98. dlivTp = "T";
  99. this.dataSet1.Tables[0].Clear();
  100. ccp.SourceDataTable = this.dataSet1.Tables[0];
  101. ccp.ServerParams = new Object[] { shipProgCd, fromDate, toDate, shipDirNo, curProgCd, shipCompNm, dlivTp, laneTp, entranceSeq };
  102. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  103. drs = dataSet1.Tables[0].Rows;
  104. for (int i = 0; i < drs.Count; i++)
  105. {
  106. ultraGrid1.Rows[i].Cells[0].Value = false;
  107. ultraGrid1.Rows[i].Cells[0].Column.CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  108. }
  109. dataSet5.Tables[0].Clear();
  110. dataSet3.Tables[0].Clear();
  111. break;
  112. case 1:
  113. dlivTp = "C";
  114. this.dataSet2.Tables[0].Clear();
  115. ccp.SourceDataTable = this.dataSet2.Tables[0];
  116. ccp.ServerParams = new Object[] { shipProgCd, fromDate, toDate, shipDirNo, curProgCd, shipCompNm, dlivTp, laneTp, entranceSeq };
  117. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  118. drs = dataSet2.Tables[0].Rows;
  119. for (int i = 0; i < drs.Count; i++)
  120. {
  121. ultraGrid4.Rows[i].Cells[0].Value = false;
  122. ultraGrid4.Rows[i].Cells[0].Column.CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  123. }
  124. dataSet4.Tables[0].Clear();
  125. dataSet6.Tables[0].Clear();
  126. break;
  127. default:
  128. return;
  129. }
  130. }
  131. private string Checkdriv()
  132. {
  133. Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
  134. ArrayList list = new ArrayList();
  135. string dlivno = null;
  136. string ord_no = null;
  137. string ord_seq = null;
  138. string carflag = "1";
  139. CoreClientParam ccp = new CoreClientParam();
  140. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  141. switch (this.tabControl1.SelectedIndex)
  142. {
  143. case 0://火车
  144. return "1";
  145. break;
  146. case 1://汽车
  147. label13.Focus();
  148. ultraGrid4.Update();
  149. rs = this.ultraGrid4.Rows;
  150. for (int i = 0; i < rs.Count; i++)
  151. {
  152. if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
  153. {
  154. dlivno = rs[i].Cells["DLIV_DIRNO"].Value.ToString().Trim();
  155. ord_no = rs[i].Cells["ORD_NO"].Value.ToString().Trim();
  156. ord_seq = rs[i].Cells["ORD_SEQ"].Value.ToString().Trim();
  157. ccp.MethodName = "GetCarNo";
  158. ccp.ServerParams = new Object[] { dlivno, ord_no, ord_seq };
  159. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  160. if (ccp.ReturnObject !=null)
  161. {
  162. list = (ArrayList)ccp.ReturnObject;
  163. Hashtable ht = (Hashtable)list[0];
  164. // ht["VALUE"].ToString();
  165. if (ht["RET_CODE"].ToString() == "0")
  166. {
  167. carflag = "0";
  168. return carflag;
  169. }
  170. }
  171. }
  172. }
  173. return carflag;
  174. break;
  175. default:
  176. return carflag;
  177. }
  178. }
  179. private void GetCarNo()
  180. {
  181. Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
  182. ArrayList list = new ArrayList();
  183. string dlivno= null;
  184. string ord_no = null;
  185. string ord_seq = null;
  186. CoreClientParam ccp = new CoreClientParam();
  187. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  188. switch (this.tabControl1.SelectedIndex)
  189. {
  190. case 0://火车
  191. break;
  192. case 1://汽车
  193. label13.Focus();
  194. ultraGrid4.Update();
  195. rs = this.ultraGrid4.Rows;
  196. for (int i = 0; i < rs.Count; i++)
  197. {
  198. if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
  199. {
  200. dlivno = rs[i].Cells["DLIV_DIRNO"].Value.ToString().Trim();
  201. ord_no = rs[i].Cells["ORD_NO"].Value.ToString().Trim();
  202. ord_seq = rs[i].Cells["ORD_SEQ"].Value.ToString().Trim();
  203. ccp.MethodName = "GetCarNo";
  204. ccp.ServerParams = new Object[] { dlivno, ord_no, ord_seq };
  205. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  206. if (ccp.ReturnObject != null)
  207. {
  208. Hashtable ht = (Hashtable)ccp.ReturnObject;
  209. if (ht.Contains("PLAT_NO"))
  210. {
  211. rs[i].Cells["TRANS_CAR_NO"].Value = ht["PLAT_NO"].ToString();
  212. }
  213. }
  214. }
  215. }
  216. break;
  217. default:
  218. return;
  219. }
  220. }
  221. /// <summary>
  222. /// 排车
  223. /// </summary>
  224. private void DoSave()
  225. {
  226. //if (Checkdriv() == "0")
  227. //{
  228. // MessageBox.Show("司机身份未复核,请稍后排车!");
  229. // return;
  230. //}
  231. Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
  232. ArrayList list = new ArrayList();
  233. string[] param = null;
  234. CoreClientParam ccp = new CoreClientParam();
  235. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  236. switch (this.tabControl1.SelectedIndex)
  237. {
  238. case 0://火车
  239. label10.Focus();
  240. ultraGrid1.Update();
  241. rs = this.ultraGrid1.Rows;
  242. for (int i = 0; i < rs.Count; i++)
  243. {
  244. if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
  245. {
  246. param = new string[6];
  247. param[0] = rs[i].Cells["ALLOC_SEQ"].Value.ToString().Trim();
  248. param[1] = rs[i].Cells["TRANS_CAR_NO"].Value.ToString().Trim();
  249. param[2] = rs[i].Cells["LANE_TP"].Value.ToString().Trim();
  250. param[3] = rs[i].Cells["ENTERANCE_SEQ"].Value.ToString().Trim();
  251. param[4] = rs[i].Cells["DLIV_DIRNO"].Value.ToString().Trim();
  252. param[5] = rs[i].Cells["SHIP_DIRNO"].Value.ToString().Trim();
  253. list.Add(param);
  254. if (param[1] == null || param[1].Equals(""))
  255. {
  256. MessageBox.Show("车辆号不能为空,请确认后重新操作!");
  257. return;
  258. }
  259. if (param[2] == null || param[2].Equals(""))
  260. {
  261. MessageBox.Show("入库道次不能为空,请确认后重新操作!");
  262. return;
  263. }
  264. if (param[3] == null || param[3].Equals(""))
  265. {
  266. MessageBox.Show("装车次数不能为空,请确认后重新操作!");
  267. return;
  268. }
  269. }
  270. }
  271. ccp.MethodName = "saveSHIPTrain";
  272. ccp.ServerParams = new Object[] { list };
  273. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  274. for (int i = 0; i < rs.Count; i++)
  275. {
  276. if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
  277. {
  278. //设置单元格禁用
  279. rs[i].Cells["CHK"].Column.CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  280. }
  281. }
  282. queryDlivDirCoil("T");
  283. break;
  284. case 1://汽车
  285. label13.Focus();
  286. ultraGrid4.Update();
  287. rs = this.ultraGrid4.Rows;
  288. for (int i = 0; i < rs.Count; i++)
  289. {
  290. if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
  291. {
  292. param = new string[6];
  293. param[0] = rs[i].Cells["ALLOC_SEQ"].Value.ToString().Trim();
  294. param[1] = rs[i].Cells["TRANS_CAR_NO"].Value.ToString().Trim();
  295. param[2] = rs[i].Cells["DLIV_DIRNO"].Value.ToString().Trim();
  296. param[3] = rs[i].Cells["SHIP_DIRNO"].Value.ToString().Trim();
  297. param[4] = rs[i].Cells["ORD_NO"].Value.ToString().Trim();
  298. param[5] = rs[i].Cells["ORD_SEQ"].Value.ToString().Trim();
  299. list.Add(param);
  300. if (param[1] == null || param[1].Equals(""))//param[0] == null || param[0].Equals("") ||
  301. {
  302. MessageBox.Show("车辆号不能为空,请确认后重新操作!");
  303. return;
  304. }
  305. }
  306. }
  307. ccp.MethodName = "saveSHIPDIRCAR";
  308. ccp.ServerParams = new Object[] { list};
  309. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  310. for (int i = 0; i < rs.Count; i++)
  311. {
  312. if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
  313. {
  314. //设置单元格禁用
  315. rs[i].Cells["CHK"].Column.CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  316. }
  317. }
  318. queryDlivDirCoil("C");
  319. break;
  320. default:
  321. return;
  322. }
  323. }
  324. /// <summary>
  325. /// 确认装车操作
  326. /// </summary>
  327. private void DoComfirm()
  328. {
  329. if (DialogResult.Yes != MessageBox.Show("确认后不能进行排车操作,是否排车完毕?", "提示", MessageBoxButtons.YesNo))
  330. {
  331. return;
  332. }
  333. //用户名
  334. string regId = this.UserInfo.GetUserID();
  335. //超重是否继续装车标识
  336. bool top_wgt = false;
  337. //超数车辆数量
  338. int num_car = 0;
  339. Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
  340. ArrayList list = new ArrayList();
  341. string[] param = null;
  342. CoreClientParam ccp = new CoreClientParam();
  343. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  344. switch (this.tabControl1.SelectedIndex)
  345. {
  346. case 0:
  347. rs = this.ultraGrid2.Rows;
  348. for (int i = 0; i < rs.Count; i++)
  349. {
  350. if (!"TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
  351. {
  352. MessageBox.Show("第" + (i + 1) + "行的选择项没有选择,作为同一批次的车不能出现为空的现象!");
  353. return;
  354. }
  355. param = new string[8];
  356. param[0] = rs[i].Cells["ALLOC_SEQ"].Text.Trim();//排车顺序号
  357. param[1] = rs[i].Cells["TRANS_CAR_NO"].Text.Trim();//车厢号
  358. param[2] = rs[i].Cells["DLIV_DIRNO"].Text.Trim();//运输号
  359. param[3] = rs[i].Cells["SHIP_DIRNO"].Text.Trim();//发货指示号
  360. param[4] = rs[i].Cells["OLD_SAMPL_NO"].Text.Trim();//批次号
  361. param[5] = rs[i].Cells["COIL_NO"].Text.Trim();//钢卷号
  362. param[6] = rs[i].Cells["ACT_WGT"].Text.Trim();//钢卷重量
  363. param[7] = rs[i].Cells["CUR_LOAD_LOC"].Text.Trim();//垛位
  364. list.Add(param);
  365. }
  366. ccp.MethodName = "saveDLIVDIRCAR";
  367. ccp.ServerParams = new Object[] { regId, UserInfo.GetUserOrder(), UserInfo.GetUserGroup(), list };
  368. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  369. break;
  370. case 1:
  371. rs = this.ultraGrid6.Rows;
  372. for (int i = 0; i < rs.Count; i++)
  373. {
  374. if (!"TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
  375. {
  376. MessageBox.Show("第"+(i+1)+"行的选择项没有选择,作为同一批次的车不能出现为空的现象!");
  377. return;
  378. }
  379. param = new string[8];
  380. param[0] = rs[i].Cells["ALLOC_SEQ"].Text.Trim();//排车顺序号
  381. param[1] = rs[i].Cells["TRANS_CAR_NO"].Text.Trim();//车厢号
  382. param[2] = rs[i].Cells["DLIV_DIRNO"].Text.Trim();//运输号
  383. param[3] = rs[i].Cells["SHIP_DIRNO"].Text.Trim();//发货指示号
  384. param[4] = rs[i].Cells["OLD_SAMPL_NO"].Text.Trim();//批次号
  385. param[5] = rs[i].Cells["COIL_NO"].Text.Trim();//钢卷号
  386. param[6] = rs[i].Cells["ACT_WGT"].Text.Trim();//钢卷重量
  387. param[7] = rs[i].Cells["CUR_LOAD_LOC"].Text.Trim();//垛位
  388. list.Add(param);
  389. }
  390. ccp.MethodName = "saveDLIVDIRCAR";
  391. ccp.ServerParams = new Object[] { regId, UserInfo.GetUserOrder(), UserInfo.GetUserGroup(), list };
  392. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  393. break;
  394. default:
  395. return;
  396. }
  397. this.DoQuery();
  398. }
  399. //汽车待装车计划
  400. private void label13_Click(object sender, EventArgs e)
  401. {
  402. string shipProgCd = "04";
  403. string fromDate = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  404. string toDate = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  405. string shipDirNo = this.textBox1.Text.Trim();
  406. string curProgCd = "DFB";
  407. string laneTp = "";
  408. string entranceSeq = "";
  409. string shipCompNm = 0 > this.ultraComboEditor1.SelectedIndex ? "" : this.ultraComboEditor1.SelectedItem.DataValue.ToString();
  410. string dlivTp = "C";
  411. this.dataSet2.Tables[0].Clear();
  412. CoreClientParam ccp = new CoreClientParam();
  413. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  414. ccp.MethodName = "queryTransPlan";
  415. ccp.SourceDataTable = this.dataSet2.Tables[0];
  416. ccp.ServerParams = new Object[] { shipProgCd, fromDate, toDate, shipDirNo, curProgCd, shipCompNm, dlivTp, laneTp, entranceSeq };
  417. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  418. DataRowCollection drs = dataSet2.Tables[0].Rows;
  419. for (int i = 0; i < drs.Count; i++)
  420. {
  421. ultraGrid4.Rows[i].Cells[0].Value = true;
  422. ultraGrid4.Rows[i].Cells[0].Column.CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  423. }
  424. queryDlivDirCoil(dlivTp);
  425. }
  426. /// <summary>
  427. /// 查询待装车钢卷 queryShipDir
  428. /// <param name="dlivTp"
  429. /// </summary>
  430. public void queryDlivDirCoil(string dlivTp)
  431. {
  432. if ("T".Equals(dlivTp.ToUpperInvariant()))
  433. {
  434. this.dataSet3.Tables[0].Clear();
  435. CoreClientParam ccp4 = new CoreClientParam();
  436. ccp4.ServerName = "UIJ.UIJ03.UIJ030020";
  437. ccp4.MethodName = "queryShipDir";
  438. ccp4.SourceDataTable = this.dataSet3.Tables[0];
  439. ccp4.ServerParams = new Object[] { dlivTp };
  440. this.ExecuteQueryToDataTable(ccp4, CoreInvokeType.Internal);
  441. DataRowCollection drs = dataSet3.Tables[0].Rows;
  442. for (int i = 0; i < drs.Count; i++)
  443. {
  444. ultraGrid2.Rows[i].Cells[0].Value = false;
  445. }
  446. }
  447. else
  448. {
  449. this.dataSet4.Tables[0].Clear();
  450. CoreClientParam ccp4 = new CoreClientParam();
  451. ccp4.ServerName = "UIJ.UIJ03.UIJ030020";
  452. ccp4.MethodName = "queryShipDir";
  453. ccp4.SourceDataTable = this.dataSet4.Tables[0];
  454. ccp4.ServerParams = new Object[] { dlivTp };
  455. this.ExecuteQueryToDataTable(ccp4, CoreInvokeType.Internal);
  456. DataRowCollection drs = dataSet4.Tables[0].Rows;
  457. for (int i = 0; i < drs.Count; i++)
  458. {
  459. ultraGrid6.Rows[i].Cells[0].Value = false;
  460. }
  461. }
  462. }
  463. /// <summary>
  464. /// 查询下达汽车排车计划时排车计划对应的钢卷信息 queryPlanCoil
  465. /// </summary>
  466. /// <param name="sender"></param>
  467. /// <param name="e"></param>
  468. private void ultraGrid6_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
  469. {
  470. Infragistics.Win.UltraWinGrid.UltraGridRow uRow = this.ultraGrid6.ActiveRow;
  471. string dlivNo = uRow.Cells["DLIV_DIRNO"].Text.ToString().Trim();
  472. this.dataSet6.Tables[0].Clear();
  473. CoreClientParam ccp = new CoreClientParam();
  474. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  475. ccp.MethodName = "queryPlanCoil";
  476. ccp.SourceDataTable = this.dataSet6.Tables[0];
  477. ccp.ServerParams = new Object[] { dlivNo };
  478. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  479. }
  480. /// <summary>
  481. /// 取消火车待装车指示
  482. /// </summary>
  483. /// <param name="sender"></param>
  484. /// <param name="e"></param>
  485. private void label7_Click(object sender, EventArgs e)
  486. {
  487. Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid2.Rows;
  488. ArrayList list = new ArrayList();
  489. string[] param = null;
  490. for (int i = 0; i < rs.Count; i++)
  491. {
  492. if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
  493. {
  494. param = new string[2];
  495. param[0] = rs[i].Cells["DLIV_DIRNO"].Value.ToString().Trim();
  496. param[1] = rs[i].Cells["SHIP_DIRNO"].Value.ToString().Trim();
  497. bool flag = false;
  498. //去除重复的发运指示号
  499. foreach (string[] tmp in list)
  500. {
  501. if (param[0].Equals(tmp[0]) && param[1].Equals(tmp[1]))
  502. {
  503. flag = true;
  504. break;
  505. }
  506. }
  507. if (!flag)
  508. {
  509. list.Add(param);
  510. }
  511. }
  512. }
  513. if (DialogResult.Yes == MessageBox.Show("是否确认同一运输指示号(计划号)下的钢卷全部选择上?", "提示", MessageBoxButtons.YesNo))
  514. {
  515. CoreClientParam ccp = new CoreClientParam();
  516. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  517. ccp.MethodName = "returnSHIPDIRCAR";
  518. ccp.ServerParams = new Object[] { list };
  519. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  520. dataSet3.Tables[0].Clear();
  521. dataSet5.Tables[0].Clear();
  522. this.DoQuery();
  523. }
  524. }
  525. /// <summary>
  526. /// 取消汽车待装车指示
  527. /// </summary>
  528. /// <param name="sender"></param>
  529. /// <param name="e"></param>
  530. private void label15_Click(object sender, EventArgs e)
  531. {
  532. Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid6.Rows;
  533. ArrayList list = new ArrayList();
  534. string[] param = null;
  535. for (int i = 0; i < rs.Count; i++)
  536. {
  537. if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
  538. {
  539. param = new string[2];
  540. param[0] = rs[i].Cells["DLIV_DIRNO"].Value.ToString().Trim();
  541. param[1] = rs[i].Cells["SHIP_DIRNO"].Value.ToString().Trim();
  542. bool flag = false;
  543. //去除重复的发运指示号
  544. foreach (string[] tmp in list)
  545. {
  546. if (param[0].Equals(tmp[0]) && param[1].Equals(tmp[1]))
  547. {
  548. flag = true;
  549. break;
  550. }
  551. }
  552. if (!flag)
  553. {
  554. list.Add(param);
  555. }
  556. }
  557. }
  558. if(DialogResult.Yes == MessageBox.Show("是否确认同一运输指示号(计划号)下的钢卷全部选择上?","提示",MessageBoxButtons.YesNo))
  559. {
  560. CoreClientParam ccp = new CoreClientParam();
  561. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  562. ccp.MethodName = "returnSHIPDIRCAR";
  563. ccp.ServerParams = new Object[] { list };
  564. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  565. dataSet4.Tables[0].Clear();
  566. dataSet6.Tables[0].Clear();
  567. this.DoQuery();
  568. }
  569. }
  570. /// <summary>
  571. /// 火车待装车计划
  572. /// </summary>
  573. /// <param name="sender"></param>
  574. /// <param name="e"></param>
  575. private void label10_Click(object sender, EventArgs e)
  576. {
  577. if (this.ultraComboEditor2.SelectedIndex < 0)
  578. {
  579. MessageBox.Show("火车入库道次不能为空,请选择相应的入库道次!");
  580. return;
  581. }
  582. if ("".Equals(this.textBox2.Text.Trim()))
  583. {
  584. MessageBox.Show("装车次数不能为空,请输入相应的装车次数信息!");
  585. return;
  586. }
  587. string shipProgCd = "04";
  588. string fromDate = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  589. string toDate = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
  590. string shipDirNo = this.textBox1.Text.Trim();
  591. string curProgCd = "DFB";
  592. string laneTp = this.ultraComboEditor2.Value.ToString();
  593. string entranceSeq = this.textBox2.Text.Trim();
  594. string shipCompNm = 0 > this.ultraComboEditor1.SelectedIndex ? "" : this.ultraComboEditor1.SelectedItem.DataValue.ToString();
  595. string dlivTp = "T";
  596. this.dataSet1.Tables[0].Clear();
  597. CoreClientParam ccp = new CoreClientParam();
  598. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  599. ccp.MethodName = "queryTransPlan";
  600. ccp.SourceDataTable = this.dataSet1.Tables[0];
  601. ccp.ServerParams = new Object[] { shipProgCd, fromDate, toDate, shipDirNo, curProgCd, shipCompNm, dlivTp, laneTp, entranceSeq };
  602. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  603. DataRowCollection drs = dataSet1.Tables[0].Rows;
  604. for (int i = 0; i < drs.Count; i++)
  605. {
  606. ultraGrid1.Rows[i].Cells[0].Value = true;
  607. ultraGrid1.Rows[i].Cells[0].Column.CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  608. }
  609. queryDlivDirCoil(dlivTp);
  610. }
  611. /// <summary>
  612. /// 查询下达火车排车计划时排车计划对应的钢卷信息
  613. /// </summary>
  614. /// <param name="sender"></param>
  615. /// <param name="e"></param>
  616. private void ultraGrid2_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
  617. {
  618. Infragistics.Win.UltraWinGrid.UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  619. string dlivNo = uRow.Cells["DLIV_DIRNO"].Text.ToString().Trim();
  620. this.dataSet5.Tables[0].Clear();
  621. CoreClientParam ccp = new CoreClientParam();
  622. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  623. ccp.MethodName = "queryPlanCoil";
  624. ccp.SourceDataTable = this.dataSet5.Tables[0];
  625. ccp.ServerParams = new Object[] { dlivNo };
  626. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  627. }
  628. /// <summary>
  629. /// 打印产品调运单
  630. /// </summary>
  631. private void DoPrint()
  632. {
  633. switch (this.tabControl1.SelectedIndex)
  634. {
  635. case 0:
  636. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in this.ultraGrid1.Rows)
  637. {
  638. if (Convert.ToBoolean(uRow.Cells["CHK"].Value))
  639. {
  640. try
  641. {
  642. ArrayList param = new ArrayList();
  643. // param.Add(uRow.Cells["TRANS_CAR_NO"].Value.ToString());//车辆号
  644. param.Add("");//钢卷数 202101 屏蔽
  645. string dlivDirNo = uRow.Cells["DLIV_DIRNO"].Text.ToString().Trim();
  646. CoreClientParam ccp = new CoreClientParam();
  647. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  648. ccp.MethodName = "queryTransCoils";
  649. ccp.ServerParams = new Object[] { dlivDirNo };
  650. ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  651. ArrayList coils = (ArrayList)ccp.ReturnObject;
  652. // param.Add(coils.Count);//钢卷数
  653. param.Add("");//钢卷数 202101 屏蔽
  654. double sumWeight = 0;
  655. foreach (object obj in coils)
  656. {
  657. Hashtable ht = (Hashtable)obj;
  658. sumWeight += Convert.ToDouble(((Hashtable)ht["ACT_WGT"])["value"].ToString().Trim());
  659. }
  660. // param.Add(sumWeight / 1000);//钢卷总重量
  661. param.Add("");//钢卷数 202101 屏蔽
  662. for (int i = 0; i < 10; i++)
  663. {
  664. if (i < coils.Count)
  665. {
  666. Hashtable ht = (Hashtable)coils[i];
  667. param.Add(ht["COIL_NO"].ToString());//卷号
  668. param.Add(ht["SPEC_STL_GRD"].ToString());//牌号
  669. param.Add(ht["ORD_SIZE"].ToString());//订单规格
  670. param.Add(((Hashtable)ht["ACT_WGT"])["value"].ToString().Trim());//重量
  671. param.Add(ht["CUR_LOAD_LOC"].ToString());//堆放位置
  672. }
  673. else
  674. {
  675. param.Add("");
  676. param.Add("");
  677. param.Add("");
  678. param.Add("");
  679. param.Add("");
  680. }
  681. }
  682. ExcelPrinter ePrinter = new ExcelPrinter("trans.xml", param);
  683. ePrinter.PageSetup.IsCustom = true;
  684. ePrinter.Orientation = 1;//横向打印
  685. ePrinter.printExcel();
  686. }
  687. catch (Exception ex)
  688. {
  689. MessageBox.Show("打印失败,请关闭程序后重新操作!");
  690. return;
  691. }
  692. }
  693. }
  694. break;
  695. case 1:
  696. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in this.ultraGrid4.Rows)
  697. {
  698. if (Convert.ToBoolean(uRow.Cells["CHK"].Value))
  699. {
  700. try
  701. {
  702. ArrayList param = new ArrayList();
  703. // param.Add(uRow.Cells["TRANS_CAR_NO"].Value.ToString());//车辆号
  704. param.Add("");//钢卷数 202101 屏蔽
  705. string dlivDirNo = uRow.Cells["DLIV_DIRNO"].Text.ToString().Trim();
  706. CoreClientParam ccp = new CoreClientParam();
  707. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  708. ccp.MethodName = "queryTransCoils";
  709. ccp.ServerParams = new Object[] { dlivDirNo };
  710. ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  711. ArrayList coils = (ArrayList)ccp.ReturnObject;
  712. // param.Add(coils.Count);//钢卷数
  713. param.Add("");//钢卷数 202101 屏蔽
  714. double sumWeight = 0;
  715. foreach (object obj in coils)
  716. {
  717. Hashtable ht = (Hashtable)obj;
  718. sumWeight += Convert.ToDouble(((Hashtable)ht["ACT_WGT"])["value"].ToString().Trim());
  719. }
  720. //param.Add(sumWeight / 1000);//钢卷总重量
  721. param.Add("");//钢卷数 202101 屏蔽
  722. for (int i = 0; i < 10; i++)
  723. {
  724. if (i < coils.Count)
  725. {
  726. Hashtable ht = (Hashtable)coils[i];
  727. param.Add(ht["COIL_NO"].ToString());//卷号
  728. param.Add(ht["SPEC_STL_GRD"].ToString());//牌号
  729. param.Add(ht["ORD_SIZE"].ToString());//订单规格
  730. param.Add(((Hashtable)ht["ACT_WGT"])["value"].ToString().Trim());//重量
  731. param.Add(ht["CUR_LOAD_LOC"].ToString());//堆放位置
  732. }
  733. else
  734. {
  735. param.Add("");
  736. param.Add("");
  737. param.Add("");
  738. param.Add("");
  739. param.Add("");
  740. }
  741. }
  742. ExcelPrinter ePrinter = new ExcelPrinter("trans.xml", param);
  743. ePrinter.PageSetup.IsCustom = true;
  744. ePrinter.Orientation = 1;//横向打印
  745. ePrinter.printExcel();
  746. }
  747. catch (Exception ex)
  748. {
  749. MessageBox.Show("打印失败,请关闭程序后重新操作!");
  750. return;
  751. }
  752. }
  753. }
  754. break;
  755. default:
  756. return;
  757. }
  758. }
  759. //private void DoPrint()
  760. //{
  761. // try
  762. // {
  763. // UltraGrid ug = null;
  764. // if (this.tabControl1.SelectedTab.Text == "火车")
  765. // {
  766. // ug = this.ultraGrid1;
  767. // }
  768. // else
  769. // {
  770. // ug = this.ultraGrid4;
  771. // }
  772. // foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ug.Rows)
  773. // {
  774. // if (Convert.ToBoolean(uRow.Cells["CHK"].Text))
  775. // {
  776. // try
  777. // {
  778. // ArrayList param = new ArrayList();
  779. // param.Add(uRow.Cells["TRANS_CAR_NO"].Value.ToString());//车辆号
  780. // string dlivDirNo = uRow.Cells["DLIV_DIRNO"].Text.ToString().Trim();
  781. // CoreClientParam ccp = new CoreClientParam();
  782. // ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  783. // ccp.MethodName = "queryTransCoils";
  784. // ccp.ServerParams = new Object[] { dlivDirNo };
  785. // ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  786. // ArrayList coils = (ArrayList)ccp.ReturnObject;
  787. // param.Add(coils.Count);//钢卷数
  788. // double sumWeight = 0;
  789. // foreach (object obj in coils)
  790. // {
  791. // Hashtable ht = (Hashtable)obj;
  792. // sumWeight += Convert.ToDouble(((Hashtable)ht["ACT_WGT"])["value"].ToString().Trim());
  793. // }
  794. // param.Add(sumWeight / 1000);//钢卷总重量
  795. // for (int i = 0; i < 10; i++)
  796. // {
  797. // if (i < coils.Count)
  798. // {
  799. // Hashtable ht = (Hashtable)coils[i];
  800. // param.Add(ht["COIL_NO"].ToString());//卷号
  801. // param.Add(ht["SPEC_STL_GRD"].ToString());//牌号
  802. // param.Add(ht["ORD_SIZE"].ToString());//订单规格
  803. // param.Add(((Hashtable)ht["ACT_WGT"])["value"].ToString().Trim());//重量
  804. // param.Add(ht["CUR_LOAD_LOC"].ToString());//堆放位置
  805. // }
  806. // else
  807. // {
  808. // param.Add("");
  809. // param.Add("");
  810. // param.Add("");
  811. // param.Add("");
  812. // param.Add("");
  813. // }
  814. // }
  815. // ExcelPrinter ePrinter = new ExcelPrinter("trans.xml", param);
  816. // ePrinter.PageSetup.IsCustom = true;
  817. // ePrinter.Orientation = 1;//横向打印
  818. // ePrinter.printExcel();
  819. // //2014221打印后更新界面状态
  820. // this.DoQuery();
  821. // }
  822. // catch (Exception ex)
  823. // {
  824. // MessageBox.Show("打印失败,请关闭程序后重新操作!");
  825. // return;
  826. // }
  827. // }
  828. // }
  829. // }
  830. // catch (Exception p)
  831. // {
  832. // }
  833. //}
  834. private void label3_Click(object sender, EventArgs e)
  835. {
  836. ArrayList coils = new ArrayList();
  837. string dlivDirNo = string.Empty;
  838. string ordNo = string.Empty;
  839. string ordSeq = string.Empty;
  840. ultraGrid6.UpdateData();
  841. Infragistics.Win.UltraWinGrid.RowsCollection rs = ultraGrid6.Rows;
  842. for (int i = 0; i < rs.Count; i++)
  843. {
  844. if (Convert.ToBoolean(rs[i].Cells["CHK"].Value))
  845. {
  846. if (string.IsNullOrEmpty(ordNo))
  847. {
  848. ordNo = rs[i].Cells["ORD_NO"].Value.ToString();
  849. ordSeq = rs[i].Cells["ORD_SEQ"].Value.ToString();
  850. }
  851. if (string.IsNullOrEmpty(dlivDirNo) || rs[i].Cells["DLIV_DIRNO"].Value.ToString().Equals(dlivDirNo))
  852. {
  853. coils.Add(rs[i].Cells["COIL_NO"].Value.ToString());
  854. dlivDirNo = rs[i].Cells["DLIV_DIRNO"].Value.ToString();
  855. }
  856. else
  857. {
  858. MessageBox.Show("只能对同一发运计划进行换卷!");
  859. return;
  860. }
  861. }
  862. }
  863. if (coils.Count == 0)
  864. {
  865. MessageBox.Show("请选择需要替换的钢卷!");
  866. return;
  867. }
  868. //UIJ030021 reCoilForm = new UIJ030021();
  869. //reCoilForm.StartPosition = FormStartPosition.CenterScreen;
  870. //reCoilForm.ob = this.ob;
  871. //reCoilForm.OrdNo = ordNo;
  872. //reCoilForm.OrdSeq = ordSeq;
  873. //reCoilForm.Coils = coils;
  874. //reCoilForm.ShowOnwer = this;
  875. //reCoilForm.ShowDialog();
  876. }
  877. #region 根据车辆号选择
  878. private void ultraGrid6_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  879. {
  880. try
  881. {
  882. if (e.Cell.Column.Key == "CHK")
  883. {
  884. e.Cell.Row.Update();
  885. if (e.Cell.Value.ToString().ToUpper() == "TRUE")
  886. {
  887. string vDLIV_DIRNO = e.Cell.Row.Cells["DLIV_DIRNO"].Text;
  888. Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid6.Rows;
  889. for (int i = 0; i < rs.Count; i++)
  890. {
  891. if (rs[i].Cells["DLIV_DIRNO"].Text == vDLIV_DIRNO)
  892. {
  893. rs[i].Cells["CHK"].Value = true;
  894. rs[i].Appearance.ForeColor = System.Drawing.Color.Blue;
  895. }
  896. else {
  897. rs[i].Cells["CHK"].Value = false;
  898. rs[i].Appearance.ForeColor = System.Drawing.Color.Black;
  899. }
  900. }
  901. }
  902. else
  903. {
  904. string vDLIV_DIRNO = e.Cell.Row.Cells["DLIV_DIRNO"].Text;
  905. Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid6.Rows;
  906. for (int i = 0; i < rs.Count; i++)
  907. {
  908. if (rs[i].Cells["DLIV_DIRNO"].Text == vDLIV_DIRNO)
  909. {
  910. rs[i].Cells["CHK"].Value = false;
  911. rs[i].Appearance.ForeColor = System.Drawing.Color.Black;
  912. }
  913. }
  914. }
  915. }
  916. }
  917. catch (Exception ex)
  918. {
  919. System.Diagnostics.Debug.WriteLine(ex.ToString());
  920. }
  921. }
  922. #endregion
  923. private void ultraGrid2_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  924. {
  925. try
  926. {
  927. if (e.Cell.Column.Key == "CHK")
  928. {
  929. e.Cell.Row.Update();
  930. if (e.Cell.Value.ToString().ToUpper() == "TRUE")
  931. {
  932. string vDLIV_DIRNO = e.Cell.Row.Cells["DLIV_DIRNO"].Text;
  933. Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid2.Rows;
  934. for (int i = 0; i < rs.Count; i++)
  935. {
  936. if (rs[i].Cells["DLIV_DIRNO"].Text == vDLIV_DIRNO)
  937. {
  938. rs[i].Cells["CHK"].Value = true;
  939. rs[i].Appearance.ForeColor = System.Drawing.Color.Blue;
  940. }
  941. //else
  942. //{
  943. // rs[i].Cells["CHK"].Value = false;
  944. // rs[i].Appearance.ForeColor = System.Drawing.Color.Black;
  945. //}
  946. }
  947. }
  948. else
  949. {
  950. string vDLIV_DIRNO = e.Cell.Row.Cells["DLIV_DIRNO"].Text;
  951. Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid2.Rows;
  952. for (int i = 0; i < rs.Count; i++)
  953. {
  954. if (rs[i].Cells["DLIV_DIRNO"].Text == vDLIV_DIRNO)
  955. {
  956. rs[i].Cells["CHK"].Value = false;
  957. rs[i].Appearance.ForeColor = System.Drawing.Color.Black;
  958. }
  959. }
  960. }
  961. }
  962. }
  963. catch (Exception ex)
  964. {
  965. System.Diagnostics.Debug.WriteLine(ex.ToString());
  966. }
  967. }
  968. private void button1_Click(object sender, EventArgs e)
  969. {
  970. this.GetCarNo();
  971. }
  972. }
  973. }