Exemplo n.º 1
0
 public NewSummaryReportInfoCollection NewSummaryReport(DateTime startTime, DateTime endTime)
 {
     using (var userinfo = new UserBalanceManager())
     {
         return(userinfo.NewSummaryReport(startTime, endTime));
     }
 }
Exemplo n.º 2
0
        public string ResetUserBalancePwd(string userId)
        {
            var newPwd = string.Empty;

            //开启事务
            using (var biz = new GameBizBusinessManagement())
            {
                biz.BeginTran();

                var manager = new UserMobileManager();
                //var entity = manager.GetUserMobile(userId);
                //if (entity == null)
                //    throw new ArgumentException("此用户从未进行过手机认证");
                //if (entity.Mobile != mobileNumber)
                //    throw new ArgumentException("用户认证的手机号码不正确");

                var balanceManager = new UserBalanceManager();
                var balance        = balanceManager.QueryUserBalance(userId);
                if (balance == null)
                {
                    throw new ArgumentException("用户资金信息查询出错");
                }

                balance.Password = Encipherment.MD5(string.Format("{0}{1}", C_DefaultPassword, _gbKey)).ToUpper();
                balanceManager.UpdateUserBalance(balance);

                biz.CommitTran();
            }
            return(newPwd);
        }
Exemplo n.º 3
0
 public UserBalanceHistoryInfoCollection QueryUserBalanceHistoryList(string userId, DateTime startTime, DateTime endTime, int pageIndex, int pageSize)
 {
     using (var manager = new UserBalanceManager())
     {
         return(manager.QueryUserBalanceHistoryList(userId, startTime, endTime, pageIndex, pageSize));
     }
 }
Exemplo n.º 4
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));
        }
Exemplo n.º 5
0
 public void UpdateSiteService(UserSiteServiceInfo info)
 {
     using (var manager = new UserBalanceManager())
     {
         if (info.Id > 0)
         {
             var entity = manager.QueryUserSiteServiceById(info.Id);
             if (entity == null)
             {
                 throw new Exception("您还没有当前服务项");
             }
             entity.IsEnable   = info.IsEnable;
             entity.UpdateTime = DateTime.Now;
             manager.UpdateUserSiteService(entity);
         }
         else
         {
             var entity = new UserSiteService();
             entity.ExtendedOne = info.ExtendedOne;
             entity.ExtendedTwo = info.ExtendedTwo;
             entity.IsEnable    = info.IsEnable;
             entity.Remarks     = entity.Remarks;
             entity.UpdateTime  = DateTime.Now;
             entity.UserId      = info.UserId;
             entity.CreateTime  = DateTime.Now;
             entity.ServiceType = info.ServiceType;
             manager.AddUserSiteService(entity);
         }
     }
 }
Exemplo n.º 6
0
 public FinanceSettingsInfo GetFinanceSettingsByFinanceId(string FinanceId)
 {
     using (var manage = new UserBalanceManager())
     {
         return(manage.GetFinanceSettingsByFinanceId(FinanceId));
     }
 }
Exemplo n.º 7
0
 public SendMsgHistoryRecord_Collection QueryHistoryRecordCollection(string mobile, string status, DateTime startTime, DateTime endTime, int pageIndex, int pageSize)
 {
     using (var manager = new UserBalanceManager())
     {
         return(manager.QueryHistoryRecordCollection(mobile, status, startTime, endTime, pageIndex, pageSize));
     }
 }
Exemplo n.º 8
0
        //public void UpdateFinanceSettings(FinanceSettings entity)
        //{
        //    try
        //    {
        //        using (var manage = new UserBalanceManager())
        //        {
        //            manage.UpdateFinanceSettings(entity);
        //            //FinanceSettings fEntity = manage.GetFinanceSettingsByFinanceId(entity.FinanceId);
        //            //if (fEntity != null && fEntity.FinanceId > 0)
        //            //{
        //            //    if (fEntity.OperateType != entity.OperateType)
        //            //    {
        //            //        if (manage.IsExistFinance(entity.UserId, entity.OperateType))
        //            //        {
        //            //            throw new Exception("当前用户已存在,不能重复添加!");
        //            //        }
        //            //        else
        //            //        {
        //            //            manage.UpdateFinanceSettings(entity);
        //            //        }
        //            //    }
        //            //}
        //            //else
        //            //{
        //            //    throw new Exception("为查询到当前财务员记录!");
        //            //}
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        throw new Exception("保存数据失败,原因:" + ex.Message);
        //    }
        //}

        public FinanceSettingsInfo_Collection GetFinanceSettingsCollection(string userId, DateTime startTime, DateTime endTime, int pageIndex, int pageSize)
        {
            using (var manage = new UserBalanceManager())
            {
                return(manage.GetFinanceSettingsCollection(userId, startTime, endTime, pageIndex, pageSize));
            }
        }
Exemplo n.º 9
0
 public string GetCaiWuOperator()
 {
     using (var manage = new UserBalanceManager())
     {
         return(manage.GetCaiWuOperator());
     }
 }
Exemplo n.º 10
0
        public void LogOffUserAgent(string userId)
        {
            //开启事务
            using (var biz = new GameBizBusinessManagement())
            {
                biz.BeginTran();

                var manager = new UserBalanceManager();
                var reg     = manager.GetUserRegister(userId);
                if (reg == null)
                {
                    throw new Exception("不存在此用户:" + userId);
                }
                reg.IsAgent = false;
                manager.UpdateUserRegister(reg);

                var userManager = new UserManager();
                var user        = userManager.LoadUser(userId);
                if (user == null)
                {
                    throw new Exception("不存在此用户:" + userId);
                }
                var role = user.RoleList.FirstOrDefault(p => p.RoleId == "Agent");
                if (role != null)
                {
                    user.RoleList.Remove(role);
                }

                biz.CommitTran();
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// 恢复代理
        /// </summary>
        public void RecoveryAgent(string userId)
        {
            //开启事务
            using (var biz = new GameBizBusinessManagement())
            {
                biz.BeginTran();

                var manager  = new UserBalanceManager();
                var register = manager.LoadUserRegister(userId);
                if (register == null)
                {
                    throw new Exception("用户不存在");
                }
                var agent = new OCAgentManager().QueryOCAgent(userId);
                if (agent == null)
                {
                    throw new Exception("代理关系不存在");
                }

                register.IsAgent = true;
                manager.UpdateUserRegister(register);

                biz.CommitTran();
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// 关注
        /// </summary>
        /// <param name="activeUserId"></param>
        /// <param name="passiveUserId"></param>
        public void Attention_AfterTranCommit(string activeUserId, string passiveUserId)
        {
            if (string.IsNullOrEmpty(activeUserId) || string.IsNullOrEmpty(passiveUserId))
            {
                return;
            }
            UserBalanceManager userBalanceManger = new UserBalanceManager();
            var activeUserInfo = userBalanceManger.GetUserRegister(activeUserId);

            if (activeUserInfo == null)
            {
                return;
            }
            var paasiveUserInfo = userBalanceManger.GetUserRegister(passiveUserId);

            if (paasiveUserInfo == null)
            {
                return;
            }

            SiteMessageControllBusiness siteMsgBusiness = new SiteMessageControllBusiness();
            var array = new string[] { "[UserName]=" + activeUserInfo.DisplayName + "", "[AttentionUser]=" + paasiveUserInfo.DisplayName + "" };

            siteMsgBusiness.DoSendSiteMessage(activeUserInfo.UserId, string.Empty, "ON_User_Attention", array);
        }
Exemplo n.º 13
0
 public NewKPIDetailInfoCollection NewKPIDetailList(DateTime startTime, DateTime endTime)
 {
     using (var userinfo = new UserBalanceManager())
     {
         return(userinfo.NewKPIDetailList(startTime, endTime));
     }
 }
Exemplo n.º 14
0
 public UserBalanceReportInfoCollection QueryUserBalanceReportList(DateTime startTime, DateTime endTime, int pageIndex, int pageSize)
 {
     using (var manager = new UserBalanceManager())
     {
         return(manager.QueryUserBalanceReportList(startTime, endTime, pageIndex, pageSize));
     }
 }
Exemplo n.º 15
0
 public UserRegister GetRegisterById(string userId)
 {
     using (var manager = new UserBalanceManager())
     {
         var reg = manager.GetUserRegister(userId);
         return(reg);
     }
 }
Exemplo n.º 16
0
 public void UpdateUserVipLevel(string userId, int vipLevel)
 {
     using (var manager = new UserBalanceManager())
     {
         var user = manager.GetUserRegister(userId);
         user.VipLevel = vipLevel;
         manager.UpdateUserRegister(user);
     }
 }
Exemplo n.º 17
0
        /// <summary>
        /// 用户是否能参与活动,true:能参与,反之不能
        /// </summary>
        public bool IsUserJoinPrizeActivity(string userId, string schemeId)
        {
            if (string.IsNullOrEmpty(userId))
            {
                return(false);
            }
            //特殊用户
            var specialList = ConfigurationManager.AppSettings["SpecialUser"].Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);

            if (specialList.Contains(userId))
            {
                return(true);
            }

            var sportsManager = new Sports_Manager();
            var order         = sportsManager.QuerySports_Order_Complate(schemeId);

            if (order == null)
            {
                return(false);
            }
            var together = sportsManager.QuerySports_Together(order.SchemeId);

            if (together == null)
            {
                return(false);
            }
            if (together.SystemGuarantees > 0)
            {
                return(false);
            }
            var agentList = ConfigurationManager.AppSettings["JoinActivityAgent"].Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);

            if (agentList.Contains(userId))
            {
                return(false);
            }
            var manager = new UserBalanceManager();
            var user    = manager.GetUserRegister(userId);

            if (user == null)
            {
                return(false);
            }
            if (user.IsAgent == true)
            {
                return(false);
            }
            if (string.IsNullOrEmpty(user.AgentId))
            {
                return(true);
            }
            return(!agentList.Contains(user.AgentId));
        }
Exemplo n.º 18
0
        /// <summary>
        /// 指定代理注册的用户  路径
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public UserRegister QueryByUserIdReferrerUrl(string userid)
        {
            var referUrl    = new UserBalanceManager();
            var ReferrerUrl = referUrl.QueryUserRegister(userid);

            if (ReferrerUrl == null)
            {
                throw new Exception("用户不存在");
            }
            return(ReferrerUrl);
        }
Exemplo n.º 19
0
        /// <summary>
        /// 指定代理注册的用户  路径
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public UserRegister QueryUserRegisterByUserId(string userid)
        {
            var referUrl = new UserBalanceManager();
            var user     = referUrl.QueryUserRegister(userid);

            if (user == null)
            {
                new UserRegister();
            }
            return(user);
        }
Exemplo n.º 20
0
 public bool?CheckIsSame2BalancePassword(string userId, string newPassword)
 {
     using (var balanceManager = new UserBalanceManager())
     {
         var balance = balanceManager.QueryUserBalance(userId);
         if (balance == null)
         {
             return(null);
         }
         return(balance.Password.Equals(Encipherment.MD5(newPassword)));
     }
 }
Exemplo n.º 21
0
        public void UpdateProfileDynamic(string userId, string schemeId, string gameCode, string issuseNumber, decimal totalMoney, string dynamicType)
        {
            try
            {
                DB.Begin();

                var man = new Sports_Manager();
                var ub  = new UserBalanceManager();

                var together = man.QuerySports_Together(schemeId);
                var user2    = string.Empty;
                switch (dynamicType)
                {
                case "参与合买":
                    user2 = together.CreateUserId;
                    break;
                }

                var user1Name = ub.QueryUserRegister(userId);
                var user2Name = new C_User_Register();
                if (!string.IsNullOrEmpty(user2))
                {
                    user2Name = ub.QueryUserRegister(user2);
                }

                var entity = new E_Blog_Dynamic()
                {
                    UserId           = userId,
                    UserDisplayName  = user1Name.DisplayName,
                    UserId2          = user2,
                    User2DisplayName = string.IsNullOrEmpty(user2) ? "" : user2Name.DisplayName,
                    GameCode         = gameCode,
                    GameType         = together == null ? "" : together.GameType,
                    IssuseNumber     = issuseNumber,
                    DynamicType      = dynamicType,
                    Guarantees       = together == null ? 0 : together.Guarantees,
                    Price            = together == null ? 0M : together.Price,
                    Progress         = together == null ? 0M : together.Progress,
                    TotalMonery      = together == null ? 0M : together.TotalMoney,
                    SchemeId         = schemeId,
                    Subscription     = together == null ? 0 : together.Subscription,
                    CreateTime       = DateTime.Now,
                };
                var manager = new BlogManager();
                manager.AddBlog_Dynamic(entity);
                DB.Commit();
            }
            catch (Exception ex)
            {
                DB.Rollback();
                throw ex;
            }
        }
Exemplo n.º 22
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);
        }
Exemplo n.º 23
0
 public void ChangeUserHideDisplayNameCount(string userId, int hideDisplayNameCount)
 {
     using (var biz = new GameBizBusinessManagement())
     {
         biz.BeginTran();
         using (var manager = new UserBalanceManager())
         {
             var user = manager.GetUserRegister(userId);
             user.HideDisplayNameCount = hideDisplayNameCount;
             manager.UpdateUserRegister(user);
         }
         biz.CommitTran();
     }
 }
Exemplo n.º 24
0
 public UserSiteServiceInfo QueryUserSiteServiceById(int Id)
 {
     using (var manager = new UserBalanceManager())
     {
         UserSiteServiceInfo info = new UserSiteServiceInfo();
         var entity = manager.QueryUserSiteServiceById(Id);
         if (entity == null)
         {
             return(new UserSiteServiceInfo());
         }
         ObjectConvert.ConverEntityToInfo(entity, ref info);
         return(info);
     }
 }
Exemplo n.º 25
0
 public UserSiteServiceInfo QueryUserSiteServiceByUserId(string userId)
 {
     using (var manager = new UserBalanceManager())
     {
         UserSiteServiceInfo info = new UserSiteServiceInfo();
         var entity = manager.QueryUserSiteServiceByUserId(userId, ServiceType.DrawingNotice);
         if (entity == null)
         {
             return(null);
         }
         ObjectConvert.ConverEntityToInfo(entity, ref info);
         return(info);
     }
 }
Exemplo n.º 26
0
 public void UpdateDisplayName(string userId, string newDisplayName)
 {
     using (var biz = new GameBizBusinessManagement())
     {
         biz.BeginTran();
         using (var manager = new UserBalanceManager())
         {
             var user = manager.GetUserRegister(userId);
             user.DisplayName = newDisplayName;
             manager.UpdateUserRegister(user);
         }
         biz.CommitTran();
     }
 }
Exemplo n.º 27
0
        /// <summary>
        /// 每购彩100元增加成长值
        /// </summary>
        public void ComplateTicket(string userId, string schemeId, decimal totalMoney, decimal totalErrorMoney)
        {
            DB.Begin();
            try
            {
                var manager     = new SchemeManager();
                var orderDetail = manager.QueryOrderDetail(schemeId);
                if (orderDetail == null || orderDetail.SchemeType == (int)SchemeType.SaveScheme || orderDetail.SchemeType == (int)SchemeType.SingleTreasure || orderDetail.IsVirtualOrder)
                {
                    return;
                }

                //查询用户信息
                var userManager = new UserBalanceManager();
                var user        = userManager.LoadUserRegister(orderDetail.UserId);
                //赠送成长值
                var growthValue = GrowthValue(user.VipLevel, totalMoney);

                var currGrowth = manager.GetCurrDayGiveGrowth(userId);
                if (currGrowth >= 100)//每天赠送的成长值不能大于100
                {
                    return;
                }
                var sumGrowth = growthValue + currGrowth;
                if (sumGrowth > 100)
                {
                    growthValue = 100 - currGrowth;
                }

                if (growthValue > 0M)
                {
                    BusinessHelper.Payin_UserGrowth(BusinessHelper.FundCategory_BuyGrowthValue, schemeId, user.UserId, (int)Math.Round(growthValue), string.Format("购彩赠送成长值:{0}", (int)Math.Round(growthValue)));
                }

                //赠送豆豆
                var doudou = GetDoudou(user.VipLevel, totalMoney);
                if (doudou > 0M)
                {
                    BusinessHelper.Payin_OCDouDou(BusinessHelper.FundCategory_BuyDouDou, schemeId, user.UserId, (int)Math.Round(doudou), string.Format("购彩赠送豆豆:{0}", (int)Math.Round(doudou)));
                }

                DB.Commit();
            }
            catch (Exception ex)
            {
                DB.Rollback();
                throw ex;
            }
        }
Exemplo n.º 28
0
        public SiteSummaryInfo QuerySiteSummary()
        {
            var balanceManager = new UserBalanceManager();
            var fundManager    = new FundManager();
            var m = balanceManager.QueryCommonAndBonusMoney();

            return(new SiteSummaryInfo
            {
                TodayRegisterUserCount = balanceManager.QueryRegisterUserCount(),
                MonthTotalFillMoney = fundManager.QueryMonthFillMoney(),
                MonthTotalWithdraw = fundManager.QueryMonthWithdraw(),
                TotalCommonMoney = m.TotalCommonMoney,
                TotalBonusMoney = m.TotalBonusMoney,
            });
        }
Exemplo n.º 29
0
        public void SetBalancePassword(string userId, string oldPassword, bool isSetPwd, string newPassword)
        {
            var balanceManager = new UserBalanceManager();
            var entity         = balanceManager.QueryUserBalance(userId);

            if (entity.IsSetPwd)
            {
                oldPassword = Encipherment.MD5(string.Format("{0}{1}", oldPassword, _gbKey)).ToUpper();
                if (string.IsNullOrEmpty(oldPassword) || !oldPassword.Equals(entity.Password))
                {
                    throw new Exception("输入资金密码错误");
                }
            }
            entity.IsSetPwd = isSetPwd;
            entity.Password = Encipherment.MD5(string.Format("{0}{1}", newPassword, _gbKey)).ToUpper();
            balanceManager.UpdateUserBalance(entity);
        }
Exemplo n.º 30
0
        public void FinanceSetting(string opeType, FinanceSettingsInfo info, string operatorId)
        {
            try
            {
                using (var manage = new UserBalanceManager())
                {
                    if (info != null)
                    {
                        FinanceSettings entity = new FinanceSettings();
                        ObjectConvert.ConverInfoToEntity(info, ref entity);
                        entity.OperatorId = operatorId;
                        entity.CreateTime = DateTime.Now;
                        switch (opeType.ToLower())
                        {
                        case "add":
                            AddFinanceSettings(entity);
                            break;

                        case "update":
                            //UpdateFinanceSettings(entity);
                            manage.UpdateFinanceSettings(entity);
                            break;

                        case "delete":
                            manage.DeleteFinanceSettings(entity.FinanceId.ToString());
                            break;
                        }
                    }
                    else
                    {
                        if (opeType.ToLower() != "delete")
                        {
                            throw new Exception("保存数据失败!");
                        }
                        else
                        {
                            throw new Exception("删除数据失败!");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }