Ejemplo n.º 1
0
        private void InitBlog_ProfileBonusLevel(string userId)
        {
            var manager = new BlogManager();
            var BlogProfileBonusLevel = new E_Blog_ProfileBonusLevel
            {
                UserId                     = userId,
                MaxLevelName               = "幸运彩民",
                MaxLevelValue              = 0,
                TotalBonusMoney            = 0,
                UpdateTime                 = DateTime.Now,
                WinHundredMillionCount     = 0,
                WinOneHundredCount         = 0,
                WinOneHundredThousandCount = 0,
                WinOneMillionCount         = 0,
                WinOneThousandCount        = 0,
                WinTenMillionCount         = 0,
                WinTenThousandCount        = 0,
            };

            manager.AddBlog_ProfileBonusLevel(BlogProfileBonusLevel);

            var BlogDataReport = new E_Blog_DataReport
            {
                CreateSchemeCount = 0,
                JoinSchemeCount   = 0,
                TotalBonusCount   = 0,
                TotalBonusMoney   = 0,
                UpdateTime        = DateTime.Now,
                UserId            = userId,
            };

            manager.AddBlog_DataReport(BlogDataReport);
        }
Ejemplo n.º 2
0
        ///// <summary>
        ///// 分享推广 购彩 送红包
        ///// </summary>
        ///// <param name="userId"></param>
        //public void FirstLotteryGiveRedBag(string userId)
        //{
        //    using (var biz = new GameBizBusinessManagement())
        //    {
        //        biz.BeginTran();
        //        //分享推广 购彩 送红包
        //        //购彩了 且是通过分享注册的用户 没有送红包 就执行分享推广活动
        //        var entityBankCard = new BankCardManager().BankCardById(userId);
        //        var entityShareSpread = new BlogManager().QueryBlog_UserShareSpread(userId);
        //        if (entityBankCard != null && entityShareSpread != null && !entityShareSpread.isGiveLotteryRedBag)
        //        {
        //            //购彩了 没有给分享者送活动红包 就执行送红包 只送一次
        //            var giveFillMoney = decimal.Parse(Activity.Business.ActivityCache.QueryActivityConfig("ActivityConfig.FirstLotteryGiveRedBagTofxid").ConfigValue);
        //            if (giveFillMoney > 0)
        //            {
        //                BusinessHelper.Payin_To_Balance(AccountType.RedBag, BusinessHelper.FundCategory_Activity, entityShareSpread.AgentId, Guid.NewGuid().ToString("N"), giveFillMoney
        //                                  , string.Format("{1}用户购彩了赠送红包给分享推广用户{0}元", giveFillMoney, userId), RedBagCategory.FxidRegister);

        //                entityShareSpread.isGiveLotteryRedBag = true;
        //                entityShareSpread.UpdateTime = DateTime.Now;
        //                entityShareSpread.giveRedBagMoney = entityShareSpread.giveRedBagMoney + giveFillMoney;
        //                new BlogManager().UpdateBlog_UserShareSpread(entityShareSpread);
        //            }
        //        }
        //        biz.CommitTran();
        //    }
        //}

        /// <summary>
        /// 分享推广 购彩 送红包(满x元送z元红包)
        /// </summary>
        /// <param name="userId"></param>
        public void FirstLotteryGiveRedBag(string userId, decimal totalMoney)
        {
            try
            {
                DB.Begin();
                //分享推广 购彩 送红包
                //购彩了 且是通过分享注册的用户 没有送红包 就执行分享推广活动
                //var entityBankCard = new BankCardManager().BankCardById(userId);
                /*entityBankCard != null */
                var entityShareSpread = new BlogManager().QueryBlog_UserShareSpread(userId);

                var satisfyFillMoney = decimal.Parse(ActivityCache.QueryActivityConfig("ActivityConfig.SatisfyLotteryGiveRedBagTofxid"));
                if (entityShareSpread != null && !entityShareSpread.isGiveLotteryRedBag && totalMoney >= satisfyFillMoney)
                {
                    //购彩了 没有给分享者送活动红包 就执行送红包 只送一次
                    var giveFillMoney = decimal.Parse(ActivityCache.QueryActivityConfig("ActivityConfig.FirstLotteryGiveRedBagTofxid"));
                    if (giveFillMoney > 0)
                    {
                        BusinessHelper.Payin_To_Balance(AccountType.RedBag, BusinessHelper.FundCategory_Activity, entityShareSpread.AgentId, Guid.NewGuid().ToString("N"), giveFillMoney
                                                        , string.Format("{1}用户购彩超过{2}元,赠送红包给分享推广用户{0}元", giveFillMoney, userId, satisfyFillMoney), RedBagCategory.FxidRegister);

                        entityShareSpread.isGiveLotteryRedBag = true;
                        entityShareSpread.UpdateTime          = DateTime.Now;
                        entityShareSpread.giveRedBagMoney     = entityShareSpread.giveRedBagMoney + giveFillMoney;
                        new BlogManager().UpdateBlog_UserShareSpread(entityShareSpread);
                    }
                }
                DB.Commit();
            }
            catch (Exception ex)
            {
                DB.Rollback();
                throw ex;
            }
        }
Ejemplo n.º 3
0
 public void FirstOrderShareRegisterRedBag(string schemeId)
 {
     try
     {
         DB.Begin();
         var schemeInfo = new OrderQuery().QuerySportsSchemeInfo(schemeId);
         if (schemeInfo != null && schemeInfo.BonusStatus != BonusStatus.Win || schemeInfo.PreTaxBonusMoney == 0)
         {
             return;
         }
         //分享推广 购彩 送红包
         //购彩了 且是通过分享注册的用户 没有送红包 就执行分享推广活动
         //var entityBankCard = new BankCardManager().BankCardById(userId);
         //var entityShareSpread = new BlogManager().QueryBlog_UserShareSpread(userId);
         //if (entityBankCard != null && entityShareSpread != null && !entityShareSpread.isGiveLotteryRedBag)
         //{
         //购彩了 没有给分享者送活动红包 就执行送红包 只送一次
         var shareGiveRedBagPre = decimal.Parse(ActivityCache.QueryActivityConfig("ActivityConfig.WinningShareGiveRedBag"));
         var business           = new BlogManager();
         var oldmodel           = business.QueryBlog_OrderShareRegisterRedBag(schemeId, schemeInfo.UserId);
         if (oldmodel != null)
         {
             if (!oldmodel.IsGiveRegisterRedBag && shareGiveRedBagPre > 0)
             {
                 var giveFillMoney = schemeInfo.PreTaxBonusMoney * shareGiveRedBagPre / 100;
                 BusinessHelper.Payin_To_Balance(AccountType.RedBag, BusinessHelper.FundCategory_Activity, schemeInfo.UserId, Guid.NewGuid().ToString("N"), giveFillMoney
                                                 , string.Format("分享中奖订单{0},加奖红包:{1}元", schemeId, giveFillMoney.ToString("f2")), RedBagCategory.OrderRegister);
                 oldmodel.IsGiveRegisterRedBag = true;
             }
             //更新条数
             oldmodel.RegisterCount += 1;
             oldmodel.UpdateTime     = DateTime.Now;
             business.UpdateBlog_OrderShareRegisterRedBag(oldmodel);
         }
         else
         {
             var flag          = false;
             var giveFillMoney = 0m;
             if (shareGiveRedBagPre > 0)
             {
                 //发奖
                 giveFillMoney = schemeInfo.PreTaxBonusMoney * shareGiveRedBagPre / 100;
                 BusinessHelper.Payin_To_Balance(AccountType.RedBag, BusinessHelper.FundCategory_Activity, schemeInfo.UserId, Guid.NewGuid().ToString("N"), giveFillMoney
                                                 , string.Format("分享中奖订单{0},加奖红包:{1}元", schemeId, giveFillMoney), RedBagCategory.OrderRegister);
                 flag = true;
             }
             //插入数据库
             var newmodel = new E_Blog_OrderShareRegisterRedBag()
             {
                 CreateTime           = DateTime.Now,
                 IsGiveRegisterRedBag = flag,
                 RedBagMoney          = giveFillMoney,
                 RedBagPre            = shareGiveRedBagPre,
                 UpdateTime           = DateTime.Now,
                 RegisterCount        = 1,
                 SchemeId             = schemeId,
                 UserId = schemeInfo.UserId
             };
             business.Add_OrderShareRegisterRedBag(newmodel);
         }
         DB.Commit();
     }
     catch (Exception ex)
     {
         DB.Rollback();
         throw ex;
     }
 }
Ejemplo n.º 4
0
        public CommonActionResult UserRegister(RegisterInfo_Local regInfo, string fxid)
        {
            DB.Begin();
            try
            {
                string userId  = null;
                var    roleIds = ConfigHelper.AllConfigInfo["PageRegisterDefaultRole"].ToString().Split(',');
                #region 注册权限控制帐号

                var authBiz    = new GameBizAuthBusiness();
                var regBiz     = new RegisterBusiness();
                var userEntity = new SystemUser
                {
                    RegFrom = string.IsNullOrEmpty(regInfo.ComeFrom) ? "LOCAL" : regInfo.ComeFrom,
                    AgentId = regInfo.AgentId,
                };
                regBiz.RegisterUser(userEntity, roleIds);
                userId = userEntity.UserId;

                #endregion

                #region 注册核心系统显示帐号

                var userRegInfo = new UserRegInfo
                {
                    DisplayName = regInfo.LoginName,
                    ComeFrom    = string.IsNullOrEmpty(regInfo.ComeFrom) ? "LOCAL" : regInfo.ComeFrom,
                    Referrer    = regInfo.Referrer,
                    ReferrerUrl = regInfo.ReferrerUrl,
                    RegisterIp  = regInfo.RegisterIp,
                    RegType     = regInfo.RegType,
                    AgentId     = regInfo.AgentId,
                };

                regBiz.RegisterUser(userEntity, userRegInfo);

                #endregion

                #region 注册本地登录帐号

                var loginBiz    = new LocalLoginBusiness();
                var loginEntity = new LoginLocal
                {
                    LoginName = regInfo.LoginName,
                    Password  = regInfo.Password,
                    mobile    = regInfo.Mobile
                };
                loginBiz.Register(loginEntity, userEntity.UserId);

                #endregion

                #region 如果是通过代理链接注册,则设置用户返点 屏蔽:范
                if (!string.IsNullOrEmpty(regInfo.AgentId))
                {
                    SetUserRebate(userId, regInfo.AgentId);
                }

                #endregion

                #region 初始化用户战绩数据和中奖概率数据

                InitUserBeedingAndBounsPercent(userId);

                #endregion

                #region 初始化其它数据

                InitBlog_ProfileBonusLevel(userId);
                InitUserAttentionSummary(userId);

                #endregion

                #region fxid分享推广数据
                if (!string.IsNullOrEmpty(fxid))
                {
                    var manager = new BlogManager();
                    manager.AddBlog_UserShareSpread(new E_Blog_UserShareSpread
                    {
                        UserId               = userId,
                        AgentId              = fxid,
                        CreateTime           = DateTime.Now,
                        isGiveLotteryRedBag  = false,
                        isGiveRegisterRedBag = false,
                        UpdateTime           = DateTime.Now,
                        giveRedBagMoney      = 0,
                        isGiveRechargeRedBag = false
                    });
                }
                #endregion

                DB.Commit();

                return(new CommonActionResult
                {
                    IsSuccess = true,
                    Message = "注册成功",
                    ReturnValue = userId,
                });
            }
            catch (Exception ex) {
                DB.Rollback();
                throw ex;
            }
        }