Exemple #1
0
        /// <summary>
        /// 撤销投注
        /// </summary>
        /// <param name="betcode"></param>
        private void CannelBettNum(string betcode)
        {
            if (string.IsNullOrEmpty(betcode))
            {
                AppGlobal.RenderResult(ApiCode.Fail);
                return;
            }
            IBetDetailService betDetailService = IoC.Resolve <IBetDetailService>();
            //验证请求参数是否正确
            var fs = betDetailService.Where(item => item.BetCode == betcode).FirstOrDefault();

            if (null == fs)
            {
                AppGlobal.RenderResult(ApiCode.Fail);
                return;
            }
            //撤单处理
            fs.Stauts = BetResultType.SysCancel;
            betDetailService.Save();

            //返还金额
            ISysUserBalanceService sysUserBalanceService = IoC.Resolve <ISysUserBalanceService>();
            var details = new SysUserBalanceDetail()
            {
                RelevanceNo = fs.BetCode,
                SerialNo    = "b" + Utils.BuilderNum(),
                Status      = 0,
                TradeAmt    = fs.TotalAmt,
                TradeType   = TradeType.撤单返款,
                UserId      = fs.UserId
            };

            sysUserBalanceService.UpdateUserBalance(details, fs.TotalAmt);
        }
Exemple #2
0
 public MessageRequestManager(IMessageService messageService,
                              IBetDetailService mbetDetailService, ILotteryIssueService lotteryIssueService)
 {
     this.mMessageService      = messageService;
     this.mBetDetailService    = mbetDetailService;
     this.mLotteryIssueService = lotteryIssueService;
 }
        private BetList GetBetting()
        {
            string betCode = Request.Params["betcode"];

            IBetDetailService detailService = IoC.Resolve <IBetDetailService>();

            return(detailService.GetBetDetailForBetCode(betCode));
        }
        /// <summary>
        /// 签到
        /// </summary>
        private string Sign()
        {
            int state = 1;

            if (!Utils.HasAvtivityDateTimes())
            {
                state = 5;
                return(state.ToString());
            }


            //验证当前用户当天投注是否达到条件
            DateTime          startTime         = Utils.GetNowBeginDate();
            DateTime          endTime           = Utils.GetNowEndDate();
            IBetDetailService betDetailServices = IoC.Resolve <IBetDetailService>();
            var totalAmt = 0m;

            int[] whereStates = new int[] { 1, 2 };
            var   sumResult   = betDetailServices.Where(c => c.UserId == this.CookUserInfo.Id && c.OccDate >= startTime && c.OccDate <= endTime && whereStates.Contains((int)c.Stauts));

            if (sumResult.Any())
            {
                totalAmt = sumResult.Sum(c => c.TotalAmt);
            }
            if (totalAmt > Convert.ToDecimal(System.Configuration.ConfigurationManager.AppSettings["sign"]))
            {
                ISignService signServices = IoC.Resolve <ISignService>();
                //查询今天是否已经签到过
                int occday = Utils.GetActivityOccDay();
                if (signServices.Where(c => c.Uid == CookUserInfo.Id && c.OccDay == occday).Count() < 1)
                {
                    signServices.Create(new BasicModel.Act.Sign()
                    {
                        OccDay = occday,
                        Uid    = CookUserInfo.Id
                    });
                    signServices.Save();
                    state = 0;
                }
                else
                {
                    state = 3;
                }
            }
            else
            {
                state = 2;
            }

            return(state.ToString());
        }
Exemple #5
0
        private BetList GetBetting()
        {
            string betCode = Request.Params["betcode"];

            IBetDetailService detailService = IoC.Resolve <IBetDetailService>();

            if (betCode.StartsWith("h"))
            {
                return(detailService.GetBetDetailForAhyCode(betCode));
            }
            else
            {
                return(detailService.GetBetDetailForBetCode(betCode));
            }
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="sysUserService"></param>
 /// <param name="sysQuotaService"></param>
 /// <param name="sysUserBalanceService"></param>
 /// <param name="sysQuotaDetailService"></param>
 /// <param name="sysUserBalanceDetailService"></param>
 /// <param name="sysSettingService"></param>
 public UsersRequestManager(ISysUserService sysUserService,
                            ISysQuotaService sysQuotaService,
                            ISysUserBalanceService sysUserBalanceService,
                            ISysQuotaDetailService sysQuotaDetailService,
                            ISysUserBalanceDetailService sysUserBalanceDetailService, ISysSettingService sysSettingService,
                            IBetDetailService betDetailService)
 {
     this.mSysUserService              = sysUserService;
     this.mSysQuotaService             = sysQuotaService;
     this.mSysUserBalanceService       = sysUserBalanceService;
     this.mSysQuotaDetailService       = sysQuotaDetailService;
     this.mSysUserBalanceDetailService = sysUserBalanceDetailService;
     this.mSysSettingService           = sysSettingService;
     this.mBetDetailService            = betDetailService;
 }
Exemple #7
0
        private RebateHelper mRebateHelper = null;                          //返点辅助


        public BetDetailRequestManager(IBetDetailService betDetailService,
                                       ISysUserService sysUserService,
                                       ISysUserBalanceService sysUserBalanceService,
                                       ISysUserBalanceDetailService sysUserBalanceDetailService,
                                       ISysCatchNumService sysCatchNumService,
                                       ISysCatchNumIssueService sysCatchNumIssueService,
                                       ILotteryIssueService lotteryIssueService,
                                       IPlayTypeRadioService playTypeRadioService)
        {
            this.mBetDetailService            = betDetailService;
            this.mSysUserService              = sysUserService;
            this.mSysUserBalanceService       = sysUserBalanceService;
            this.mSysUserBalanceDetailService = sysUserBalanceDetailService;
            this.mSysCatchNumService          = sysCatchNumService;
            this.mSysCatchNumIssueService     = sysCatchNumIssueService;
            this.mLotteryIssueService         = lotteryIssueService;
            this.mPlayTypeRadioService        = playTypeRadioService;

            this.mRebateHelper = new RebateHelper(this.mSysUserService, this.mSysUserBalanceService, this.mSysUserBalanceDetailService);
        }
Exemple #8
0
        protected void btnMe_Click(object sender, EventArgs e)
        {
            if (this.Master != null)
            {
                UserAmt = (this.Master as lotterySite).GetUserBalance();
            }

            if (!Utils.HasAvtivityDateTimes())
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "<script type=\"text/javascript\">$.alert('活动时间为每日07:30:00 – 次日凌晨02:00:00!');</script>");
                return;
            }
            //验证当天是否领取过礼包
            int occDay = Utils.GetActivityOccDay();
            ILargeRotaryService mLargeRotaryService = IoC.Resolve <ILargeRotaryService>();
            var fst = mLargeRotaryService.Where(x => x.ALlCount == occDay && x.Uid == CookUserInfo.Id).FirstOrDefault();

            if (fst != null)
            {
                Alert("今天已经领取过礼包了,明天再来吧!");
                return;
            }
            DateTime beginDate = Utils.GetNowBeginDate().AddDays(-1);
            DateTime endDate   = beginDate.AddDays(1);

            //获取用户当日有效投注量
            IBetDetailService detailService = IoC.Resolve <IBetDetailService>();
            var monery = detailService.GetUserBettMonery(this.CookUserInfo.Id, beginDate, endDate);

            if (monery <= 0)
            {
                Alert("没有可领取的礼包,投注未达标!");
                return;
            }
            var dm = GetMonery(monery);

            if (dm <= 0)
            {
                Alert("没有可领取的礼包,投注未达标!");
                return;
            }
            //插入账变
            //存入账号
            var details = new BasicModel.SysUserBalanceDetail()
            {
                RelevanceNo = CookUserInfo.Id.ToString(),
                SerialNo    = "q" + Utils.BuilderNum(),
                Status      = 0,
                TradeAmt    = dm,
                TradeType   = BasicModel.TradeType.投注送礼包,
                UserId      = CookUserInfo.Id
            };

            //奖励金额
            ISysUserBalanceService userBalanceServices = IoC.Resolve <ISysUserBalanceService>();

            if (userBalanceServices.UpdateUserBalance(details, dm) > 0)
            {
                string message = "领取礼包成功,领取金额为:" + dm + "<br/>";
                message += "昨日投注金额" + string.Format("{0:N2}", monery) + "<br>";
                message += "感谢你的参与,祝你游戏愉快!";
                ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "<script type=\"text/javascript\">$.alert(\"" + message + "\",1,function(){refchangemonery();});</script>");

                //添加领取记录
                mLargeRotaryService.Create(new BasicModel.LargeRotary()
                {
                    Uid      = CookUserInfo.Id,
                    ALlCount = Utils.GetActivityOccDay()
                });
                mLargeRotaryService.Save();
                isautoRefbanner = false;
            }
            else
            {
                Alert("礼包领取失败,请稍后再试!");
            }
        }