public override object Do(object obj) { GetCurrencyBP bpObj = (GetCurrencyBP)obj; if (bpObj == null) { return(null); } CurrencyDTO dto = new CurrencyDTO(); //获取主账簿币种 if (bpObj.IsDefault) { } //获取供应商默认币种 if (bpObj.Supplier > 0L) { UFIDA.U9.CBO.SCM.Supplier.Supplier doc = UFIDA.U9.CBO.SCM.Supplier.Supplier.Finder.FindByID(bpObj.Supplier); if (doc != null && doc.TradeCurrency != null) { dto.ID = doc.TradeCurrency.ID; dto.Code = doc.TradeCurrency.Code; dto.Name = doc.TradeCurrency.Name; dto.Symbol = doc.TradeCurrency.Symbol; dto.MoneyRound_Precision = doc.TradeCurrency.MoneyRound.Precision; dto.MoneyRound_RoundType = doc.TradeCurrency.MoneyRound.RoundType.Value; dto.MoneyRound_RoundValue = doc.TradeCurrency.MoneyRound.RoundValue; dto.PriceRound_Precision = doc.TradeCurrency.PriceRound.Precision; dto.PriceRound_RoundType = doc.TradeCurrency.PriceRound.RoundType.Value; dto.PriceRound_RoundValue = doc.TradeCurrency.PriceRound.RoundValue; } } //获取客户默认币种 if (bpObj.Customer > 0L) { UFIDA.U9.CBO.SCM.Customer.Customer doc = UFIDA.U9.CBO.SCM.Customer.Customer.Finder.FindByID(bpObj.Supplier); if (doc != null && doc.TradeCurrency != null) { dto.ID = doc.TradeCurrency.ID; dto.Code = doc.TradeCurrency.Code; dto.Name = doc.TradeCurrency.Name; dto.Symbol = doc.TradeCurrency.Symbol; dto.MoneyRound_Precision = doc.TradeCurrency.MoneyRound.Precision; dto.MoneyRound_RoundType = doc.TradeCurrency.MoneyRound.RoundType.Value; dto.MoneyRound_RoundValue = doc.TradeCurrency.MoneyRound.RoundValue; dto.PriceRound_Precision = doc.TradeCurrency.PriceRound.Precision; dto.PriceRound_RoundType = doc.TradeCurrency.PriceRound.RoundType.Value; dto.PriceRound_RoundValue = doc.TradeCurrency.PriceRound.RoundValue; } } return(dto); }
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.CBO.SCM.Supplier.Supplier holder = key.GetEntity() as UFIDA.U9.CBO.SCM.Supplier.Supplier; if (holder == null) { return; } #endregion }
public override object Do(object obj) { GetCurrencyBP bpObj = (GetCurrencyBP)obj; //get business operation context is as follows //IContext context = ContextManager.Context //auto generating code end,underside is user custom code //and if you Implement replace this Exception Code... if (bpObj == null) { return(null); } CurrencyDTO dto = new CurrencyDTO(); switch (bpObj.Type) { case 0: //获取默认币种 break; case 1: //根据指定币种获取币种信息 if (bpObj.ID > 0L) { UFIDA.U9.Base.Currency.Currency currency = UFIDA.U9.Base.Currency.Currency.Finder.FindByID(bpObj.ID); if (currency != null) { dto.ID = currency.ID; dto.Code = currency.Code; dto.Name = currency.Name; dto.Symbol = currency.Symbol; dto.MoneyRound_Precision = currency.MoneyRound.Precision; dto.MoneyRound_RoundType = currency.MoneyRound.RoundType.Value; dto.MoneyRound_RoundValue = currency.MoneyRound.RoundValue; dto.PriceRound_Precision = currency.PriceRound.Precision; dto.PriceRound_RoundType = currency.PriceRound.RoundType.Value; dto.PriceRound_RoundValue = currency.PriceRound.RoundValue; } } break; case 2: //根据供应商获取币种 if (bpObj.ID > 0L) { UFIDA.U9.CBO.SCM.Supplier.Supplier doc = UFIDA.U9.CBO.SCM.Supplier.Supplier.Finder.FindByID(bpObj.ID); if (doc != null && doc.TradeCurrency != null) { dto.ID = doc.TradeCurrency.ID; dto.Code = doc.TradeCurrency.Code; dto.Name = doc.TradeCurrency.Name; dto.Symbol = doc.TradeCurrency.Symbol; dto.MoneyRound_Precision = doc.TradeCurrency.MoneyRound.Precision; dto.MoneyRound_RoundType = doc.TradeCurrency.MoneyRound.RoundType.Value; dto.MoneyRound_RoundValue = doc.TradeCurrency.MoneyRound.RoundValue; dto.PriceRound_Precision = doc.TradeCurrency.PriceRound.Precision; dto.PriceRound_RoundType = doc.TradeCurrency.PriceRound.RoundType.Value; dto.PriceRound_RoundValue = doc.TradeCurrency.PriceRound.RoundValue; } } break; case 3: //根据客户获取币种 //获取客户默认币种 if (bpObj.ID > 0L) { UFIDA.U9.CBO.SCM.Customer.Customer doc = UFIDA.U9.CBO.SCM.Customer.Customer.Finder.FindByID(bpObj.ID); if (doc != null && doc.TradeCurrency != null) { dto.ID = doc.TradeCurrency.ID; dto.Code = doc.TradeCurrency.Code; dto.Name = doc.TradeCurrency.Name; dto.Symbol = doc.TradeCurrency.Symbol; dto.MoneyRound_Precision = doc.TradeCurrency.MoneyRound.Precision; dto.MoneyRound_RoundType = doc.TradeCurrency.MoneyRound.RoundType.Value; dto.MoneyRound_RoundValue = doc.TradeCurrency.MoneyRound.RoundValue; dto.PriceRound_Precision = doc.TradeCurrency.PriceRound.Precision; dto.PriceRound_RoundType = doc.TradeCurrency.PriceRound.RoundType.Value; dto.PriceRound_RoundValue = doc.TradeCurrency.PriceRound.RoundValue; } } break; case 4: //根据 break; } return(dto); }