123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using UFSoft.UBF.Business;
- namespace UFIDA.U9.Cust.Kusi.CJJ.Plugin.BE.TransferIn
- {
- public class DocCheck : UFSoft.UBF.Eventing.IEventSubscriber
- {
- public void Notify(params object[] args)
- {
- #region 从事件参数中取得当前业务实体
- if (args == null || args.Length == 0 || !(args[0] is UFSoft.UBF.Business.EntityEvent))
- return;
- BusinessEntity.EntityKey key = ((UFSoft.UBF.Business.EntityEvent)args[0]).EntityKey;
- if (key == null)
- return;
- UFIDA.U9.InvDoc.TransferIn.TransferIn holder = key.GetEntity() as UFIDA.U9.InvDoc.TransferIn.TransferIn;
- if (holder == null)
- return;
- #endregion
- foreach (var line in holder.TransInLines)
- {
- if (holder.TransferInType.Value == 1 && line.TransInWh != null && line.TransInWh.DescFlexField.PrivateDescSeg1.ToUpper().Equals("FALSE"))
- {
- continue;
- }
- else
- {
- if (line.TransInWh != null)
- {
- if (line.TransInWh.DescFlexField.PrivateDescSeg1.ToUpper().Equals("TRUE") && !Base.Context.LoginUser.Contains("PDA"))
- {
- throw new Exception(string.Format("单号{0},{1}行的存储地点为条码管理,请扫码出货。", holder.DocNo, line.DocLineNo));
- }
- }
- foreach (var subLine in line.TransInSubLines)
- {
- if (subLine.TransOutWh != null)
- {
- if (subLine.TransOutWh.DescFlexField.PrivateDescSeg1.ToUpper().Equals("TRUE") && !Base.Context.LoginUser.Contains("PDA"))
- {
- throw new Exception(string.Format("单号{0},{1}行的存储地点为条码管理,请扫码出货。", holder.DocNo, line.DocLineNo));
- }
- }
- }
- }
-
- }
- }
- }
- }
|