예제 #1
0
        /// <summary>
        /// 冻结需要充值的金额,并生成一条游戏充值数据存入游戏交易表中,返回订单号
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="money"></param>
        /// <returns></returns>
        public CommonActionResult FreezeGameRecharge(string userId, decimal money, string userDisplayName)
        {
            var orderId = BettingHelper.GetGameTransferId();
            var msg     = string.Format("游戏充值订单号{0}", orderId);

            DB.Begin();
            try
            {
                BusinessHelper.Payout_To_Frozen(BusinessHelper.FundCategory_GameRecharge, userId, orderId, money, msg, "GameTransfer", "");
                DB.GetDal <C_Game_Transfer>().Add(new C_Game_Transfer()
                {
                    OrderId         = orderId,
                    RequestMoney    = money,
                    RequestTime     = DateTime.Now,
                    Status          = (int)FillMoneyStatus.Requesting,
                    UserId          = userId,
                    TransferType    = (int)GameTransferType.Recharge,
                    UserDisplayName = userDisplayName
                });
                DB.Commit();
            }
            catch (Exception ex)
            {
                DB.Rollback();
                throw ex;
            }
            return(new CommonActionResult()
            {
                IsSuccess = true, ReturnValue = orderId
            });
        }