예제 #1
0
 public UserQueryInfoCollection QueryUserList_AdminCPS(DateTime regFrom, DateTime regTo, string keyType, string keyValue, bool?isEnable, bool?isFillMoney, bool?isAgent
                                                       , string commonBlance, string bonusBlance, string freezeBlance, string vipRange, string comeFrom, string agentId, int ocAgentCategory, int pageIndex, int pageSize, string strOrderBy)
 {
     using (var manager = new LoginLocalManager())
     {
         int     totalCount;
         decimal totalFillMoneyBalance;
         decimal totalBonusBalance;
         decimal totalCommissionBalance;
         decimal totalExpertsBalance;
         decimal totalFreezeBalance;
         decimal totalRedBagBalance;
         decimal totalCPSBalance;
         int     totalDouDou;
         var     list = manager.QueryUserList_AdminCPS(regFrom, regTo, keyType, keyValue, isEnable, isFillMoney, isAgent, commonBlance, bonusBlance, freezeBlance, vipRange, comeFrom, agentId, ocAgentCategory, pageIndex, pageSize,
                                                       out totalCount, out totalFillMoneyBalance, out totalBonusBalance, out totalCommissionBalance, out totalExpertsBalance, out totalFreezeBalance, out totalRedBagBalance, out totalDouDou, out totalCPSBalance, strOrderBy);
         var collection = new UserQueryInfoCollection
         {
             TotalCount             = totalCount,
             TotalFillMoneyBalance  = totalFillMoneyBalance,
             TotalBonusBalance      = totalBonusBalance,
             TotalCommissionBalance = totalCommissionBalance,
             TotalExpertsBalance    = totalExpertsBalance,
             TotalFreezeBalance     = totalFreezeBalance,
             TotalRedBagBalance     = totalRedBagBalance,
             TotalDouDou            = totalDouDou,
             TotalCPSBalance        = totalCPSBalance
         };
         collection.LoadList(list);
         return(collection);
     }
 }
예제 #2
0
 public int GetTodayRegisterCount(DateTime date, string ip)
 {
     using (var loginManager = new LoginLocalManager())
     {
         return(loginManager.GetTodayRegisterCount(date, ip));
     }
 }
예제 #3
0
        public string GetUserId(string loginName)
        {
            var loginManager = new LoginLocalManager();
            var info         = loginManager.GetLoginByName(loginName);

            return(info == null ? string.Empty : info.UserId);
        }
예제 #4
0
 public List <string> QueryFunctionByRole(string[] arrayRole)
 {
     using (var manager = new LoginLocalManager())
     {
         return(manager.QueryFunctionByRole(arrayRole));
     }
 }
예제 #5
0
 //根据手机号查询用户编号
 public UserMobile_Collection QueryUserIDByMobile(string arrayMobile)
 {
     using (var manager = new LoginLocalManager())
     {
         return(manager.QueryUserIDByMobile(arrayMobile));
     };
 }
예제 #6
0
        public void Register(LoginLocal loginEntity, string userId)
        {
            if (loginEntity.Password == null)
            {
                loginEntity.Password = C_DefaultPassword;
            }
            loginEntity.Password = Encipherment.MD5(string.Format("{0}{1}", loginEntity.Password, _gbKey)).ToUpper();

            using (var biz = new GameBiz.Business.GameBizBusinessManagement())
            {
                biz.BeginTran();
                using (var loginManager = new LoginLocalManager())
                {
                    var tmp = loginManager.GetLoginByName(loginEntity.LoginName);
                    if (tmp != null)
                    {
                        throw new AuthException("登录名已经存在 - " + loginEntity.LoginName);
                    }
                    loginEntity.User     = loginManager.LoadUser(userId);
                    loginEntity.Register = loginManager.LoadRegister(userId);
                    loginManager.Register(loginEntity);
                }
                biz.CommitTran();
            }
        }
예제 #7
0
        public string ChangePassword(string userId)
        {
            var r                      = new Random(DateTime.Now.Millisecond);
            var password               = r.Next(100000, 999999).ToString();
            var encodePassword         = Encipherment.MD5(string.Format("{0}{1}", password, _gbKey)).ToUpper();
            var password_balance       = r.Next(100000, 999999).ToString();
            var encodePassword_balance = Encipherment.MD5(string.Format("{0}{1}", password_balance, _gbKey)).ToUpper();

            using (var biz = new GameBiz.Business.GameBizBusinessManagement())
            {
                biz.BeginTran();

                var loginManager = new LoginLocalManager();
                var user         = loginManager.GetLoginByUserId(userId);
                if (user == null)
                {
                    throw new AuthException("用户不存在或不是本地注册用户,不能修改密码。请确定是否是通过支付宝或QQ帐号进行登录,如有疑问,请联系客服。");
                }
                user.Password = encodePassword;
                loginManager.UpdateLogin(user);

                var balanceManage = new UserBalanceManager();
                var b             = balanceManage.QueryUserBalance(userId);
                b.Password = encodePassword_balance;
                balanceManage.UpdateUserBalance(b);

                biz.CommitTran();
            }
            return(string.Format("{0}|{1}", password, password_balance));
        }
예제 #8
0
 public LoginLocal GetUserByLoginName(string loginName)
 {
     using (var loginManager = new LoginLocalManager())
     {
         var user = loginManager.GetLoginByName(loginName);
         if (user == null)
         {
             throw new AuthException("用户不存在或不是本地注册用户。请确定是否是通过支付宝或QQ帐号进行登录,如有疑问,请联系客服。");
         }
         return(user);
     }
 }
예제 #9
0
 public bool?CheckIsSame2LoginPassword(string userId, string newPassword)
 {
     using (var loginManager = new LoginLocalManager())
     {
         var user = loginManager.GetLoginByUserId(userId);
         if (user == null)
         {
             return(null);
         }
         return(user.Password.ToUpper().Equals(Encipherment.MD5(string.Format("{0}{1}", newPassword, _gbKey)).ToUpper()));
     }
 }
예제 #10
0
        public UserBindInfos QueryUserBindInfos(string userId)
        {
            var user = new UserBalanceManager().QueryUserRegister(userId);

            if (user == null || user.IsEnable == false)
            {
                return(new UserBindInfos());
            }

            var info = new LoginLocalManager().QueryUserBindInfos(userId);

            return(info);
        }
예제 #11
0
 public ManagerQueryInfoCollection QueryBackgroundManagerList(string key, int pageIndex, int pageSize)
 {
     using (var manager = new LoginLocalManager())
     {
         int totalCount;
         var list       = manager.QueryBackgroundManagerList(key, pageIndex, pageSize, out totalCount);
         var collection = new ManagerQueryInfoCollection
         {
             TotalCount = totalCount,
         };
         collection.LoadList(list);
         return(collection);
     }
 }
예제 #12
0
        public LoginLocal LoginByUserId(string userId)
        {
            LoginLocal loginInfo = null;

            using (var loginManager = new LoginLocalManager())
            {
                loginInfo = loginManager.GetLoginByUserId(userId);
                if (loginInfo != null && loginInfo.User != null)
                {
                    NHibernate.NHibernateUtil.Initialize(loginInfo.User.RoleList);
                    NHibernate.NHibernateUtil.Initialize(loginInfo.Register);
                }
            }
            return(loginInfo);
        }
예제 #13
0
 public UserQueryInfoCollection QueryTogetherHotUserList(DateTime createFrom, DateTime createTo, string keyType, string keyValue,
                                                         int pageIndex, int pageSize)
 {
     using (var manager = new LoginLocalManager())
     {
         int totalCount;
         var list       = manager.QueryTogetherHotUserList(createFrom, createTo, keyType, keyValue, pageIndex, pageSize, out totalCount);
         var collection = new UserQueryInfoCollection
         {
             TotalCount = totalCount
         };
         collection.LoadList(list);
         return(collection);
     }
 }
예제 #14
0
 public string GetLoginNameIsExsite(string loginName)
 {
     using (var loginManager = new LoginLocalManager())
     {
         var user = loginManager.GetLoginByName(loginName);
         if (user == null)
         {
             return("");
         }
         else
         {
             return(user.LoginName);
         }
     }
 }
예제 #15
0
        public LoginLocal Login(string loginName, string password)
        {
            password = Encipherment.MD5(string.Format("{0}{1}", password, _gbKey)).ToUpper();

            LoginLocal loginInfo = null;

            using (var loginManager = new LoginLocalManager())
            {
                loginInfo = loginManager.Login(loginName, password);
                if (loginInfo != null && loginInfo.User != null)
                {
                    NHibernate.NHibernateUtil.Initialize(loginInfo.User.RoleList);
                    NHibernate.NHibernateUtil.Initialize(loginInfo.Register);
                }
            }
            return(loginInfo);
        }
예제 #16
0
        public LoginLocal LoginAPP(string loginName, string password)
        {
            //password = Encipherment.MD5(password);

            LoginLocal loginInfo = null;

            using (var loginManager = new LoginLocalManager())
            {
                loginInfo = loginManager.Login(loginName, password);
                if (loginInfo != null && loginInfo.User != null)
                {
                    NHibernate.NHibernateUtil.Initialize(loginInfo.User.RoleList);
                    NHibernate.NHibernateUtil.Initialize(loginInfo.Register);
                }
            }
            return(loginInfo);
        }
예제 #17
0
        public void ResetUserPassword(string userId)
        {
            var newPassword = Encipherment.MD5(string.Format("{0}{1}", C_DefaultPassword, _gbKey)).ToUpper();

            using (var biz = new GameBiz.Business.GameBizBusinessManagement())
            {
                biz.BeginTran();
                using (var loginManager = new LoginLocalManager())
                {
                    var user = loginManager.GetLoginByUserId(userId);
                    if (user == null)
                    {
                        throw new AuthException("用户不是本地注册用户,不允许修改密码。请确定是否是通过支付宝或QQ帐号进行登录,如有疑问,请联系客服。");
                    }
                    user.Password = newPassword;
                    loginManager.UpdateLogin(user);
                }
                biz.CommitTran();
            }
        }
예제 #18
0
 public ManagerQueryInfo QueryBackgroundManagerByKey(string key)
 {
     using (var manager = new LoginLocalManager())
     {
         var reg = manager.GetRegisterByKey(key);
         if (reg == null)
         {
             return(null);
         }
         var roleIdList = reg.User.RoleList.Select((r) => r.RoleId).ToList();
         var info       = new ManagerQueryInfo
         {
             UserId      = reg.UserId,
             DisplayName = reg.DisplayName,
             RoleIdList  = string.Join(", ", roleIdList.ToArray()),
         };
         var user = manager.GetLoginByUserId(reg.UserId);
         info.LoginName = user.LoginName;
         return(info);
     }
 }
예제 #19
0
        public bool IsFillMoney(string userId, DateTime time)
        {
            var manager           = new LoginLocalManager();
            var resManager        = new RestrictionsBetMoneyManager();
            var isAuthenFillMoney = new CacheDataBusiness().QueryCoreConfigByKey("IsAuthenFillMoney").ConfigValue == "1";

            if (isAuthenFillMoney)//判断是否需要实名、手机认证后充值
            {
                var mobile   = new MobileAuthenticationBusiness().QueryMobileByUserId(userId);
                var realName = new RealNameAuthenticationBusiness().QueryRealNameByUserId(userId);
                if (mobile == null || realName == null || !mobile.IsSettedMobile || string.IsNullOrEmpty(mobile.Mobile) || !realName.IsSettedRealName || string.IsNullOrEmpty(realName.RealName))
                {
                    return(false);
                }
                return(true);
            }
            return(true);
            //var isBet = resManager.IsBet(userId);
            //if (isBet)
            //    return true;
            //else
            //    return manager.IsFillMoney(userId, time);
        }