Ejemplo n.º 1
0
        /// <summary>
        /// 增加银行卡信息
        /// </summary>
        /// <param name="bankCard"></param>
        /// <param name="userToken"></param>
        /// <returns></returns>
        public CommonActionResult AddBankCard(BankCardInfo bankCard, string userToken)
        {
            // 验证用户身份及权限
            var userId = GameBizAuthBusiness.ValidateUserAuthentication(userToken);

            try
            {
                var entity = new BankCardManager().BankCardByCode(bankCard.BankCardNumber);
                if (entity != null)
                {
                    throw new Exception("该银行卡号已经被其他用户绑定,请选择其它银行卡号");
                }
                if (string.IsNullOrEmpty(bankCard.UserId) || bankCard.UserId == null || bankCard.UserId.Length == 0)
                {
                    bankCard.UserId = userId;
                }

                var bankcarduser = new BankCardManager().BankCardById(userId);
                if (bankcarduser != null)
                {
                    throw new Exception("您已绑定了银行卡,请不要重复绑定!");
                }
                new BankCardBusiness().AddBankCard(bankCard);
                new CacheDataBusiness().ClearUserBindInfoCache(userId);
                //绑定银行卡之后实现接口
                BusinessHelper.ExecPlugin <IAddBankCard>(new object[] { bankCard.UserId, bankCard.BankCardNumber, bankCard.BankCode, bankCard.BankName, bankCard.BankSubName, bankCard.CityName, bankCard.ProvinceName, bankCard.RealName });
                return(new CommonActionResult(true, "添加银行卡信息成功"));
            }
            catch (Exception ex)
            {
                throw new Exception("添加银行卡信息出错 - " + ex.Message, ex);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 手工充值
        /// </summary>
        public CommonActionResult ManualFillMoney(UserFillMoneyAddInfo info, string userId, string userToken)
        {
            // 验证用户身份及权限
            var requestUserId = GameBizAuthBusiness.ValidateUserAuthentication(userToken);

            try
            {
                var orderId  = string.Empty;
                var vipLevel = 0;
                //lock (UsefullHelper.moneyLocker)
                //{
                orderId = new FundBusiness().ManualFillMoney(info, userId, requestUserId, out vipLevel);

                BusinessHelper.ExecPlugin <ICompleteFillMoney_AfterTranCommit>(new object[] { orderId, FillMoneyStatus.Success, FillMoneyAgentType.ManualFill, info.RequestMoney, userId, vipLevel });
                //}
                return(new CommonActionResult
                {
                    IsSuccess = true,
                    Message = "手工充值完成",
                    ReturnValue = orderId,
                });
            }
            catch (Exception ex)
            {
                throw new Exception("手工充值出现错误 - " + ex.Message, ex);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 拒绝提现
        /// </summary>
        public CommonActionResult RefusedWithdrawByUserId(string orderId, string refusedMsg, string userId)
        {
            try
            {
                //lock (UsefullHelper.moneyLocker)
                //{
                using (var tran = new GameBizBusinessManagement())
                {
                    tran.BeginTran();
                    //! 执行扩展功能代码 - 启动事务后
                    BusinessHelper.ExecPlugin <IRefuseWithdraw_AfterTranBegin>(new object[] { orderId });
                    new FundBusiness().RefusedWithdraw(orderId, refusedMsg, userId);

                    //! 执行扩展功能代码 - 提交事务前
                    BusinessHelper.ExecPlugin <IRefuseWithdraw_BeforeTranCommit>(new object[] { orderId });
                    tran.CommitTran();
                }
                //}
                return(new CommonActionResult(true, "拒绝提现成功"));
            }
            catch (Exception ex)
            {
                throw new Exception("拒绝提现出错 - " + ex.Message, ex);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 成功提现
        /// </summary>
        public CommonActionResult CompleteWithdraw(string orderId, string responseMsg, string userToken)
        {
            // 验证用户身份及权限
            var userId = GameBizAuthBusiness.ValidateUserAuthentication(userToken);

            try
            {
                //lock (UsefullHelper.moneyLocker)
                //{
                using (var tran = new GameBizBusinessManagement())
                {
                    tran.BeginTran();
                    //! 执行扩展功能代码 - 启动事务后
                    BusinessHelper.ExecPlugin <ICompleteWithdraw_AfterTranBegin>(new object[] { orderId });
                    new FundBusiness().CompleteWithdraw(orderId, responseMsg, userId);

                    //! 执行扩展功能代码 - 提交事务前
                    BusinessHelper.ExecPlugin <ICompleteWithdraw_BeforeTranCommit>(new object[] { orderId });
                    tran.CommitTran();
                }
                //}
                return(new CommonActionResult(true, "完成提现成功"));
            }
            catch (Exception ex)
            {
                throw new Exception("完成提现出错 - " + ex.Message, ex);
            }
        }
Ejemplo n.º 5
0
        public CommonActionResult UserFillMoneyByUserId(UserFillMoneyAddInfo info, string userId, string agentId)
        {
            try
            {
                //! 执行扩展功能代码 - 启动事务前
                BusinessHelper.ExecPlugin <IRequestFillMoney_BeforeTranBegin>(new object[] { info, userId, userId });

                var orderId = string.Empty;
                //! 执行扩展功能代码 - 启动事务后
                BusinessHelper.ExecPlugin <IRequestFillMoney_AfterTranBegin>(new object[] { info, userId, userId });

                orderId = new FundBusiness().UserFillMoney(info, userId, userId, agentId);

                //! 执行扩展功能代码 - 提交事务前
                BusinessHelper.ExecPlugin <IRequestFillMoney_BeforeTranCommit>(new object[] { info, userId, userId });

                //! 执行扩展功能代码 - 提交事务后
                BusinessHelper.ExecPlugin <IRequestFillMoney_AfterTranCommit>(new object[] { info, userId, userId });

                return(new CommonActionResult
                {
                    IsSuccess = true,
                    Message = "提交充值完成",
                    ReturnValue = string.Format("{0}|{1}", orderId, info.PayMoney),
                });
            }
            catch (Exception ex)
            {
                //! 执行扩展功能代码 - 发生异常
                BusinessHelper.ExecPlugin <IRequestFillMoney_OnError>(new object[] { info, userId, ex });

                throw new Exception("用户充值出现错误 - " + ex.Message, ex);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 手工完成充值
        /// </summary>
        public CommonActionResult ManualCompleteFillMoneyOrder(string orderId, FillMoneyStatus status, string userToken)
        {
            // 验证用户身份及权限
            var myId = GameBizAuthBusiness.ValidateUserAuthentication(userToken);

            string userId = "";

            try
            {
                //! 执行扩展功能代码 - 启动事务前
                //BusinessHelper.ExecPlugin<ICompleteFillMoney_BeforeTranBegin>(new object[] { orderId, status, userId });
                var vipLevel = 0;
                //lock (UsefullHelper.moneyLocker)
                //{
                FillMoneyAgentType agentType;
                decimal            money;

                //! 执行扩展功能代码 - 启动事务后
                //BusinessHelper.ExecPlugin<ICompleteFillMoney_AfterTranBegin>(new object[] { orderId, status, userId });
                userId = new FundBusiness().ManualCompleteFillMoneyOrder(orderId, status, out agentType, out money, out vipLevel, myId);

                //! 执行扩展功能代码 - 提交事务前
                //BusinessHelper.ExecPlugin<ICompleteFillMoney_BeforeTranCommit>(new object[] { orderId, status, agentType, money, userId });
                //! 执行扩展功能代码 - 提交事务后
                BusinessHelper.ExecPlugin <ICompleteFillMoney_AfterTranCommit>(new object[] { orderId, status, agentType, money, userId, vipLevel });
                //}
                return(new CommonActionResult
                {
                    IsSuccess = true,
                    Message = "手工完成充值成功",
                });
            }
            catch (LogicException ex)
            {
                //! 执行扩展功能代码 - 发生异常
                BusinessHelper.ExecPlugin <ICompleteFillMoney_OnError>(new object[] { orderId, status, userId, ex });
                return(new CommonActionResult
                {
                    IsSuccess = true,
                    Message = "充值订单重复处理",
                });
            }
            catch (Exception ex)
            {
                //! 执行扩展功能代码 - 发生异常
                BusinessHelper.ExecPlugin <ICompleteFillMoney_OnError>(new object[] { orderId, status, userId, ex });

                throw new Exception("手工完成充值 出现错误 - " + ex.Message, ex);
            }
        }
Ejemplo n.º 7
0
        public CommonActionResult Sports_Betting(Sports_BetingInfo info, string password, decimal redBagMoney, string userid)
        {
            try
            {
                //检查彩种是否暂停销售
                KaSon.FrameWork.ORM.Helper.BusinessHelper.CheckGameEnable(info.GameCode.ToUpper());
                BettingHelper.CheckGameCodeAndType(info.GameCode, info.GameType);
                // 验证用户身份及权限
                //var userId = GameBizAuthBusiness.ValidateUserAuthentication(userToken);

                //栓查是否实名
                //if (!BusinessHelper.IsUserValidateRealName(userId))
                //    throw new LogicException("未实名认证用户不能购买彩票");

                CheckJCRepeatBetting(userid, info);
                //检查投注内容,并获取投注注数
                var totalCount = BusinessHelper.CheckBetCode(userid, info.GameCode.ToUpper(), info.GameType.ToUpper(), info.SchemeSource, info.PlayType, info.Amount, info.TotalMoney, info.AnteCodeList);
                //检查投注的比赛,并获取最早结束时间
                var stopTime = RedisMatchBusiness.CheckGeneralBettingMatch(info.GameCode.ToUpper(), info.GameType.ToUpper(), info.PlayType, info.AnteCodeList, info.IssuseNumber, info.BettingCategory);

                string schemeId = string.Empty;
                //lock (UsefullHelper.moneyLocker)
                //{
                schemeId = new Sports_Business().SportsBetting(info, userid, password, "Bet", totalCount, stopTime, redBagMoney);
                //}
                //! 执行扩展功能代码 - 提交事务后
                BusinessHelper.ExecPlugin <IBettingSport_AfterTranCommit>(new object[] { userid, info, schemeId });

                return(new CommonActionResult
                {
                    IsSuccess = true,
                    ReturnValue = schemeId + "|" + info.TotalMoney,
                    Message = "足彩投注成功",
                });
            }
            //catch (AggregateException ex)
            //{
            //    throw new AggregateException(ex.Message);
            //}
            catch (LogicException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new Exception("订单投注异常,请重试 ", ex);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 支付宝充值免手续费
        /// </summary>
        public CommonActionResult CompleteFillMoneyOrderFeeFree(string orderId, FillMoneyStatus status, decimal money, string code, string msg, string outerFlowId, DateTime alipayTime, string userToken)
        {
            // 验证用户身份及权限
            var myId = GameBizAuthBusiness.ValidateUserAuthentication(userToken);

            try
            {
                //! 执行扩展功能代码 - 启动事务前
                //BusinessHelper.ExecPlugin<ICompleteFillMoney_BeforeTranBegin>(new object[] { orderId, status, money, myId });

                //lock (UsefullHelper.moneyLocker)
                //{
                string             userId;
                bool               needContinue = false;
                FillMoneyAgentType agentType;
                var vipLevel = 0;
                //! 执行扩展功能代码 - 启动事务后
                //BusinessHelper.ExecPlugin<ICompleteFillMoney_AfterTranBegin>(new object[] { orderId, status, money, myId });
                needContinue = new FundBusiness().CompleteFillMoneyOrderFeeFree(orderId, status, money, code, msg, outerFlowId, alipayTime, out agentType, out userId, out vipLevel);
                if (needContinue)
                {
                    //! 执行扩展功能代码 - 提交事务前
                    //BusinessHelper.ExecPlugin<ICompleteFillMoney_BeforeTranCommit>(new object[] { orderId, status, agentType, money, userId });
                }
                if (needContinue)
                {
                    //! 执行扩展功能代码 - 提交事务后
                    BusinessHelper.ExecPlugin <ICompleteFillMoney_AfterTranCommit>(new object[] { orderId, status, agentType, money, userId, vipLevel });
                }
                //}
                return(new CommonActionResult
                {
                    IsSuccess = true,
                    Message = "充值完成",
                });
            }
            catch (Exception ex)
            {
                //! 执行扩展功能代码 - 发生异常
                BusinessHelper.ExecPlugin <ICompleteFillMoney_OnError>(new object[] { orderId, status, myId, ex });

                throw new Exception("完成充值出现错误 - " + ex.Message, ex);
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 修改隐藏名称数
        /// </summary>
        /// <param name="hideDisplayNameCount"></param>
        /// <param name="userToken"></param>
        /// <returns></returns>
        public CommonActionResult ChangeUserHideDisplayNameCount(int hideDisplayNameCount, string userToken)
        {
            // 验证用户身份及权限
            var userId = GameBizAuthBusiness.ValidateUserAuthentication(userToken);

            try
            {
                var biz = new UserBusiness();
                biz.ChangeUserHideDisplayNameCount(userId, hideDisplayNameCount);

                BusinessHelper.ExecPlugin <IChangeHideDisplayNameCount_AfterTranCommit>(new object[] { userId, hideDisplayNameCount });

                return(new CommonActionResult(true, "操作成功"));
            }
            catch (Exception ex)
            {
                //! 执行扩展功能代码 - 发生异常
                throw new Exception(string.Format("修改隐藏名称数失败 - {0} ! ", ex.Message), ex);
            }
        }
Ejemplo n.º 10
0
        public CommonActionResult SetBalancePassword(string oldPassword, bool isSetPwd, string newPassword, string userToken)
        {
            // 验证用户身份及权限
            var userId = GameBizAuthBusiness.ValidateUserAuthentication(userToken);

            try
            {
                var biz = new FundBusiness();
                biz.SetBalancePassword(userId, oldPassword, isSetPwd, newPassword);

                BusinessHelper.ExecPlugin <IBalancePassword>(new object[] { userId, oldPassword, isSetPwd, newPassword });
                return(new CommonActionResult {
                    IsSuccess = true, Message = "操作资金密码完成"
                });
            }
            catch (Exception ex)
            {
                throw new Exception("操作资金密码出错 - " + ex.Message, ex);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 足彩投注,用户保存的订单
        /// </summary>
        public CommonActionResult SaveOrderSportsBettingByResult(Sports_BetingInfo info, string userid)
        {
            // 验证用户身份及权限
            //var userId = GameBizAuthBusiness.ValidateUserAuthentication(userToken);

            try
            {
                //栓查是否实名
                //if (!BusinessHelper.IsUserValidateRealName(userId))
                //    throw new LogicException("未实名认证用户不能购买彩票");

                CheckDisableGame(info.GameCode, info.GameType);
                BettingHelper.CheckGameCodeAndType(info.GameCode, info.GameType);

                // 检查订单基本信息
                BettingHelper.CheckSchemeOrder(info);

                string schemeId = new Sports_Business().SaveOrderSportsBetting(info, userid);

                //! 执行扩展功能代码 - 提交事务后
                BusinessHelper.ExecPlugin <IBettingSport_AfterTranCommit>(new object[] { userid, info, schemeId });

                return(new CommonActionResult
                {
                    IsSuccess = true,
                    ReturnValue = schemeId + "|" + info.TotalMoney,
                    Message = "保存订单成功",
                });
            }
            catch (LogicException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new Exception("保存订单异常,请重试 ", ex);
            }
        }