/// <summary>
        /// 后台取消绑定QQ
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="qq"></param>
        public void CancelUserQQ(string userId)
        {
            var userManager = new BettingPointManager();
            var manager     = new UserQQManager();
            var entity      = manager.GetUserQQ(userId);

            if (entity != null)
            {
                manager.DeleteUserQQ(entity);
            }
            else
            {
                throw new ArgumentException("此用户没有绑定QQ号码");
            }
        }
        /// <summary>
        /// 用户添加qq
        /// </summary>
        public void AddUserQQ(string userId, string qq)
        {
            var userManager = new BettingPointManager();
            var manager     = new UserQQManager();
            var entity      = manager.GetUserQQ(userId);

            if (entity != null)
            {
                entity.QQ = qq;
                manager.UpdateUserQQ(entity);
            }
            else
            {
                manager.AddUserQQ(new UserQQ
                {
                    QQ     = qq,
                    UserId = userId,
                    User   = userManager.LoadUser(userId),
                });
            }
        }
示例#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
            });
        }