123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388 |
-
- namespace UFIDA.U9.Cust.Kusi.CJJ.Plugin.BE.BarCodeUsed
- {
- using System;
- using System.Collections.Generic;
- using System.Text;
- using UFIDA.U9.Base;
- using UFIDA.U9.Complete.CompleteBE.Pub_Util;
- using UFSoft.UBF.Business;
-
-
- public partial class Inserting
- {
- class WhBinInfo
- {
- public long WhID { get; set; }
- public string WhName { get; set; }
- public string WhCode { get; set; }
- public long BinID { get; set; }
- public string BinName { get; set; }
- public string BinCode { get; set; }
- public WhBinInfo()
- {
- WhID = -1;
- WhName = "";
- WhCode = "";
- BinID = -1;
- BinCode = "";
- BinName = "";
- }
- }
-
- private void Do_Notify(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.BC.BaseData.BarCodeUsed holder = key.GetEntity() as UFIDA.U9.BC.BaseData.BarCodeUsed;
- if (holder == null)
- return;
- #endregion
- WhBinInfo info = GetWhBinInfo(holder);
- holder.SetValue("Cust4Whid", info.WhID);
- holder.SetValue("Cust4Whcode", info.WhCode);
- holder.SetValue("Cust4Whname", info.WhName);
- holder.SetValue("Cust4Binid", info.BinID);
- holder.SetValue("Cust4Bincode", info.BinCode);
- holder.SetValue("Cust4Binname", info.BinName);
- holder.BarCodeMaster.SetValue("Cust4Whid", info.WhID);
- holder.BarCodeMaster.SetValue("Cust4Whcode", info.WhCode);
- holder.BarCodeMaster.SetValue("Cust4Whname", info.WhName);
- holder.BarCodeMaster.SetValue("Cust4Binid", info.BinID);
- holder.BarCodeMaster.SetValue("Cust4Bincode", info.BinCode);
- holder.BarCodeMaster.SetValue("Cust4Binname", info.BinName);
- }
- private WhBinInfo GetWhBinInfo(UFIDA.U9.BC.BaseData.BarCodeUsed holder)
- {
- WhBinInfo info = new WhBinInfo();
- if (holder.CreateEntity != null)
- {
- BusinessEntity entity = new BusinessEntity.EntityKey(holder.CreateEntity.EntityID, holder.CreateEntity.EntityType).GetEntity();
- if (entity != null)
- {
- switch (holder.CreateEntity.EntityType)
- {
- //case "UFIDA.U9.Complete.RCVRpt.RcvRptDocLine":
- // FromRcvRptDocLine(entity, info);
- // break;
- //case "UFIDA.U9.PM.Rcv.RcvLine":
- // FromRcvLine(entity, info);
- // break;
- //case "UFIDA.U9.InvDoc.MiscRcv.MiscRcvTransL":
- // FromMiscRcvTransL(entity, info);
- // break;
- //case "UFIDA.U9.InvDoc.TransferIn.TransInLine":
- // FromTransInLine(entity, info);
- // break;
- //case "UFIDA.U9.InvDoc.InventorySheet.InventSheetLine":
- // FromInventSheetLine(entity, info);
- // break;
- //case "UFIDA.U9.SM.Ship.ShipLine":
- // FromShipLine(entity, info);
- // break;
- //case "UFIDA.U9.InvDoc.MiscShip.MiscShipmentL":
- // FromMiscShipmentL(entity, info);
- // break;
- //case "UFIDA::U9::MO::Issue::IssueDocLine":
- // FromIssueDocLine(entity, info);
- // break;
- //case "UFIDA::U9::MO::Issue::IssueDocLineSum":
- // FromIssueDocLineSum(entity, info);
- // break;
- //case "UFIDA.U9.InvDoc.WhInit.WhInitLine":
- // FromWhInitLine(entity, info);
- // break;
- case "UFIDA.U9.InvDoc.TransferForm.TransferFormL":
- FromTransferFormLine(entity, info);
- break;
- //case "UFIDA.U9.InvDoc.TransferIn.TransInSubLine":
- // FromTransferFormSLine(entity, info);
- // break;
- }
- }
- }
- return info;
- }
- private void FromTransferFormLine(BusinessEntity entity, WhBinInfo info)
- {
- if (entity is UFIDA.U9.InvDoc.TransferForm.TransferFormL line)
- {
- if (line.Wh != null)
- {
- info.WhID = line.Wh.ID;
- info.WhCode = line.Wh.Code;
- info.WhName = line.Wh.Name;
- }
- if (line.BinInfo!=null)
- {
- if (line.BinInfo.Bin!=null)
- {
- info.BinID = line.BinInfo.Bin.ID;
- info.BinCode = line.BinInfo.Bin.Code;
- info.BinName = line.BinInfo.Bin.Name;
- }
-
- }
- }
- }
- private void FromTransferFormSLine(BusinessEntity entity, WhBinInfo info)
- {
- if (entity is UFIDA.U9.InvDoc.TransferIn.TransInSubLine subline)
- {
- if (subline.TransInLine.TransInWh != null)
- {
- info.WhID = subline.TransInLine.TransInWh.ID;
- info.WhCode = subline.TransInLine.TransInWh.Code;
- info.WhName = subline.TransInLine.TransInWh.Name;
- }
- if (subline.TransInLine.TransInBins != null)
- {
- foreach (var binInfo in subline.TransInLine.TransInBins)
- {
- info.BinID = binInfo.BinInfo.Bin.ID;
- info.BinCode = binInfo.BinInfo.Bin.Code;
- info.BinName = binInfo.BinInfo.Bin.Name;
- }
-
- }
- }
- }
- private void FromRcvRptDocLine(BusinessEntity entity, WhBinInfo info)
- {
- if (entity is Complete.RCVRpt.RcvRptDocLine line)
- {
- if (line.Wh != null)
- {
- info.WhID = line.Wh.ID;
- info.WhCode = line.Wh.Code;
- info.WhName = line.Wh.Name;
- }
- if (line.Bin != null)
- {
- info.BinID = line.Bin.ID;
- info.BinCode = line.Bin.Code;
- info.BinName = line.Bin.Name;
- }
- }
- }
- private void FromRcvLine(BusinessEntity entity, WhBinInfo info)
- {
- if (entity is PM.Rcv.RcvLine line)
- {
- if (line.Wh != null)
- {
- info.WhID = line.Wh.ID;
- info.WhCode = line.Wh.Code;
- info.WhName = line.Wh.Name;
- }
- if (line.RcvLineLocations.Count > 0)
- {
- if (line.RcvLineLocations[0].Location != null)
- {
- info.BinID = line.RcvLineLocations[0].Location.ID;
- info.BinCode = line.RcvLineLocations[0].Location.Code;
- info.BinName = line.RcvLineLocations[0].Location.Name;
- }
- }
- }
- }
- private void FromMiscRcvTransL(BusinessEntity entity, WhBinInfo info)
- {
- if (entity is InvDoc.MiscRcv.MiscRcvTransL line)
- {
- if (line.Wh != null)
- {
- info.WhID = line.Wh.ID;
- info.WhCode = line.Wh.Code;
- info.WhName = line.Wh.Name;
- }
- if (line.MiscRcvTransBins.Count > 0)
- {
- if (line.MiscRcvTransBins[0].BinInfo != null && line.MiscRcvTransBins[0].BinInfo.Bin != null)
- {
- info.BinID = line.MiscRcvTransBins[0].BinInfo.Bin.ID;
- info.BinCode = line.MiscRcvTransBins[0].BinInfo.Bin.Code;
- info.BinName = line.MiscRcvTransBins[0].BinInfo.Bin.Name;
- }
- }
- }
- }
- private void FromTransInLine(BusinessEntity entity, WhBinInfo info)
- {
- if (entity is InvDoc.TransferIn.TransInLine line)
- {
- if (line.TransInWh != null)
- {
- info.WhID = line.TransInWh.ID;
- info.WhCode = line.TransInWh.Code;
- info.WhName = line.TransInWh.Name;
- }
- if (line.TransInBins.Count > 0)
- {
- if (line.TransInBins[0].BinInfo != null && line.TransInBins[0].BinInfo.Bin != null)
- {
- info.BinID = line.TransInBins[0].BinInfo.Bin.ID;
- info.BinCode = line.TransInBins[0].BinInfo.Bin.Code;
- info.BinName = line.TransInBins[0].BinInfo.Bin.Name;
- }
- }
- }
- }
- private void FromInventSheetLine(BusinessEntity entity, WhBinInfo info)
- {
- if (entity is InvDoc.InventorySheet.InventSheetLine line)
- {
- if (line.InventorySheet.Wh != null)
- {
- info.WhID = line.InventorySheet.Wh.ID;
- info.WhCode = line.InventorySheet.Wh.Code;
- info.WhName = line.InventorySheet.Wh.Name;
- }
- if (line.Bin != null && line.Bin.Bin != null)
- {
- info.BinID = line.Bin.Bin.ID;
- info.BinCode = line.Bin.Bin.Code;
- info.BinName = line.Bin.Bin.Name;
- }
- }
- }
- private void FromShipLine(BusinessEntity entity, WhBinInfo info)
- {
- if (entity is SM.Ship.ShipLine line)
- {
- if (line.WH != null)
- {
- info.WhID = line.WH.ID;
- info.WhCode = line.WH.Code;
- info.WhName = line.WH.Name;
- }
- if (line.ShipLineLocations.Count > 0)
- {
- if (line.ShipLineLocations[0].Location != null)
- {
- info.BinID = line.ShipLineLocations[0].Location.ID;
- info.BinCode = line.ShipLineLocations[0].Location.Code;
- info.BinName = line.ShipLineLocations[0].Location.Name;
- }
- }
- }
- }
- private void FromMiscShipmentL(BusinessEntity entity, WhBinInfo info)
- {
- if (entity is InvDoc.MiscShip.MiscShipmentL line)
- {
- if (line.Wh != null)
- {
- info.WhID = line.Wh.ID;
- info.WhCode = line.Wh.Code;
- info.WhName = line.Wh.Name;
- }
- if (line.MiscShipBins.Count > 0)
- {
- if (line.MiscShipBins[0].BinInfo != null && line.MiscShipBins[0].BinInfo.Bin != null)
- {
- info.BinID = line.MiscShipBins[0].BinInfo.Bin.ID;
- info.BinCode = line.MiscShipBins[0].BinInfo.Bin.Code;
- info.BinName = line.MiscShipBins[0].BinInfo.Bin.Name;
- }
- }
- }
- }
- private void FromIssueDocLine(BusinessEntity entity, WhBinInfo info)
- {
- if (entity is MO.Issue.IssueDocLine line)
- {
- if (line.Wh != null)
- {
- info.WhID = line.Wh.ID;
- info.WhCode = line.Wh.Code;
- info.WhName = line.Wh.Name;
- }
- if (line.Bin != null)
- {
- info.BinID = line.Bin.ID;
- info.BinCode = line.Bin.Code;
- info.BinName = line.Bin.Name;
- }
- }
- }
- private void FromIssueDocLineSum(BusinessEntity entity, WhBinInfo info)
- {
- if (entity is MO.Issue.IssueDocLineSum line)
- {
- if (line.Wh != null)
- {
- info.WhID = line.Wh.ID;
- info.WhCode = line.Wh.Code;
- info.WhName = line.Wh.Name;
- }
- if (line.Bin != null)
- {
- info.BinID = line.Bin.ID;
- info.BinCode = line.Bin.Code;
- info.BinName = line.Bin.Name;
- }
- }
- }
- private void FromWhInitLine(BusinessEntity entity, WhBinInfo info)
- {
- if (entity is InvDoc.WhInit.WhInitLine line)
- {
- if (line.Wh != null)
- {
- info.WhID = line.Wh.ID;
- info.WhCode = line.Wh.Code;
- info.WhName = line.Wh.Name;
- }
- if (line.WhInitLineBins.Count > 0)
- {
- if (line.WhInitLineBins[0].Bin != null && line.WhInitLineBins[0].Bin.Bin != null)
- {
- info.BinID = line.WhInitLineBins[0].Bin.Bin.ID;
- info.BinCode = line.WhInitLineBins[0].Bin.Bin.Code;
- info.BinName = line.WhInitLineBins[0].Bin.Bin.Name;
- }
- }
- }
- }
- }
- }
|