Example #1
0
        /// <summary>
        /// 初始化数据
        /// </summary>
        public void InitData()
        {
            //获取彩种列表
            ILotteryTypeService lotteryTypeService = IoC.Resolve <ILotteryTypeService>();

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

            //根据彩种获取玩法列表
            if (lotteryTypeList != null && lotteryTypeList.Count > 0)
            {
                //默认显示彩种
                if (lotteryId == "")
                {
                    lotteryId = lotteryTypeList[0].LotteryCode;
                    this.txtLotteryId.Value = lotteryId;
                }

                string      lotteryName = "";
                LotteryType lotteryType = lotteryTypeList.Where(m => m.LotteryCode == lotteryId).FirstOrDefault();
                if (lotteryType != null)
                {
                    lotteryName = lotteryType.LotteryName;
                    lotteryId   = lotteryType.LotteryCode;
                }
            }
            this.BindResult();
        }
Example #2
0
        public void InitData()
        {
            IGroupNameTypeService groupService = IoC.Resolve <IGroupNameTypeService>();

            GroupNameTypes = groupService.GetAll().OrderBy(x => x.OrderNo).ToList();
            int gid = GroupNameTypes.FirstOrDefault().Id;

            if (string.IsNullOrEmpty(lotteryCode))
            {
                lotteryCode = gid.ToString();
            }
            gid = Convert.ToInt32(lotteryCode);
            this.repList.DataSource = lotteryTypeService.GetAll().Where(x => x.GroupName == gid).ToList();
            this.repList.DataBind();
        }
        /// <summary>
        /// 初始化数据
        /// </summary>
        public void InitData()
        {
            //获取彩种列表
            ILotteryTypeService lotteryTypeService = IoC.Resolve <ILotteryTypeService>();

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

            //根据彩种获取玩法列表
            if (lotteryTypeList != null && lotteryTypeList.Count > 0)
            {
                //默认加载第一个彩种
                if (string.IsNullOrEmpty(lotteryCode))
                {
                    lotteryCode = lotteryTypeList[0].LotteryCode;
                }


                LotteryType lotteryType = lotteryTypeList.Where(m => m.LotteryCode == lotteryCode).FirstOrDefault();
                if (lotteryType == null)
                {
                    return;
                }

                string lotteryName = lotteryType.LotteryName;
                txtLotteryCode.Value = lotteryType.LotteryCode;
                txtLotteryId.Value   = lotteryType.Id.ToString();

                List <LotteryIssueModel> lotteryIssueModelList = new List <LotteryIssueModel>();
                ILotteryIssueService     lotteryIssueService   = IoC.Resolve <ILotteryIssueService>();
                List <LotteryIssue>      lotteryIssueList      = lotteryIssueService.GetNowDayIssue(lotteryType.Id).ToList().OrderBy(x => x.IssueCode).ToList();
                if (lotteryIssueList != null && lotteryIssueList.Count > 0)
                {
                    foreach (var item in lotteryIssueList)
                    {
                        LotteryIssueModel model = new LotteryIssueModel();
                        model.Id          = item.Id;
                        model.IssueCode   = item.IssueCode;
                        model.Result      = item.Result;
                        model.LotteryTime = item.LotteryTime;
                        model.LotteryId   = lotteryType.Id;
                        model.LotteryName = lotteryName;
                        lotteryIssueModelList.Add(model);
                    }
                }
                this.repList.DataSource = lotteryIssueModelList;
                this.repList.DataBind();
            }
        }
Example #4
0
        /// <summary>
        /// 初始化数据
        /// </summary>
        public void InitData()
        {
            //获取彩种列表
            ILotteryTypeService lotteryTypeService = IoC.Resolve <ILotteryTypeService>();

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

            //根据彩种获取玩法列表
            if (lotteryTypeList != null && lotteryTypeList.Count > 0)
            {
                //默认显示彩种
                if (lotteryId == 0)
                {
                    lotteryId = lotteryTypeList[0].Id;
                }

                string      lotteryName = "";
                LotteryType lotteryType = lotteryTypeList.Where(m => m.Id == lotteryId).FirstOrDefault();
                if (lotteryType != null)
                {
                    lotteryName = lotteryType.LotteryName;
                    lotteryId   = lotteryType.Id;
                }

                List <LotteryIssueModel> lotteryIssueModelList = new List <LotteryIssueModel>();
                ILotteryIssueService     lotteryIssueService   = IoC.Resolve <ILotteryIssueService>();
                List <LotteryIssue>      lotteryIssueList      = lotteryIssueService.GetNowDayIssue(lotteryId).ToList();
                if (lotteryIssueList != null && lotteryIssueList.Count > 0)
                {
                    foreach (var item in lotteryIssueList)
                    {
                        LotteryIssueModel model = new LotteryIssueModel();
                        model.Id          = item.Id;
                        model.IssueCode   = item.IssueCode;
                        model.StartTime   = item.StartTime;
                        model.EndTime     = item.EndTime;
                        model.LotteryTime = item.LotteryTime;
                        model.EndSaleTime = item.EndSaleTime;
                        model.LotteryId   = lotteryId;
                        model.LotteryName = lotteryName;
                        lotteryIssueModelList.Add(model);
                    }
                }
                this.repList.DataSource = lotteryIssueModelList;
                this.repList.DataBind();
            }
        }
        private void BindGames()
        {
            ILotteryTypeService lotteryTypeService = IoC.Resolve <ILotteryTypeService>();

            this.drpGame.DataTextField  = "LotteryName";
            this.drpGame.DataValueField = "LotteryCode";
            var result = lotteryTypeService.GetAll().Where(c => c.IsEnable).ToList();

            result.Insert(0, new LotteryType()
            {
                LotteryName = "全部",
                LotteryCode = ""
            });
            this.drpGame.DataSource = result;
            this.drpGame.DataBind();
            this.drpGame.SelectedIndex = 0;
        }
Example #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();
            }
        }
        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();
        }