Esempio n. 1
0
        /// <summary>
        /// 变更金额
        /// </summary>
        /// <param name="money">金额</param>
        /// <param name="tradeType">交易类型</param>
        /// <param name="businessId">业务编号</param>
        /// <param name="note">备注</param>
        public AccountDetail ModifyMoney(decimal money, TradeType tradeType, string businessId, string note)
        {
            var accountDetail = new AccountDetail()
            {
                AccountId     = Id,
                BeforeBalance = Balance,
                AfterBalance  = GetAfterBalance(money),
                TradeType     = tradeType.Description(),
                TradeTime     = DateTime.Now,
                TradeMoney    = money,
                BusinessId    = businessId,
                Note          = note
            };

            accountDetail.Init();
            Balance = GetAfterBalance(money);
            Validate();
            accountDetail.Validate();
            return(accountDetail);
        }