public override object Do(object obj)
        {
            GetOrderOrgByCustomerBP bpObj = (GetOrderOrgByCustomerBP)obj;

            if (bpObj == null)
            {
                return(null);
            }

            CommonDTO dto = new CommonDTO();

            UFIDA.U9.CBO.SCM.Customer.Customer cust = UFIDA.U9.CBO.SCM.Customer.Customer.Finder.Find("Code=@Code and Org=@Org", new OqlParam("Code", bpObj.Cust_Code), new OqlParam("Org", Context.LoginOrg.ID));
            if (cust != null)
            {
                UFIDA.U9.Base.Organization.Organization org = UFIDA.U9.Base.Organization.Organization.Finder.Find("Code=@Code", new OqlParam("Code", cust.DescFlexField.PrivateDescSeg2));
                if (org != null)
                {
                    dto.ID   = org.ID;
                    dto.Code = org.Code;
                    dto.Name = org.Name;
                }
            }

            return(dto);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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.Customer.Customer holder = key.GetEntity() as UFIDA.U9.CBO.SCM.Customer.Customer;
            if (holder == null)
            {
                return;
            }

            #endregion
        }
Exemplo n.º 4
0
        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);
        }