示例#1
0
        public async Task <bool> CreateTradeForOrderAsync(decimal amount, string orderNo)
        {
            try {
                FinanceTradeDetail entity = new FinanceTradeDetail();
                entity.Amount           = amount;
                entity.FinanceAccountId = AbpSession.GetFinanceAccountId();
                entity.RefNo            = orderNo;
                entity.SerialNo         = GenerateTradeNo(TradeType.XF);
                entity.UserId           = AbpSession.GetUserId();
                await financeTradeDetailRepository.InsertAsync(entity);

                return(true);
            } catch (Exception ex) {
                Logger.Error(ex.Message);
                return(false);
            }
        }