/// <summary>
        /// 可能中奖的金额
        /// </summary>
        public static decimal GetAutoWinMonery(Ytg.BasicModel.LotteryBasic.DTO.BetDetailDTO item, BettUserDto cookUserInfo, PlayTypeRadio fs)
        {
            //可能中的奖金
            if (null == fs)
            {
                return(99999999);
            }

            decimal sumWinMonery = 0;

            if (!fs.HasMoreBonus)//普通奖金
            {
                //返点/舍弃返点
                sumWinMonery += TotalWinMoney(item, 1, fs, cookUserInfo);
            }
            else
            {//拥有更多中奖方式的
                List <string> ct = new List <string>();
                if (item.BetContent.IndexOf("-") >= 0)
                {
                    var cts = item.BetContent.Split('-');
                    foreach (var c in cts)
                    {
                        if (string.IsNullOrEmpty(c))
                        {
                            continue;
                        }
                        ct.Add(Ytg.Comm.SpecialConvert.ConvertTo(Convert.ToInt32("-" + c)));
                    }
                }
                var wins = PlayTypeRadiosBonusServiceCatch.GetAll().Where(c => c.RadioCode == fs.RadioCode).ToList();
                //是否为特殊玩法
                for (var i = 0; i < wins.Count; i++)
                {
                    var itemw = wins[i];
                    if (ct.Count > 0 && !ct.Contains(itemw.BonusTitle))
                    {
                        continue;
                    }
                    decimal[] models = { 1M, 0.1M, 0.01M, 0.001M };
                    sumWinMonery += (Ytg.Comm.Global.DecimalConvert(cookUserInfo.PlayType == 0 ? itemw.BonusBasic : itemw.BonusBasic17) * models[item.Model] * (int)item.Multiple);
                }
            }

            return(sumWinMonery);
        }
Esempio n. 2
0
        private void BindData(BetList item)
        {
            if (item.Stauts == 3)
            {
                exitTd.Visible = true;
            }
            if (!isCatch)
            {
                LotteryCode = IoC.Resolve <ILotteryTypeService>().Where(c => c.LotteryCode == item.LotteryCode).FirstOrDefault().Id.ToString();
            }
            else
            {
                ISysCatchNumIssueService issueServices = IoC.Resolve <ISysCatchNumIssueService>();
                var xd = issueServices.GetLotteryId(item.BetCode);
                if (xd != null)
                {
                    LotteryCode = xd.Value.ToString();
                }
            }
            this.lbCode.Text     = item.Code;
            this.lbGame.Text     = item.LotteryName;
            this.lbbettCode.Text = item.BetCode;

            string st = "本人撤单";

            if (item.Stauts == 1)
            {
                st = "已中奖";
            }
            else if (item.Stauts == 2)
            {
                st = "未中奖";
            }
            else if (item.Stauts == 3)
            {
                st = "未开奖";
            }
            else if (item.Stauts == 5)
            {
                st = "系统撤单";
            }

            string modelStr = "元";

            switch (item.Model)
            {
            case 1:
                modelStr = "角";
                break;

            case 2:
                modelStr = "分";
                break;

            case 3:
                modelStr = "厘";
                break;
            }

            this.lbState.Text    = st;
            this.lbModel.Text    = item.Multiple + "倍 - " + modelStr + "";
            this.lbbetTime.Text  = item.OccDate.ToString("yyyy-MM-dd HH:mm:ss");
            this.lbIssue.Text    = item.IssueCode;
            this.lbOpenTime.Text = item.OpenResult;

            /***/
            lbPlayType.Text           = item.PlayTypeName + "" + item.PlayTypeRadioName;//玩法
            this.lbMonerty.Text       = item.WinMoney.ToString();
            this.lbSumMonery.Text     = item.TotalAmt.ToString();
            this.hidPostionName.Value = item.PostionName;
            this.lbSubscription.Text  = item.Subscription.ToString();
            //
            //可能中的奖金
            var fs = PlayTypeRadioServiceCatch.GetAll().Where(p => p.RadioCode == item.PalyRadioCode).FirstOrDefault();

            if (null == fs)
            {
                return;
            }
            txtContent.Text = item.BetContent;
            //"zhouke"
            var betUser = IoC.Resolve <ISysUserService>().Get(item.Code);

            if (null == betUser)
            {
                return;
            }
            List <WinsEntity> winSource = new List <WinsEntity>();

            if (!fs.HasMoreBonus)//普通奖金
            {
                //返点/舍弃返点
                string backText = string.Empty;
                double dm       = 0;
                if (betUser.PlayType == 0)//1800
                {
                    dm       = Math.Round((fs.MaxRebate - betUser.Rebate), 1);
                    backText = item.PrizeType == 1 ? " - " + dm + " % " : " - 0%";
                }
                else
                {
                    dm       = Math.Round((fs.MaxRebate1700 - betUser.Rebate), 1);
                    backText = item.PrizeType == 1 ? " - " + dm + " % " : " - 0%";
                }
                if (dm <= 0)
                {
                    dongtaiMonery.Visible = false;
                }
                lbBackNum.Text    = TotalWinMoney(item, 1, fs, betUser, false).ToString();
                lbBackNumlst.Text = backText;
                //如果为lhc,则隐藏返点
                if (item.LotteryCode == "hk6")
                {
                    dongtaiMonery.Visible = false;
                }

                winSource.Add(new WinsEntity()
                {
                    itemContent       = txtContent.Text,
                    meWinMoney        = item.LotteryCode == "hk6" ? (item.TotalAmt * (decimal)Ytg.ServerWeb.BootStrapper.SiteHelper.GetLiuHeMiult()).ToString() : TotalWinMoney(item, 1, fs, betUser).ToString(),
                    Multiple          = item.Multiple,
                    PlayTypeRadioName = string.IsNullOrEmpty(item.PostionName) ? item.PlayTypeRadioName : item.PostionName,
                    DetCount          = item.BetCount
                });
            }
            else
            {//拥有更多中奖方式的
                List <string> ct = new List <string>();
                if (item.BetContent.IndexOf("-") >= 0)
                {
                    var cts = item.BetContent.Split('-');
                    foreach (var c in cts)
                    {
                        if (string.IsNullOrEmpty(c))
                        {
                            continue;
                        }
                        ct.Add(SpecialConvert.ConvertTo(Convert.ToInt32("-" + c)));
                    }
                }
                var wins = PlayTypeRadiosBonusServiceCatch.GetAll().Where(c => c.RadioCode == fs.RadioCode).ToList();
                //是否为特殊玩法
                for (var i = 0; i < wins.Count; i++)
                {
                    var itemw = wins[i];
                    if (ct.Count > 0 && !ct.Contains(itemw.BonusTitle))
                    {
                        continue;
                    }
                    decimal[] models = { 1M, 0.1M, 0.01M, 0.001M };
                    winSource.Add(new WinsEntity()
                    {
                        itemContent       = txtContent.Text,
                        meWinMoney        = (Ytg.Comm.Global.DecimalConvert(betUser.PlayType == 0 ? itemw.BonusBasic : itemw.BonusBasic17) * models[item.Model] * item.Multiple).ToString(),
                        Multiple          = item.Multiple,
                        PlayTypeRadioName = HanZi[i] + "等奖_" + itemw.BonusTitle,
                        DetCount          = item.BetCount //投注注数
                    });
                }
                dongtaiMonery.Visible = false;
            }
            this.rptWins.DataSource = winSource;
            this.rptWins.DataBind();
        }