ExcDeliveryHandle.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  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;using Pur.Entity;
  10. using Core.Mes.Client.Comm.Control;
  11. using Pur.Entity.ck;
  12. using Infragistics.Win.UltraWinGrid;
  13. using System.Collections;
  14. using Core.Mes.Client.Comm.Tool;
  15. using com.hnshituo.pur.vo;
  16. using Core.Mes.Client.Comm.Server;
  17. using Pur.PublicTools;
  18. namespace Pur.ck
  19. {
  20. public partial class ExcDeliveryHandle : FrmPmsBase
  21. {
  22. public ExcDeliveryHandle()
  23. {
  24. InitializeComponent();
  25. }
  26. private void ExcDeliveryHandle_Load(object sender, EventArgs e)
  27. {
  28. ck_Ctime.Checked = true;
  29. txt_CreateTimeS.Value = DateTime.Now.AddMonths(-1);
  30. txt_CreateTimeS.Enabled = true;
  31. txt_CreateTimeE.Value = Convert.ToDateTime(DateTime.Now.ToShortDateString()).AddHours(23).AddMinutes(59);
  32. txt_CreateTimeE.Enabled = true;
  33. txt_status.SelectedIndex = 1;//默认待处置状态
  34. GridHelper.SetExcludeColumnsActive(GridSubM.DisplayLayout.Bands[0], new string[] { });
  35. GridHelper.SetExcludeColumnsActive(GridHandledSubM.DisplayLayout.Bands[0], new string[] { });
  36. GridHelper.SetExcludeColumnsActive(GridReturnedSubM.DisplayLayout.Bands[0], new string[] { });
  37. PublicPur.InitCellEdit(new UltraGrid[] { GridHandle }, new string[] { "CHK","remark2","AGAINQTY", "RETURNEDQTY", "HANDLEDQTY" });
  38. PublicPur.InitCellPositionRight(new UltraGrid[] { GridHandle }, new string[] { "AGAINQTY", "RETURNEDQTY", "HANDLEDQTY" });
  39. PublicPur.InitColumnShowLength(new UltraGrid[] { GridHandle }, 0, new string[] { "AGAINQTY", "RETURNEDQTY", "HANDLEDQTY" }, 3, false);
  40. Get_ExcSubM();
  41. }
  42. #region toolbar工具栏
  43. /// <summary>
  44. /// 菜单栏
  45. /// </summary>
  46. /// <param name="sender"></param>
  47. /// <param name="ToolbarKey"></param>
  48. public override void ToolBar_Click(object sender, string ToolbarKey)
  49. {
  50. switch (ToolbarKey)
  51. {
  52. case "Query":
  53. Get_ExcSubM();
  54. break;
  55. case "Confirm":
  56. Con_ExcSubM();
  57. break;
  58. case "Cancel":
  59. cancel_ExcSubM();
  60. break;
  61. case "doPrintDelivery":
  62. doPrintDelivery();
  63. break;
  64. case "doPrintReturn":
  65. doPrintReturn();
  66. break;
  67. case "Close":
  68. this.Close();
  69. break;
  70. }
  71. }
  72. /// <summary>
  73. /// 查询
  74. /// </summary>
  75. private void Get_ExcSubM()
  76. {
  77. try
  78. {
  79. this.Cursor = Cursors.WaitCursor;
  80. subM.Clear();
  81. handledSubM.Clear();
  82. returnSubM.Clear();
  83. Hashtable map = new Hashtable();
  84. map.Add("deliverySubId", txt_deliverySubId.Text.Trim());
  85. map.Add("orderId", txt_OrderId.Text.Trim());
  86. map.Add("suppName", txt_suppName.Text.Trim());
  87. map.Add("invPhysicName", QInphysicNoJL.Text.Trim());
  88. map.Add("deliveryLocation", QLocationNoJL.Text.Trim());
  89. if (ck_Ctime.Checked && !string.IsNullOrEmpty(txt_CreateTimeS.Text))
  90. {
  91. map.Add("createTimeBegin", Convert.ToDateTime(txt_CreateTimeS.Value));
  92. }
  93. if (ck_Ctime.Checked && !string.IsNullOrEmpty(txt_CreateTimeE.Text))
  94. {
  95. map.Add("createTimeEnd", Convert.ToDateTime(txt_CreateTimeE.Value));
  96. }
  97. if (txt_status.SelectedIndex != -1)
  98. {
  99. map.Add("statusHandle", txt_status.Value.ToString().Trim());//all:全部 wait:待处理 did:已处理
  100. }
  101. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.ExcDeliverySubMService", "doQueryDeliverySubMList", new object[] { map });
  102. GridHelper.CopyDataToDatatable(dt, DTSubM, true);
  103. GridHelper.RefreshAndAutoSize(GridSubM);
  104. }
  105. catch(Exception ex)
  106. {
  107. MessageUtil.ShowTips("查询送货单主表数据失败:"+ex.Message);
  108. }
  109. finally
  110. {
  111. this.Cursor = Cursors.Default;
  112. }
  113. }
  114. /// <summary>
  115. /// 处理结果提交
  116. /// </summary>
  117. private void Con_ExcSubM()
  118. {
  119. try
  120. {
  121. this.Cursor = Cursors.WaitCursor;
  122. List<ExcDeliveryException> list = new List<ExcDeliveryException>();
  123. //校验数据
  124. GridHandle.UpdateData();
  125. foreach (UltraGridRow row in GridHandle.Rows)
  126. {
  127. if (Convert.ToBoolean(row.GetCellValue("CHK")))
  128. {
  129. ///"AGAINQTY", "RETURNEDQTY", "HANDLEDQTY"
  130. String strSubSqe = row.GetCellValue("deliverySubLineSqe").ToString().Trim();
  131. String strId = row.GetCellValue("id").ToString().Trim();
  132. //校验异常单
  133. if (!testExceptionC(strId, 1))
  134. {
  135. return;
  136. }
  137. double dbAGAINQTY = 0;//补货量
  138. double dbRETURNEDQTY = 0;//退货量
  139. double dbHANDLEDQTY = 0;//让步量
  140. double dbAllQty = 0;
  141. double dbQty = 0;
  142. Double.TryParse(row.GetCellValue("qty").ToString().Trim(), out dbQty);
  143. Double.TryParse(row.GetCellValue("AGAINQTY").ToString().Trim(), out dbAGAINQTY);
  144. Double.TryParse(row.GetCellValue("RETURNEDQTY").ToString().Trim(), out dbRETURNEDQTY);
  145. Double.TryParse(row.GetCellValue("HANDLEDQTY").ToString().Trim(), out dbHANDLEDQTY);
  146. dbAGAINQTY =Math.Round(dbAGAINQTY,3);//补货量
  147. dbRETURNEDQTY =Math.Round(dbRETURNEDQTY,3);//退货量
  148. dbHANDLEDQTY = Math.Round(dbHANDLEDQTY,3);//让步量
  149. dbQty = Math.Round(dbQty, 3);//待处置量
  150. dbAllQty = dbAGAINQTY + dbRETURNEDQTY + dbHANDLEDQTY;
  151. if (dbAllQty > dbQty)
  152. {
  153. MessageUtil.ShowTips("送货单行:" + strSubSqe + "的异常单:" + strId + "的处置量总和不能大于待处置量:" + dbQty);
  154. row.Activate();
  155. return;
  156. }
  157. if (dbAGAINQTY <= 0 && dbRETURNEDQTY <= 0 && dbHANDLEDQTY <= 0)
  158. {
  159. MessageUtil.ShowTips("送货单行:" + strSubSqe + "的异常单:" + strId + "的处置量总需大于0");
  160. row.Activate();
  161. return;
  162. }
  163. ExcDeliveryException hand = new ExcDeliveryException();
  164. hand.Id = strId;
  165. hand.DeliverySubLineSqe = strSubSqe;
  166. hand.HandledQty = dbHANDLEDQTY;
  167. hand.ReturnedQty = dbRETURNEDQTY;
  168. hand.AgainQty = dbAGAINQTY;
  169. hand.HandleName = UserInfo.GetUserName();
  170. hand.HandleUserid = UserInfo.GetUserID();
  171. hand.HandleTime = DateTime.Now;
  172. hand.Remark = row.GetCellValue("remark2").ToString().Trim();
  173. hand.DeleteUserid = UserInfo.GetDeptid();
  174. hand.DeleteName = UserInfo.GetDepartment();
  175. list.Add(hand);
  176. }
  177. }
  178. if (list.Count <= 0)
  179. {
  180. MessageUtil.ShowTips("请选择异常单进行处理");
  181. return;
  182. }
  183. if (MessageUtil.ShowYesNoAndQuestion("确定提交处置包括送货单行:" +list[0].DeliverySubLineSqe+"在内的共"+list.Count+"条异常单处理结果?") != DialogResult.Yes)
  184. {
  185. return;
  186. }
  187. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.ck.service.ExcDeliveryExceptionService", "doHandle", new object[] { list });
  188. if (crt.Resultcode == 0)
  189. {
  190. MessageUtil.ShowTips("操作成功:" + crt.Resultmsg);
  191. if(GridSubM.ActiveRow!=null)
  192. {
  193. String strDeliverySubId = GridSubM.ActiveRow.Cells["DeliverySubId"].Value.ToString().Trim();
  194. if (!String.IsNullOrEmpty(strDeliverySubId))
  195. {
  196. doQuerySubLine(strDeliverySubId);
  197. }
  198. }
  199. }
  200. else
  201. {
  202. //操作失败
  203. MessageUtil.ShowTips("操作失败:" + crt.Resultmsg);
  204. }
  205. }
  206. catch (Exception ex)
  207. {
  208. MessageUtil.ShowTips("操作失败:" + ex);
  209. }
  210. finally
  211. {
  212. this.Cursor = Cursors.Default;
  213. }
  214. }
  215. /// <summary>
  216. /// 取消处理
  217. /// </summary>
  218. private void cancel_ExcSubM()
  219. {
  220. try
  221. {
  222. this.Cursor = Cursors.WaitCursor;
  223. List<ExcDeliveryException> list = new List<ExcDeliveryException>();
  224. //校验数据
  225. GridHandle.UpdateData();
  226. foreach (UltraGridRow row in GridHandle.Rows)
  227. {
  228. if (Convert.ToBoolean(row.GetCellValue("CHK")))
  229. {
  230. String strId = row.GetCellValue("id").ToString().Trim();
  231. String strSubSqe = row.GetCellValue("deliverySubLineSqe").ToString().Trim();
  232. //校验异常单
  233. if (!testExceptionC(strId, 2))
  234. {
  235. return;
  236. }
  237. ExcDeliveryException hand = new ExcDeliveryException();
  238. hand.DeliverySubLineSqe = strSubSqe;
  239. hand.Id = strId;
  240. hand.DeleteName = UserInfo.GetUserName();
  241. hand.DeleteUserid = UserInfo.GetUserID();
  242. hand.DeleteTime = DateTime.Now;
  243. list.Add(hand);
  244. }
  245. }
  246. if (list.Count <= 0)
  247. {
  248. MessageUtil.ShowTips("请选择异常单进行处理");
  249. return;
  250. }
  251. if (MessageUtil.ShowYesNoAndQuestion("确定撤销处置包括送货单行:" + list[0].DeliverySubLineSqe + "在内的共" + list.Count + "条异常单处理结果?") != DialogResult.Yes)
  252. {
  253. return;
  254. }
  255. CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.ck.service.ExcDeliveryExceptionService", "docancel_Handle", new object[] { list });
  256. if (crt.Resultcode == 0)
  257. {
  258. MessageUtil.ShowTips("操作成功:" + crt.Resultmsg);
  259. if (GridSubM.ActiveRow != null)
  260. {
  261. String strDeliverySubId = GridSubM.ActiveRow.Cells["DeliverySubId"].Value.ToString().Trim();
  262. if (!String.IsNullOrEmpty(strDeliverySubId))
  263. {
  264. doQuerySubLine(strDeliverySubId);
  265. }
  266. }
  267. }
  268. else
  269. {
  270. //操作失败
  271. MessageUtil.ShowTips("操作失败:" + crt.Resultmsg);
  272. }
  273. }
  274. catch (Exception ex)
  275. {
  276. MessageUtil.ShowTips("操作失败:" + ex);
  277. }
  278. finally
  279. {
  280. this.Cursor = Cursors.Default;
  281. }
  282. }
  283. /// <summary>
  284. /// 打印检化验委托单
  285. /// </summary>
  286. private void doPrintDelivery()
  287. {
  288. try
  289. {
  290. this.Cursor = Cursors.WaitCursor;
  291. if (GridHandledSubM.ActiveRow == null && !GridHandledSubM.ActiveRow.HasChild())
  292. {
  293. MessageUtil.ShowTips("请选择让步接收送货单行进行操作!");
  294. return;
  295. }
  296. String strDeliverySubId = GridHandledSubM.ActiveRow.GetCellValue("deliverySubId").ToString().Trim();
  297. if (String.IsNullOrEmpty(strDeliverySubId))
  298. {
  299. MessageUtil.ShowTips("送货单号为空");
  300. }
  301. string strurl = "";
  302. DataTable dt = ServerHelper.GetData("com.hnshituo.pur.configure.service.impl.CoreBaseInfoNew.doQuery", new Object[] { "1223" }, this.ob);
  303. DataRow[] drArr = dt.Select("validflag='1'");
  304. if (drArr.Length != 1)
  305. {
  306. MessageUtil.ShowTips("基础数据维护错误:报表系统需维护有效的Ip且只能维护一个有效ip!");
  307. return;
  308. }
  309. String TipsEnv = drArr[0]["baseName"].ToString();
  310. String strUrlPort = "http://172.54.10.42:8080";//报表系统IP
  311. String[] str = strUrlPort.Split(':');
  312. String strUrl = str[0] + ":" + str[1];
  313. if (ob.MainUrl.StartsWith(strUrl))
  314. {
  315. //测试环境
  316. if (TipsEnv == "2")
  317. {
  318. strurl = strUrlPort + "/webroot/decision/view/report?viewlet=RepDeliverySubBillDev.cpt&op=view" + "&subId=" + strDeliverySubId;
  319. }
  320. else
  321. {
  322. strurl = strUrlPort + "/webroot/decision/view/report?viewlet=RepDeliverySubBill.cpt&op=view" + "&subId=" + strDeliverySubId;
  323. }
  324. }
  325. else
  326. {
  327. //测试环境
  328. if (TipsEnv == "2")
  329. {
  330. strurl = strUrlPort + "/webroot/decision/view/report?viewlet=RepDeliverySubBillDev.cpt&op=view" + "&subId=" + strDeliverySubId;
  331. }
  332. else
  333. {
  334. strurl = strUrlPort + "/webroot/decision/view/report?viewlet=RepDeliverySubBill.cpt&op=view" + "&subId=" + strDeliverySubId;
  335. }
  336. }
  337. //if (ob.MainUrl.StartsWith("http://127.0.0.1"))
  338. //{
  339. // strurl = "http://localhost:8075/webroot/decision/view/report?viewlet=RepPurOrderDev.cpt&op=view" + "&cmbOrder=" + orderNo;
  340. //}
  341. //else
  342. //{
  343. // strurl = "http://localhost:8075/webroot/decision/view/report?viewlet=RepPurOrder.cpt&op=view" + "&cmbOrder=" + orderNo;
  344. //}
  345. FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
  346. fBug.AutoSize = true;
  347. fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  348. fBug.WindowState = FormWindowState.Maximized;
  349. fBug.Text = "TPCO送货单";
  350. fBug.Show();
  351. }
  352. finally
  353. {
  354. this.Cursor = Cursors.Default;
  355. }
  356. }
  357. /// <summary>
  358. /// 打印退货单
  359. /// </summary>
  360. private void doPrintReturn()
  361. {
  362. //
  363. MessageUtil.ShowTips("开发中");
  364. throw new NotImplementedException();
  365. }
  366. #endregion
  367. #region 界面事件
  368. private void GridSubM_AfterRowActivate(object sender, EventArgs e)
  369. {
  370. try
  371. {
  372. DTHandle.Clear();
  373. handledSubM.Clear();
  374. returnSubM.Clear();
  375. String strDeliverySubId = GridSubM.ActiveRow.Cells["DeliverySubId"].Value.ToString().Trim();
  376. if (!String.IsNullOrEmpty(strDeliverySubId))
  377. {
  378. doQuerySubLine(strDeliverySubId);
  379. }
  380. }
  381. catch (Exception ex)
  382. {
  383. MessageUtil.ShowTips("加载异常单数据异常:"+ex.Message);
  384. }
  385. finally
  386. {
  387. this.Cursor = Cursors.Default;
  388. }
  389. }
  390. private void GridHandle_AfterRowActivate(object sender, EventArgs e)
  391. {
  392. try
  393. {
  394. handledSubM.Clear();
  395. returnSubM.Clear();
  396. String strId = GridHandle.ActiveRow.GetCellValue("id").ToString().Trim();
  397. if (String.IsNullOrEmpty(strId))
  398. {
  399. MessageUtil.ShowTips("异常单号为空,或请刷新界面重试");
  400. return;
  401. }
  402. ExcDeliveryException hand = this.execute<ExcDeliveryException>("com.hnshituo.pur.ck.service.ExcDeliveryExceptionService", "findById", new object[] { strId });
  403. if (hand == null)
  404. {
  405. MessageUtil.ShowTips("未发现异常单:" + strId + "信息记录,可能已被删除,或请刷新界面重试");
  406. return;
  407. }
  408. if (hand.Validflag != "1")
  409. {
  410. MessageUtil.ShowTips("异常单:" + strId + "信息记录可能已被删除,或请刷新界面重试");
  411. return;
  412. }
  413. //加载让步接收单:
  414. if (!String.IsNullOrEmpty(hand.HandleSubId))
  415. {
  416. Hashtable map = new Hashtable();
  417. map.Add("deliverySubId", hand.HandleSubId);
  418. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.ExcDeliverySubMService", "doQueryDeliverySubMList", new object[] { map });
  419. GridHelper.CopyDataToDatatable(dt, DTHandleSubM, true);
  420. GridHelper.RefreshAndAutoSize(GridHandledSubM);
  421. }
  422. //加载退货单
  423. if (!String.IsNullOrEmpty(hand.ReturnedSubId))
  424. {
  425. ExcDeliveryReturn er = new ExcDeliveryReturn();
  426. er.ReturnId = hand.ReturnedSubId;
  427. er.Validflag = "1";
  428. DataTable dt2 = this.execute<DataTable>("com.hnshituo.pur.ck.service.ExcDeliveryReturnService", "doQuery_Return", new object[] { er });
  429. GridHelper.CopyDataToDatatable(dt2, DTReturnSubM, true);
  430. GridHelper.RefreshAndAutoSize(GridReturnedSubM);
  431. }
  432. }
  433. catch (Exception ex)
  434. {
  435. MessageUtil.ShowTips("加载处置单据异常:"+ex.Message);
  436. }
  437. }
  438. private void GridReturnedSubM_AfterRowActivate(object sender, EventArgs e)
  439. {
  440. try
  441. {
  442. DTReturnSubD.Clear();
  443. String strReturnId = GridReturnedSubM.ActiveRow.GetCellValue("RETURNID").ToString();
  444. if (!String.IsNullOrEmpty(strReturnId))
  445. {
  446. ExcDeliveryReturnC erc = new ExcDeliveryReturnC();
  447. erc.ReturnId = strReturnId;
  448. erc.Validflag = "1";
  449. DataTable dt3 = this.execute<DataTable>("com.hnshituo.pur.ck.service.ExcDeliveryReturnCService", "find", new object[] { erc, 0, 0 });
  450. GridHelper.CopyDataToDatatable(dt3, DTReturnSubD, true);
  451. GridHelper.RefreshAndAutoSize(GridReturnedSubD);
  452. }
  453. }
  454. catch (Exception ex)
  455. {
  456. MessageUtil.ShowTips("加载退货单行失败:" + ex.Message);
  457. }
  458. }
  459. private void GridHandledSubM_AfterRowActivate(object sender, EventArgs e)
  460. {
  461. try
  462. {
  463. DTHandleSubD.Clear();
  464. UltraGridRow uge = GridHandledSubM.ActiveRow;
  465. String strDeliverySubId = uge.GetCellValue("deliverySubId").ToString().Trim();
  466. if (!String.IsNullOrEmpty(strDeliverySubId))
  467. {
  468. ExcDeliverySubC EdSc = new ExcDeliverySubC();
  469. EdSc.DeliverySubId = strDeliverySubId;
  470. EdSc.Validflag = "1";
  471. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.ExcDeliverySubCService", "Query_C", new object[] { EdSc });
  472. GridHelper.CopyDataToDatatable(dt, DTHandleSubD, true);
  473. GridHelper.RefreshAndAutoSize(GridHandledSubD);
  474. }
  475. }
  476. catch (Exception ex)
  477. {
  478. MessageUtil.ShowTips("加载让步接收单行失败:" + ex.Message);
  479. }
  480. }
  481. private void GridHandle_InitializeRow(object sender, InitializeRowEventArgs e)
  482. {
  483. if (e.Row.Cells["status"].Value.ToString().Equals("已作废"))
  484. {
  485. e.Row.Appearance.ForeColor = Color.Red;
  486. }
  487. else if (e.Row.Cells["status"].Value.ToString().Equals("已处置"))
  488. {
  489. e.Row.Appearance.ForeColor = Color.Gray;
  490. }
  491. else
  492. {
  493. e.Row.Appearance.ForeColor = Color.Black;
  494. }
  495. }
  496. #endregion
  497. #region 公共函数
  498. /// <summary>
  499. /// 查询异常单信息
  500. /// </summary>
  501. /// <param name="strDeliverySubId"></param>
  502. private void doQuerySubLine(String strDeliverySubId)
  503. {
  504. if (String.IsNullOrEmpty(strDeliverySubId))
  505. {
  506. MessageUtil.ShowTips("送货单号为空");
  507. }
  508. ExcDeliveryException hand = new ExcDeliveryException();
  509. hand.DeliverySubId = strDeliverySubId;
  510. hand.Validflag = "1";
  511. if(txt_status.SelectedIndex!=-1)
  512. {
  513. //all:全部 wait:待处理 did:已处理
  514. String strStatus=txt_status.Value.ToString().Trim();
  515. if(strStatus=="wait")
  516. {
  517. hand.Status="1";
  518. }
  519. else if(strStatus=="did")
  520. {
  521. hand.Status="2";
  522. }
  523. }
  524. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.ExcDeliveryExceptionService", "doQuery_Exceptions", new object[] { hand });
  525. GridHelper.CopyDataToDatatable(dt, DTHandle, true);
  526. GridHelper.RefreshAndAutoSize(GridHandle);
  527. }
  528. /// <summary>
  529. /// 校验异常单
  530. /// </summary>
  531. /// <param name="strDeliverySubLineSqe"></param>
  532. /// <returns></returns>
  533. private bool testExceptionC(string strId, int i)
  534. {
  535. if (String.IsNullOrEmpty(strId))
  536. {
  537. MessageUtil.ShowTips("异常单号为空,或请刷新界面重试");
  538. return false;
  539. }
  540. ExcDeliveryException hand = this.execute<ExcDeliveryException>("com.hnshituo.pur.ck.service.ExcDeliveryExceptionService", "findById", new object[] { strId });
  541. if (hand == null)
  542. {
  543. MessageUtil.ShowTips("未发现异常单:" + strId + "信息记录,可能已被删除,或请刷新界面重试");
  544. return false;
  545. }
  546. if (hand.Validflag != "1")
  547. {
  548. MessageUtil.ShowTips("异常单:" + strId + "信息记录可能已被删除,或请刷新界面重试");
  549. return false;
  550. }
  551. if (i == 1)
  552. {
  553. if (hand.Status != "1")
  554. {
  555. MessageUtil.ShowTips("异常单:" + strId + "已处置,或请刷新界面重试");
  556. return false;
  557. }
  558. }
  559. else if (i == 2)
  560. {
  561. if (hand.Status != "2")
  562. {
  563. MessageUtil.ShowTips("异常单:" + strId + "不在已处置状态,或请刷新界面重试");
  564. return false;
  565. }
  566. }
  567. else
  568. {
  569. MessageUtil.ShowTips("参数异常");
  570. return false;
  571. }
  572. return true;
  573. }
  574. #endregion
  575. }
  576. }