Exemple #1
0
 public static List <PlayTypeRadio> GetPalyTypeRadio(IPlayTypeRadioService playTypeRadioService)
 {
     if (mPlayTypeRadios == null)
     {
         mPlayTypeRadios = playTypeRadioService.GetAll().ToList();
     }
     return(mPlayTypeRadios);
 }
 public static List <PlayTypeRadio> GetAll()
 {
     if (mPlayTypeRadio == null)
     {
         IPlayTypeRadioService radioService = IoC.Resolve <IPlayTypeRadioService>();
         mPlayTypeRadio = radioService.GetAll().ToList();
     }
     return(mPlayTypeRadio);
 }
 /// <summary>
 /// 获取玩法奖金
 /// </summary>
 /// <param name="numCode"></param>
 /// <returns></returns>
 static List <PlayTypeRadio> GetPlayTypeRadio(int numCode)
 {
     if (mPlayTypeRadio == null)
     {
         IPlayTypeRadioService playTypeRadioService = IoC.Resolve <IPlayTypeRadioService>();
         mPlayTypeRadio = playTypeRadioService.GetAll().Where(c => c.IsEnable).ToList();
     }
     return(mPlayTypeRadio.Where(c => c.NumCode == numCode).ToList());
 }
Exemple #4
0
 public LotteryRequestManager(ILotteryTypeService lotteryTypeService, IPlayTypeService playTypeService,
                              IPlayTypeRadioService playTypeRadioService,
                              IPlayNumTypeService playNumTypeService,
                              IPlayTypeRadiosBonusService playTypeRadiosBonusService,
                              ILotteryIssueService lotteryIssueService
                              )
 {
     this.mLotteryTypeService         = lotteryTypeService;
     this.mPlayTypeService            = playTypeService;
     this.mPlayTypeRadioService       = playTypeRadioService;
     this.mPlayTypeNumService         = playNumTypeService;
     this.mPlayTypeRadiosBonusService = playTypeRadiosBonusService;
     this.mLotteryIssueService        = lotteryIssueService;
 }
Exemple #5
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnUpdate_Command(object sender, CommandEventArgs e)
        {
            if (e.CommandArgument == null)
            {
                JsAlert("修改失败!");
                return;
            }

            lotteryCode = txtLotteryCode.Value;
            int playTypeRadioId = Convert.ToInt32(e.CommandArgument);
            int maxNum          = 0;

            for (int i = 0; i < this.repList.Items.Count; i++)
            {
                TextBox cBox = (TextBox)repList.Items[i].FindControl("txtMaxNum");
                if (cBox != null && cBox.ToolTip == playTypeRadioId.ToString())
                {
                    if (!int.TryParse(cBox.Text, out maxNum))
                    {
                        JsAlert("修改失败,注数输入错误!");
                        return;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            IPlayTypeRadioService playTypeRadioService = IoC.Resolve <IPlayTypeRadioService>();
            var item = playTypeRadioService.Get(playTypeRadioId);

            if (item == null)
            {
                JsAlert("修改失败,请刷新后重试");
                return;
            }
            item.MaxBetCount = maxNum;
            playTypeRadioService.Save();
            InitData();
            JsAlert("修改成功!");
        }
Exemple #6
0
        /// <summary>
        /// 初始化数据
        /// </summary>
        public void InitData()
        {
            //获取彩种列表
            ILotteryTypeService lotteryTypeService = IoC.Resolve <ILotteryTypeService>();

            lotteryTypeList = lotteryTypeService.GetAll().ToList();

            //根据彩种获取玩法列表
            if (lotteryTypeList != null && lotteryTypeList.Count > 0)
            {
                if (lotteryCode == "")
                {
                    lotteryCode = lotteryTypeList[0].LotteryCode;
                }
                IPlayTypeRadioService playTypeRadioService = IoC.Resolve <IPlayTypeRadioService>();
                List <PlayRado>       playTypeRadioList    = playTypeRadioService.GetPattRado(lotteryCode, "");
                this.repList.DataSource = playTypeRadioList;
                this.repList.DataBind();
            }
        }
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
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnUpdate_Command(object sender, CommandEventArgs e)
        {
            if (e.CommandArgument == null)
            {
                JsAlert("修改失败!");
                return;
            }

            lotteryCode = txtLotteryCode.Value;
            int  playTypeRadioId = Convert.ToInt32(e.CommandArgument);
            bool isEnable        = false;

            for (int i = 0; i < this.repList.Items.Count; i++)
            {
                CheckBox cBox = (CheckBox)repList.Items[i].FindControl("cBox");
                if (cBox != null)
                {
                    int id = Convert.ToInt32(cBox.ToolTip);
                    if (id == playTypeRadioId)
                    {
                        isEnable = cBox.Checked;
                        break;
                    }
                }
            }

            IPlayTypeRadioService playTypeRadioService = IoC.Resolve <IPlayTypeRadioService>();

            if (playTypeRadioService.UpdateStatus(playTypeRadioId, isEnable))
            {
                InitData();
                JsAlert("修改成功!");
            }
            else
            {
                JsAlert("修改失败!");
            }
        }
        private void BindList(string lotteryCode, SysUser user)
        {
            var rebate = user.Rebate;

            this.userrebate.Value      = rebate.ToString();
            this.hidUserPlayType.Value = user.PlayType == UserPlayType.P1800 ? "0" : "1";
            if (lotteryCode == "hk6")
            {
                isLhc      = true;
                lhcBackNum = (9 - rebate) < 0 ? 0 : Math.Round((9 - rebate), 1);
                return;
            }


            bool isHideJj = ((rebate >= Utils.MaxRemo && user.PlayType == UserPlayType.P1800) || (rebate >= Utils.MaxRemo1700 && user.PlayType == UserPlayType.P1700));//是否隐藏奖金列

            if (isHideJj)
            {
                hideJj = "style='display:none;'";
            }

            //构建玩法奖金数据
            IPlayTypeService            mPlayTypeService           = IoC.Resolve <IPlayTypeService>();
            IPlayTypeRadioService       mPlayTypeRadioService      = IoC.Resolve <IPlayTypeRadioService>();
            IPlayNumTypeService         mPlayTypeNumService        = IoC.Resolve <IPlayNumTypeService>();
            ILotteryTypeService         mLotteryTypeService        = IoC.Resolve <ILotteryTypeService>();
            IPlayTypeRadiosBonusService playTypeRadiosBonusService = IoC.Resolve <IPlayTypeRadiosBonusService>();
            IGroupNameTypeService       groupServices = IoC.Resolve <IGroupNameTypeService>();

            string actionStr    = string.Empty;
            var    lotteryTypes = mLotteryTypeService.GetAll().Where(c => c.IsEnable == true);
            var    xsource      = groupServices.GetAll().OrderBy(x => x.OrderNo).ToList();

            foreach (var cf in xsource)
            {
                var xcs = lotteryTypes.Where(v => v.GroupName == cf.Id).ToList().OrderBy(x => x.Sort);
                foreach (var lt in xcs)
                {
                    string classStr = "btn action";
                    //checkBtn
                    if (lt.LotteryCode == lotteryCode)
                    {
                        classStr = "checkBtn ";
                    }
                    actionStr += "<input type=\"submit\" onclick='setHidden(\"" + lt.LotteryCode + "\")' class=\"" + classStr + "\" id=\"" + lt.LotteryCode + "\" value=\"" + lt.LotteryName + "\" />";
                }
            }
            this.ltActions.Text = actionStr;


            var allPlayTypes = mPlayTypeService.GetAll().Where(m => m.LotteryCode == lotteryCode).ToList();
            var typeNums     = mPlayTypeNumService.GetAll().ToList();
            var typeRadios   = mPlayTypeRadioService.GetAll().ToList();
            var radiosBonuss = playTypeRadiosBonusService.GetAll().ToList();


            StringBuilder builder = new StringBuilder();

            foreach (var item in allPlayTypes)
            {
                var numList = typeNums.Where(n => n.PlayCode == item.PlayCode).Select(n => n.NumCode).ToList();


                var radioList = typeRadios.Where(c => numList.Contains(c.NumCode)).ToList();

                var sltRadios = radioList.Select(r => r.RadioCode).ToList();
                int rowSpan   = radioList.Count + radiosBonuss.Where(x => sltRadios.Contains(x.RadioCode)).Count();
                var groupCt   = radiosBonuss.Where(x => sltRadios.Contains(x.RadioCode)).GroupBy(x => x.RadioCode).Count();
                rowSpan = rowSpan - groupCt;


                bool isApp = false;

                foreach (var radio in radioList)
                {
                    var bonuss    = radiosBonuss.Where(c => c.RadioCode == radio.RadioCode);
                    var maxRebate = user.PlayType == 0 ? radio.MaxRebate - rebate : radio.MaxRebate1700 - rebate;
                    maxRebate = Math.Round(maxRebate, 1);
                    maxRebate = maxRebate < 0 ? 0 : maxRebate;
                    if (bonuss.Count() > 0)
                    {
                        // maxRebate = CookUserInfo.PlayType == 0 ? radio.MaxRebate : radio.MaxRebate1700;
                        foreach (var b in bonuss)
                        {
                            var bonuValue = user.PlayType == 0 ? b.BonusBasic : b.BonusBasic17;
                            //获取奖金级
                            builder.Append("<tr>");
                            if (!isApp || rowSpan < 1)
                            {
                                builder.Append("<td rowspan='" + rowSpan + "'>" + item.PlayTypeName + "</td>");
                                isApp = true;
                            }
                            //玩法名称
                            builder.Append("<td>" + GetCountName(b.BonusCount) + "【" + radio.PlayTypeRadioName + " - " + b.BonusTitle + "】</td>");
                            builder.Append("<td>" + string.Format("{0:N2}", bonuValue) + "</td>");
                            if (!isHideJj)
                            {
                                builder.Append("<td>" + maxRebate + "</td>");
                            }
                            builder.Append("<td>正常</td>");
                            builder.Append("</tr>");
                        }
                    }
                    else
                    {
                        //获取奖金级
                        builder.Append("<tr>");
                        if (!isApp || rowSpan < 1)
                        {
                            builder.Append("<td rowspan='" + rowSpan + "'>" + item.PlayTypeName + "</td>");
                        }
                        var bonuValue = user.PlayType == 0 ? radio.BonusBasic : radio.BonusBasic17;

                        builder.Append("<td>" + radio.PlayTypeRadioName + "</td>");
                        builder.Append("<td>" + string.Format("{0:N2}", bonuValue) + "</td>");
                        if (!isHideJj)
                        {
                            builder.Append("<td>" + maxRebate + "</td>");
                        }
                        builder.Append("<td>" + (radio.IsEnable ? "正常" : "禁用") + "</td>");
                        builder.Append("</tr>");
                    }
                    isApp = true;
                }
            }

            ltTBody.Text = builder.ToString();
        }