FrmPipeBillOfLadingClose.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using System.Collections;
  11. using Infragistics.Win.UltraWinGrid;
  12. using Core.Mes.Client.Comm.Tool;
  13. using Core.Mes.Client.Comm.Server;
  14. using Core.Mes.Client.Comm.Control;
  15. using Core.StlMes.Client.YdmPipeManage.Tool;
  16. using Core.StlMes.Client.YdmPipeManage.Entity;
  17. using Infragistics.Win;
  18. namespace Core.StlMes.Client.YdmPipeManage
  19. {
  20. public partial class FrmPipeBillOfLadingClose : FrmBase
  21. {
  22. /// <summary>
  23. /// 登入用户的销售组织权限
  24. /// </summary>
  25. private string[] _salgPermissions;
  26. public FrmPipeBillOfLadingClose()
  27. {
  28. InitializeComponent();
  29. this.IsLoadUserView = true;
  30. }
  31. private void FrmPipeBillOfLadingClose_Load(object sender, EventArgs e)
  32. {
  33. InitDate();
  34. _salgPermissions = BaseMethod.InitPermissions(this.ValidDataPurviewIds, ob);
  35. EntityHelper.ShowGridCaption<YdmZcBillMyEntity>(ultraGridOrder.DisplayLayout.Bands[0]);
  36. EntityHelper.ShowGridCaption<YdmZcBillCyEntity>(ultraGridJustNo.DisplayLayout.Bands[0]);
  37. BaseMethod.setOtherColumnReadOnly(ultraGridBillNo, new string[] { "Chc" });
  38. BaseMethod.setOtherColumnReadOnly(ultraGridOrder, new string[] { "Chc" });
  39. BaseMethod.setOtherColumnReadOnly(ultraGridJustNo, new string[] { "Chc", "SendNum" });
  40. BaseMethod.InitCellPosition(ultraGridOrder, new string[] {"PlanWt", "PlanNum", "ActWt", "ActNum", "DelvryQty", "WgtEstmt" });
  41. BaseMethod.InitCellPosition(ultraGridJustNo, new string[] { "ActLenMin", "ActLenMax", "ActCount", "ActWeight", "ActCountLoad", "ActWeightLoad", "ActCountKc", "ActWeightKc", "SendNum" });
  42. EntityHelper.setColumnShowOrHidden(this.ultraGridOrder, new string[] { "PrtFlag", "SaleAreaDesc", "CreateName" }, false);
  43. }
  44. private void ChcCheckedChanged(object sender, EventArgs e)
  45. {
  46. if (ChcLadingSeq.Checked)
  47. {
  48. TxtLadingSeq.Enabled = true;
  49. }
  50. else
  51. {
  52. TxtLadingSeq.Enabled = false;
  53. }
  54. if (ChcLadingStatus.Checked)
  55. {
  56. ComLadingStatus.Enabled = true;
  57. }
  58. else
  59. {
  60. ComLadingStatus.Enabled = false;
  61. }
  62. if (ChcOrderNo.Checked)
  63. {
  64. TxtOrderNo.Enabled = true;
  65. }
  66. else
  67. {
  68. TxtOrderNo.Enabled = false;
  69. }
  70. if (ChcTime.Checked)
  71. {
  72. TimeBegin.Enabled = true;
  73. TimeEnd.Enabled = true;
  74. }
  75. else
  76. {
  77. TimeEnd.Enabled = false;
  78. TimeBegin.Enabled = false;
  79. }
  80. }
  81. /// <summary>
  82. /// 初始时间
  83. /// </summary>
  84. private void InitDate()
  85. {
  86. DateTime now = DateTime.Now;
  87. DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
  88. DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
  89. TimeBegin.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd")+" 00:00:00");
  90. TimeEnd.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd")+" 23:59:59");
  91. }
  92. public override void ToolBar_Click(object sender, string ToolbarKey)
  93. {
  94. switch (ToolbarKey)
  95. {
  96. case "Query":
  97. DoQuery();
  98. break;
  99. case "BillClose":
  100. BillClose();
  101. break;
  102. case "UpdateClose":
  103. UpdateClose();
  104. break;
  105. case "BillCut":
  106. BillCut();
  107. break;
  108. case"Print":
  109. printData();
  110. break;
  111. case "Print2":
  112. printData2();
  113. break;
  114. case "Export":
  115. GridHelper.ulGridToExcel(ultraGridJustNo, "提单炉信息");
  116. break;
  117. case "Close":
  118. this.Close();
  119. break;
  120. }
  121. }
  122. /// <summary>
  123. /// 单据打印(非套打)
  124. /// </summary>
  125. private void printData2()
  126. {
  127. string TallyNo = "";
  128. UltraGridRow ugr = this.ultraGridBillNo.ActiveRow;
  129. if (ugr == null) { MessageUtil.ShowTips("无数据,请确认!"); return; }
  130. TallyNo = ugr.Cells["BILL_NO"].Text.Trim();
  131. string LOADVEHICLE_TYPE = ugr.Cells["LOADVEHICLE_TYPE"].Text.Trim();
  132. string SALE_ORG = ugr.Cells["SALE_ORG"].Text.Trim();
  133. string strurl = "";
  134. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.getBillStatus", new Object[] { TallyNo }, this.ob);
  135. if (dt.Rows.Count > 0)
  136. {
  137. if (dt.Rows[0]["LOADVEHICLE_TYPE"].ToString().Equals("1"))
  138. {
  139. if (int.Parse(dt.Rows[0]["BILL_STATUS"].ToString()) < 4)
  140. {
  141. MessageUtil.ShowTips("提单不是关闭的不能打印!");
  142. return;
  143. }
  144. }
  145. else
  146. {
  147. if (dt.Rows[0]["ISPRECLOSE"].ToString().Equals("0"))
  148. {
  149. MessageUtil.ShowTips("虚单未第一次关闭!");
  150. return;
  151. }
  152. }
  153. }
  154. if (this.CustomInfo == "120504")
  155. {
  156. if (LOADVEHICLE_TYPE.Equals("实际"))
  157. {
  158. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderTH.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
  159. }
  160. else
  161. {
  162. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderXDTH.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
  163. }
  164. }
  165. else
  166. {
  167. //if (_salgPermissions.Length == 1)
  168. //{
  169. if (SALE_ORG.Equals("100102"))
  170. {
  171. if (LOADVEHICLE_TYPE.Equals("实际"))
  172. {
  173. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderGouMao.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();//实单
  174. }
  175. else
  176. {
  177. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderXDGouMao.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();//虚单
  178. }
  179. }
  180. else
  181. {
  182. if (LOADVEHICLE_TYPE.Equals("实际"))
  183. {
  184. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorder2.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
  185. }
  186. else
  187. {
  188. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderXD2.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
  189. }
  190. }
  191. }
  192. string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  193. ServerHelper.SetData("com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.updatePintFlag", new object[] { time, TallyNo }, ob);
  194. BillDocPrintExcel fBug = new BillDocPrintExcel(ob, strurl);
  195. fBug.AutoSize = true;
  196. fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  197. fBug.Text = "出库单打印";
  198. fBug.ShowDialog();
  199. fBug.StartPosition = FormStartPosition.CenterScreen;
  200. DoQuery();
  201. }
  202. private void printData()
  203. {
  204. string TallyNo = "";
  205. UltraGridRow ugr = this.ultraGridBillNo.ActiveRow;
  206. if (ugr == null) { MessageUtil.ShowTips("无数据,请确认!"); return; }
  207. TallyNo = ugr.Cells["BILL_NO"].Text.Trim();
  208. string LOADVEHICLE_TYPE = ugr.Cells["LOADVEHICLE_TYPE"].Text.Trim();
  209. string SALE_ORG = ugr.Cells["SALE_ORG"].Text.Trim();
  210. string strurl = "";
  211. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.getBillStatus", new Object[] { TallyNo }, this.ob);
  212. if (dt.Rows.Count > 0)
  213. {
  214. if (dt.Rows[0]["LOADVEHICLE_TYPE"].ToString().Equals("1"))
  215. {
  216. if (int.Parse(dt.Rows[0]["BILL_STATUS"].ToString()) < 4)
  217. {
  218. MessageUtil.ShowTips("提单不是关闭的不能打印!");
  219. return;
  220. }
  221. }
  222. else
  223. {
  224. if (dt.Rows[0]["ISPRECLOSE"].ToString().Equals("0"))
  225. {
  226. MessageUtil.ShowTips("虚单未第一次关闭!");
  227. return;
  228. }
  229. }
  230. }
  231. if (this.CustomInfo == "120504")
  232. {
  233. if (LOADVEHICLE_TYPE.Equals("实际"))
  234. {
  235. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderTH.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
  236. }
  237. else
  238. {
  239. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderXDTH.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
  240. }
  241. }
  242. else
  243. {
  244. //if (_salgPermissions.Length == 1)
  245. //{
  246. if (SALE_ORG.Equals("100102"))
  247. {
  248. if (LOADVEHICLE_TYPE.Equals("实际"))
  249. {
  250. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderGouMao.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();//实单
  251. }
  252. else
  253. {
  254. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderXDGouMao.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();//虚单
  255. }
  256. }
  257. else
  258. {
  259. if (LOADVEHICLE_TYPE.Equals("实际"))
  260. {
  261. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorder.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
  262. }
  263. else
  264. {
  265. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderXD.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
  266. }
  267. }
  268. //}
  269. //else
  270. //{
  271. // if (LOADVEHICLE_TYPE.Equals("实际"))
  272. // {
  273. // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorder.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
  274. // }
  275. // else
  276. // {
  277. // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderXD.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
  278. // }
  279. //}
  280. }
  281. string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  282. ServerHelper.SetData("com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.updatePintFlag", new object[] { time, TallyNo }, ob);
  283. BillDocPrintExcel fBug = new BillDocPrintExcel(ob, strurl);
  284. fBug.AutoSize = true;
  285. fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  286. fBug.Text = "出库单打印";
  287. fBug.ShowDialog();
  288. fBug.StartPosition = FormStartPosition.CenterScreen;
  289. DoQuery();
  290. }
  291. private void DoQuery()
  292. {
  293. ArrayList param = new ArrayList();
  294. string billNo = "";
  295. if (ChcLadingSeq.Checked)
  296. {
  297. billNo = TxtLadingSeq.Text.Trim();
  298. }
  299. string orderNo = "";
  300. if (ChcOrderNo.Checked)
  301. {
  302. orderNo = TxtOrderNo.Text.Trim();
  303. }
  304. string billStatus = "";
  305. if (ChcLadingStatus.Checked)
  306. {
  307. billStatus = ComLadingStatus.Value.ToString();
  308. }
  309. string strBegin = "1900-01-01 00:00:00";
  310. string strEnd = "9900-01-01 00:00:00";
  311. if (ChcTime.Checked)
  312. {
  313. if (TimeBegin.Value == null || TimeEnd.Value == null)
  314. {
  315. MessageUtil.ShowWarning("请选择正确的创建时间");
  316. return;
  317. }
  318. strBegin = TimeBegin.Value.ToString();
  319. strEnd = TimeEnd.Value.ToString();
  320. }
  321. //string[] arr = BaseMethod.InitPermissions(this.ValidDataPurviewIds,this.ob);
  322. string[] arr = this.ValidDataPurviewIds;
  323. param.Add(billNo);
  324. param.Add(orderNo);
  325. param.Add(billStatus);
  326. param.Add(strBegin);
  327. param.Add(strEnd);
  328. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.getBiltNo", new Object[] { param, arr, this.CustomInfo}, this.ob);
  329. GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
  330. if (dt == null || dt.Rows.Count == 0)
  331. {
  332. QueryOrder("");
  333. QueryJustStoveInfo("");
  334. }
  335. BaseMethod.SetUltraGridRowColor(ultraGridBillNo, new string[] { "LOADVEHICLE_TYPE" }, new string[] { "虚拟" }, Color.GreenYellow);
  336. }
  337. private void ultraGridBillNo_AfterRowActivate(object sender, EventArgs e)
  338. {
  339. UltraGridRow ugr = ultraGridBillNo.ActiveRow;
  340. if (ugr == null)
  341. {
  342. return;
  343. }
  344. QueryOrder(ugr.GetCellValue("BILL_NO").ToString());
  345. QueryJustStoveInfo(ugr.GetCellValue("BILL_NO").ToString());
  346. }
  347. private void QueryOrder(string billNo)
  348. {
  349. List<YdmZcBillMyEntity> listSource = EntityHelper.GetData<YdmZcBillMyEntity>(
  350. "com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.getOrderInfoByBiltNo", new object[] { billNo }, this.ob);
  351. ydmZcBillMyEntityBindingSource.DataSource = listSource;
  352. }
  353. private void QueryJustStoveInfo(string billNo)
  354. {
  355. ultraGridJustNo.UpdateData();
  356. List<YdmZcBillCyEntity> listSource = EntityHelper.GetData<YdmZcBillCyEntity>(
  357. "com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.getJustStoveNoInfoByBiltNo", new object[] { billNo }, this.ob);
  358. ydmZcBillCyEntityBindingSource.DataSource = listSource;
  359. foreach (UltraGridRow row in ultraGridJustNo.Rows)
  360. {
  361. //理货在途量
  362. row.Cells["ActCountKc"].Value = (double.Parse(row.Cells["ActTallCount"].Value.ToString()) - double.Parse(row.Cells["ActCountLoad"].Value.ToString())).ToString();
  363. if (double.Parse(row.Cells["ActCountKc"].Value.ToString()) != 0.0)
  364. {
  365. row.Cells["ActWeightKc"].Value = (double.Parse(row.Cells["ActTallWt"].Value.ToString()) - double.Parse(row.Cells["ActWeightLoad"].Value.ToString())).ToString("f3");
  366. }
  367. else
  368. {
  369. row.Cells["ActWeightKc"].Value = "0.000";
  370. }
  371. //提单在途量
  372. row.Cells["ActCountZy"].Value = (double.Parse(row.Cells["ActCount"].Value.ToString()) - double.Parse(row.Cells["ActCountLoad"].Value.ToString())).ToString();
  373. if (double.Parse(row.Cells["ActCountZY"].Value.ToString()) != 0.0)
  374. {
  375. row.Cells["ActWeightZy"].Value = (double.Parse(row.Cells["ActWeight"].Value.ToString()) - double.Parse(row.Cells["ActWeightLoad"].Value.ToString())).ToString("f3");
  376. }
  377. else
  378. {
  379. row.Cells["ActWeightZY"].Value = "0.000";
  380. }
  381. if (row.Cells["orderUnit"].Text.Equals("吨"))
  382. {
  383. //row.Cells["SendNum"].Value = row.Cells["ActWeightLoad"].Value.ToString();
  384. row.Cells["SendNum"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  385. }
  386. else if (row.Cells["OrderUnit"].Text.Equals("支") || row.Cells["OrderUnit"].Text.Equals("个"))
  387. {
  388. //row.Cells["SendNum"].Value = row.Cells["ActCountLoad"].Value.ToString();
  389. row.Cells["SendNum"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  390. }
  391. else
  392. {
  393. row.Cells["SendNum"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  394. row.Cells["SendNum"].Appearance.BackHatchStyle = BackHatchStyle.None;
  395. row.Cells["SendNum"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  396. }
  397. }
  398. }
  399. private void ultraGridOrder_AfterRowActivate(object sender, EventArgs e)
  400. {
  401. UltraGridRow ugr = ultraGridOrder.ActiveRow;
  402. if (ugr == null)
  403. {
  404. return;
  405. }
  406. foreach (UltraGridRow ugrJ in ultraGridJustNo.Rows)
  407. {
  408. if (ugrJ.Cells["OrdLnDlyPk"].Text.Equals(ugr.Cells["OrdLnDlyPk"].Text))
  409. {
  410. ugrJ.Appearance.BackColor = Color.Wheat;
  411. }
  412. else
  413. {
  414. ugrJ.Appearance.BackColor = Color.White;
  415. }
  416. }
  417. }
  418. /// <summary>
  419. /// 提单关闭
  420. /// </summary>
  421. private void BillClose()
  422. {
  423. ultraGridJustNo.UpdateData();
  424. UltraGridRow ugr = ultraGridBillNo.ActiveRow;
  425. ArrayList list1 = new ArrayList();
  426. ArrayList pram1 = new ArrayList();
  427. if (ugr == null)
  428. {
  429. MessageUtil.ShowWarning("请选择提单号!");
  430. return;
  431. }
  432. if (MessageUtil.ShowYesNoAndQuestion("是否提单关闭?") == DialogResult.No)
  433. {
  434. return;
  435. }
  436. string billNo = ugr.Cells["BILL_NO"].Value.ToString();
  437. string sendNo = ugr.Cells["SEND_PLAN_NO"].Value.ToString();
  438. string prcls = ugr.Cells["PRD_CLS"].Value.ToString();
  439. string name = this.UserInfo.GetUserName();
  440. string sendNumber = "";
  441. string loadvehicleType = ugr.Cells["LOADVEHICLE_TYPE"].Value.ToString();
  442. //炉号信息
  443. foreach (UltraGridRow row in ultraGridJustNo.Rows)
  444. {
  445. ArrayList list = new ArrayList();
  446. if (row.Cells["ActCountLoad"].Text.Trim() != "0")
  447. {
  448. if (row.Cells["SendNum"].Text.Trim() == "0.000")
  449. {
  450. MessageUtil.ShowTips("请填写提单炉信息里面的实发数!");
  451. return;
  452. //sendNumber = "0";
  453. }
  454. else
  455. {
  456. sendNumber = row.Cells["SendNum"].Value.ToString();
  457. }
  458. }
  459. else { sendNumber = "0"; }
  460. list.Add(sendNumber);
  461. list.Add(row.Cells["ActCountLoad"].Value.ToString());
  462. list.Add(row.Cells["JudgeStoveNo"].Value.ToString());
  463. list.Add(row.Cells["BatchNo"].Value.ToString());
  464. list.Add(row.Cells["GroupNo"].Value.ToString());
  465. list.Add(row.Cells["OrdLnDlyPk"].Value.ToString());
  466. list.Add(row.Cells["OrderUnit"].Value.ToString());
  467. list.Add(row.Cells["PrtFlag"].Value.ToString());
  468. list.Add(row.Cells["StdCode"].Value.ToString2());
  469. list1.Add(list);
  470. }
  471. ///合同信息
  472. foreach (UltraGridRow row in ultraGridOrder.Rows)
  473. {
  474. ArrayList pram = new ArrayList();
  475. pram.Add(row.Cells["BillNoSeq"].Value.ToString());
  476. pram.Add(row.Cells["OrdLnDlyPk"].Value.ToString());
  477. pram1.Add(pram);
  478. }
  479. CoreClientParam ccp = new CoreClientParam();
  480. ccp.ServerName = "com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose";
  481. ccp.MethodName = "BillClose";
  482. ccp.ServerParams = new object[] { billNo, sendNo, name, list1, pram1, prcls, loadvehicleType };
  483. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  484. if (ccp.ReturnCode != -1)
  485. {
  486. MessageUtil.ShowTips(ccp.ReturnInfo);
  487. if (ccp.ReturnInfo.Equals("提单关闭成功!"))
  488. {
  489. if (!_salgPermissions[0].Equals("100102"))
  490. {
  491. printData();
  492. }
  493. DoQuery();
  494. BaseMethod.UltraGridLocation(ultraGridBillNo, new string[] { "BILL_NO" }, new string[] { billNo });
  495. }
  496. }
  497. }
  498. /// <summary>
  499. /// 提单划断
  500. /// </summary>
  501. private void BillCut()
  502. {
  503. UltraGridRow ugr = ultraGridBillNo.ActiveRow;
  504. if (ugr == null)
  505. {
  506. MessageUtil.ShowWarning("请选择提单号!");
  507. return;
  508. }
  509. if (MessageUtil.ShowYesNoAndQuestion("是否提单划断?") == DialogResult.No)
  510. {
  511. return;
  512. }
  513. string billNo = ugr.Cells["BILL_NO"].Value.ToString();
  514. CoreClientParam ccp = new CoreClientParam();
  515. ccp.ServerName = "com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose";
  516. ccp.MethodName = "BillCut";
  517. ccp.ServerParams = new object[] { billNo };
  518. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  519. if (ccp.ReturnCode != -1)
  520. {
  521. MessageUtil.ShowTips(ccp.ReturnInfo);
  522. if (ccp.ReturnInfo.Equals("提单划断成功!"))
  523. {
  524. DoQuery();
  525. BaseMethod.UltraGridLocation(ultraGridBillNo, new string[] { "BILL_NO" }, new string[] { billNo });
  526. }
  527. }
  528. }
  529. /// <summary>
  530. /// 按回车键触发查询按钮
  531. /// </summary>
  532. /// <param name="sender"></param>
  533. /// <param name="e"></param>
  534. private void ContPublic_KeyDown(object sender, KeyEventArgs e)
  535. {
  536. if (e.KeyCode == Keys.Enter)
  537. {
  538. DoQuery();
  539. }
  540. }
  541. /// <summary>
  542. /// 填写时触发
  543. /// </summary>
  544. /// <param name="sender"></param>
  545. /// <param name="e"></param>
  546. private void ultraGridJustNo_CellChange(object sender, CellEventArgs e)
  547. {
  548. if (e.Cell.Column.Key.Equals("SendNum"))
  549. {
  550. if (e.Cell.Row.Cells["SendNum"].Value == null)
  551. {
  552. e.Cell.Row.Cells["SendNum"].Value = "0";
  553. }
  554. else
  555. {
  556. ultraGridJustNo.UpdateData();
  557. string actCount = e.Cell.Row.Cells["SendNum"].Value.ToString();
  558. if (!StringUtil.IsFloat(actCount) || actCount == "0")//actCount == "" || int.Parse(actCount)==0
  559. {
  560. e.Cell.Row.Cells["SendNum"].Value = "0";
  561. }
  562. else
  563. {
  564. e.Cell.Row.Cells["SendNum"].Value = e.Cell.Row.Cells["SendNum"].Value.ToString();
  565. }
  566. }
  567. //DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.queryOrderUnit", new Object[] { e.Cell.Row.Cells["OrdLnDlyPk"].Text.Trim() }, this.ob);
  568. //if (dt.Rows.Count > 0)
  569. //{
  570. // if (dt.Rows[0]["ORDER_UNIT"].ToString().Equals("吨") || dt.Rows[0]["ORDER_UNIT"].ToString().Equals("支"))
  571. // {
  572. // MessageUtil.ShowTips("该炉对应合同信息交货行计量单位为:"+dt.Rows[0]["ORDER_UNIT"].ToString()+"不能填!");
  573. // e.Cell.Row.Cells["SendNum"].Value = "0";
  574. // return;
  575. // }
  576. //}
  577. }
  578. }
  579. /// <summary>
  580. /// 撤销关闭提单
  581. /// </summary>
  582. private void UpdateClose()
  583. {
  584. ultraGridBillNo.UpdateData();
  585. UltraGridRow ugr = ultraGridBillNo.ActiveRow;
  586. if (ugr == null) return;
  587. if (MessageUtil.ShowYesNoAndQuestion("是否撤销关闭提单?") == DialogResult.No) return;
  588. string billNo = ugr.Cells["BILL_NO"].Value.ToString();
  589. CoreClientParam ccp = new CoreClientParam();
  590. ccp.ServerName = "com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose";
  591. ccp.MethodName = "updateBill";
  592. ccp.ServerParams = new object[] { billNo};
  593. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  594. if (ccp.ReturnCode != -1)
  595. {
  596. MessageUtil.ShowTips(ccp.ReturnInfo);
  597. if (ccp.ReturnInfo.Equals("撤销关闭提单成功!"))
  598. {
  599. DoQuery();
  600. BaseMethod.UltraGridLocation(ultraGridBillNo, new string[] { "BILL_NO" }, new string[] { billNo });
  601. }
  602. }
  603. }
  604. }
  605. }