示例#1
0
        public void AddUserAlipay(string userId, string alipayAccount)
        {
            var userManager = new BettingPointManager();
            var manager     = new UserAlipayManager();
            var old         = manager.GetUserAlipayByAccount(alipayAccount);

            if (old != null)
            {
                throw new Exception("您的账号已被其它用户绑定");
            }
            var entity = manager.GetUserAlipay(userId);

            if (entity != null)
            {
                entity.AlipayAccount = alipayAccount;
                manager.UpdateUserAlipay(entity);
            }
            else
            {
                manager.AddUserAlipay(new External.Domain.Entities.Authentication.UserAlipay
                {
                    AlipayAccount = alipayAccount,
                    UserId        = userId,
                    User          = userManager.LoadUser(userId),
                });
            }
        }
示例#2
0
        /// <summary>
        /// 后台取消绑定支付宝
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="alipayAccount"></param>
        public void CancelUserAlipay(string userId)
        {
            var userManager = new BettingPointManager();
            var manager     = new UserAlipayManager();
            var entity      = manager.GetUserAlipay(userId);

            if (entity != null)
            {
                manager.DeleteUserAlipay(entity);
            }
            else
            {
                throw new ArgumentException("此用户没有绑定支付宝");
            }
        }
示例#3
0
        public UserQueryInfo QueryUserByKey(string userId, string agentId)
        {
            var userManager = new UserBalanceManager();
            var reg         = userManager.QueryUserRegister(userId);

            if (reg == null)
            {
                throw new Exception("用户不存在");
            }
            if (!string.IsNullOrEmpty(agentId) && reg.AgentId != agentId)
            {
                throw new Exception(string.Format("用户{0}不属于您发展的用户", userId));
            }

            var balance = userManager.QueryUserBalance(userId);

            if (balance == null)
            {
                throw new Exception("用户账户不存在");
            }

            var realNameManager = new UserRealNameManager();
            var real            = realNameManager.GetUserRealName(userId);

            //var apliy = new AlipayLoginInfo();
            //var apliyCount = apliy.ApliyCount;
            var mobileManagr = new UserMobileManager();
            var mobile       = mobileManagr.GetUserMobile(userId);

            var fundManger         = new FundManager();
            var agentFreezeBalance = fundManger.QueryAgentFreezeBalanceByUserId(userId);
            var caibbFreezeBalance = 0M;

            if (balance.FreezeBalance > 0)
            {
                caibbFreezeBalance = balance.FreezeBalance - agentFreezeBalance;//网站冻结资金=总冻结资金-代理冻结资金;
            }
            var userAlipayManager = new UserAlipayManager();
            var userAlipy         = userAlipayManager.GetUserAlipay(userId);


            var userQQManager = new UserQQManager();
            var userQQ        = userQQManager.GetUserQQ(userId);

            var ocAgentManager = new OCAgentManager();
            var ocAgent        = ocAgentManager.QueryOCAgent(userId);

            return(new UserQueryInfo
            {
                DisplayName = reg.DisplayName,
                UserId = reg.UserId,
                RealName = real == null ? string.Empty : real.RealName,
                IdCardNumber = real == null ? string.Empty : real.IdCardNumber,
                Mobile = mobile == null ? string.Empty : mobile.Mobile,
                FillMoneyBalance = balance.FillMoneyBalance,
                BonusBalance = balance.BonusBalance,
                CommissionBalance = balance.CommissionBalance,
                ExpertsBalance = balance.ExpertsBalance,
                RedBagBalance = balance.RedBagBalance,
                FreezeBalance = caibbFreezeBalance,
                IsEnable = reg.IsEnable,
                AgentId = reg.AgentId,
                IsAgent = reg.IsAgent,
                CardType = "",
                ComeFrom = reg.ComeFrom,
                Email = "",
                IsFillMoney = reg.IsFillMoney,
                IsSettedEmail = true,
                IsSettedMobile = mobile == null ? false : mobile.IsSettedMobile,
                IsSettedRealName = real == null ? false : real.IsSettedRealName,
                RegisterIp = reg.RegisterIp,
                RegTime = reg.CreateTime,
                VipLevel = reg.VipLevel,
                CurrentDouDou = balance.CurrentDouDou,
                ApliyCount = userAlipy == null ? string.Empty : userAlipy.AlipayAccount,
                QQNumber = userQQ == null ? string.Empty : userQQ.QQ,
                CPSMode = ocAgent == null ? 0 : ocAgent.CPSMode,
                UserGrowth = balance.UserGrowth,
                CPSBalance = balance.CPSBalance
            });
        }