DocCheck.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using UFSoft.UBF.Business;
  7. namespace UFIDA.U9.Cust.Kusi.CJJ.Plugin.BE.MiscShipment
  8. {
  9. public class DocCheck : UFSoft.UBF.Eventing.IEventSubscriber
  10. {
  11. public void Notify(params object[] args)
  12. {
  13. #region 从事件参数中取得当前业务实体
  14. if (args == null || args.Length == 0 || !(args[0] is UFSoft.UBF.Business.EntityEvent))
  15. return;
  16. BusinessEntity.EntityKey key = ((UFSoft.UBF.Business.EntityEvent)args[0]).EntityKey;
  17. if (key == null)
  18. return;
  19. UFIDA.U9.InvDoc.MiscShip.MiscShipment holder = key.GetEntity() as UFIDA.U9.InvDoc.MiscShip.MiscShipment;
  20. if (holder == null)
  21. return;
  22. #endregion
  23. //审核时出入库单据审核控制条码仓
  24. foreach (var line in holder.MiscShipLs)
  25. {
  26. if (line.Wh != null)
  27. {
  28. if (line.Wh.DescFlexField.PrivateDescSeg1.ToUpper().Equals("TRUE") && !Base.Context.LoginUser.Contains("PDA"))
  29. {
  30. throw new Exception(string.Format("单号{0},{1}行的存储地点为条码管理,请扫码出货。", holder.DocNo, line.DocLineNo));
  31. }
  32. }
  33. }
  34. }
  35. }
  36. }