Beispiel #1
0
 public string GetScriptResTable(string t_str)
 {
     if (ddlLottery.SelectedValue == "72" || ddlLottery.SelectedValue == "73")
     {
         return(PF.GetScriptResTable(t_str));
     }
     else
     {
         return(t_str);
     }
 }
Beispiel #2
0
    private void BindData()
    {
        DataTable dt = new DAL.Views.V_SchemeSchedulesWithQuashed().Open("", "[id] = " + Shove._Web.Utility.FilteSqlInfusion(tbSchemeID.Text), "");

        if ((dt == null) || (dt.Rows.Count < 1))
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试(-141)", this.GetType().BaseType.FullName);

            return;
        }

        DataRow dr = dt.Rows[0];

        long InitiateUserID = Shove._Convert.StrToLong(dr["InitiateUserID"].ToString(), 0);

        // 过滤竞彩足、篮球
        int _LotteryID = Shove._Convert.StrToInt(dr["LotteryID"].ToString(), 0);

        if (_LotteryID == 72 || _LotteryID == 73 || (_User != null && InitiateUserID == _User.ID))
        {
            this.btn_Single.Visible = false;
            this.btn_All.Visible    = false;
        }

        hfID.Value  = InitiateUserID.ToString();
        LotteryName = dr["LotteryName"].ToString();

        Label3.Text       = LotteryName + "<font class='red14'>" + dr["IsuseName"].ToString() + "</font>期" + dr["PlayTypeName"].ToString() + "认购方案";
        labTitle.Text     = dr["IsuseName"].ToString();
        labStartTime.Text = dr["StartTime"].ToString();
        tbIsuseID.Text    = dr["IsuseID"].ToString();
        tbLotteryID.Text  = dr["LotteryID"].ToString();
        LotteryID         = tbLotteryID.Text;
        PlayTypeID        = Shove._Convert.StrToInt(dr["PlayTypeID"].ToString(), 0);

        labEndTime.Text = dr["SystemEndTime"].ToString();

        labInitiateUser.Text = dr["InitiateName"].ToString() + "&nbsp;&nbsp;【<A class=li3 href='../Web/Score.aspx?id=" + dr["InitiateUserID"].ToString() + "&LotteryID=" + tbLotteryID.Text + "' target='_blank'>发起人历史战绩</A>】";

        All_QuashStatus = Shove._Convert.StrToShort(dr["QuashStatus"].ToString(), 0);

        bool   Buyed            = Shove._Convert.StrToBool(dr["Buyed"].ToString(), false);
        int    Share            = Shove._Convert.StrToInt(dr["Share"].ToString(), 0);
        int    BuyedShare       = Shove._Convert.StrToInt(dr["BuyedShare"].ToString(), 0);
        double Money            = Shove._Convert.StrToDouble(dr["Money"].ToString(), 0);
        double AssureMoney      = Shove._Convert.StrToDouble(dr["AssureMoney"].ToString(), 0);
        double WinMoney         = Shove._Convert.StrToDouble(dr["WinMoney"].ToString(), 0);
        short  SecrecyLevel     = Shove._Convert.StrToShort(dr["SecrecyLevel"].ToString(), 0);
        bool   IsuseOpenedWined = false;

        if (Share > 1)
        {
            lbSchemeBonus.Text = (Shove._Convert.StrToDouble(dr["SchemeBonusScale"].ToString(), 0.04) * 100).ToString() + "%";
        }

        labSchedule.Text = dr["Schedule"].ToString();

        DataTable dtIsuse = dtIsuse = new DAL.Views.V_Isuses().Open("IsOpened, WinLotteryNumber,Code", "[id] = " + dr["IsuseID"].ToString(), "");

        if (dtIsuse == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试(-213)", this.GetType().FullName);

            return;
        }

        if (dtIsuse.Rows.Count < 1)
        {
            PF.GoError(ErrorNumber.Unknow, "系统错误(-220)", this.GetType().FullName);

            return;
        }

        IsuseOpenedWined = Shove._Convert.StrToBool(dt.Rows[0]["SchemeIsOpened"].ToString(), true);

        lbWinNumber.Text   = dtIsuse.Rows[0]["WinLotteryNumber"].ToString();
        ImageLogo.ImageUrl = "images/lottery/" + dtIsuse.Rows[0]["Code"].ToString().ToLower() + ".jpg";

        //能撤消整个方案
        //Opt_FullSchemeCanQuash 是否允许撤消满员方案
        bool isSchemeCanQuash = _Site.SiteOptions["Opt_FullSchemeCanQuash"].ToBoolean(false);

        if (!isSchemeCanQuash)
        {
            btnQuashScheme.Visible = ((All_QuashStatus == 0) && (!Buyed) && (Share > BuyedShare) && _User != null && (InitiateUserID == _User.ID));
        }
        else
        {
            btnQuashScheme.Visible = ((All_QuashStatus == 0) && (!Buyed) && _User != null && (InitiateUserID == _User.ID));
        }

        short AtTopStatus      = Shove._Convert.StrToShort(dr["AtTopStatus"].ToString(), 0);
        bool  AtTopApplication = (AtTopStatus != 0);

        if (AtTopStatus == 0)
        {
            cbAtTopApplication.Visible = ((All_QuashStatus == 0) && (!Buyed) && (Share > BuyedShare) && _User != null && (InitiateUserID == _User.ID));
            cbAtTopApplication.Checked = AtTopApplication;
        }
        else
        {
            labAtTop.Visible = true;
        }

        bool Stop = false;

        //  投住内容

        labMultiple.Text = dr["Multiple"].ToString();

        //  SecrecyLevel 0 不保密 1 到截止 2 到开奖 3 永远
        if ((SecrecyLevel == SchemeSecrecyLevels.ToDeadline) && !Stop && ((_User == null) || ((_User != null) && (InitiateUserID != _User.ID) && (!_User.isOwnedViewSchemeCompetence()))))
        {
            labLotteryNumber.Text = "投注内容已经被保密,将在本期投注截止后公开。";
        }
        else if ((SecrecyLevel == SchemeSecrecyLevels.ToOpen) && !IsuseOpenedWined && ((_User == null) || ((_User != null) && (InitiateUserID != _User.ID) && (!_User.isOwnedViewSchemeCompetence()))))
        {
            labLotteryNumber.Text = "投注内容已经被保密,将在本期开奖后公开。";
        }
        else if ((SecrecyLevel == SchemeSecrecyLevels.Always) && ((_User == null) || ((_User != null) && (InitiateUserID != _User.ID) && (!_User.isOwnedViewSchemeCompetence()))))
        {
            labLotteryNumber.Text = "投注内容已经被保密。";
        }
        else
        {
            int MaxShowLotteryNumberRows = _Site.SiteOptions["Opt_MaxShowLotteryNumberRows"].ToShort(0);

            string t_str = "";

            try
            {
                t_str = dr["LotteryNumber"].ToString();
            }
            catch { }

            if (Shove._String.StringAt(t_str, '\n') < 1 && !string.IsNullOrEmpty(t_str))
            {
                StringBuilder sbTeam = new StringBuilder();

                if ((new SLS.Lottery.JCLQ().CheckPlayType(Shove._Convert.StrToInt(dr["PlayTypeID"].ToString(), -1))) || (new SLS.Lottery.JCZQ().CheckPlayType(Shove._Convert.StrToInt(dr["PlayTypeID"].ToString(), -1))))
                {
                    labLotteryNumber.Text = PF.GetScriptResTable(t_str);
                }
                else if (dr["LotteryID"].ToString().Equals("75") || dr["LotteryID"].ToString().Equals("74"))
                {
                    DataTable dtIsusesTeat = new DAL.Tables.T_IsuseForSFC().Open("", "IsuseID=" + dr["IsuseID"].ToString(), "No");

                    sbTeam.Append("<div class=\"tdbback\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"tablelay\">");
                    sbTeam.Append("<th>场次</th>");
                    sbTeam.Append("<th>1</th>");
                    sbTeam.Append("<th>2</th>");
                    sbTeam.Append("<th>3</th>");
                    sbTeam.Append("<th>4</th>");
                    sbTeam.Append("<th>5</th>");
                    sbTeam.Append("<th>6</th>");
                    sbTeam.Append("<th>7</th>");
                    sbTeam.Append("<th>8</th>");
                    sbTeam.Append("<th>9</th>");
                    sbTeam.Append("<th>10</th>");
                    sbTeam.Append("<th>11</th>");
                    sbTeam.Append("<th>12</th>");
                    sbTeam.Append("<th>13</th>");
                    sbTeam.Append("<th>14</th>");
                    sbTeam.Append("<th>倍数</th>");
                    sbTeam.Append("<th>金额</th></tr>");
                    sbTeam.Append("<tr class=\"tr1\"><td>对阵</td>");

                    for (int i = 0; i < dtIsusesTeat.Rows.Count; i++)
                    {
                        sbTeam.Append("<td><div class=\"texts\">" + dtIsusesTeat.Rows[i]["HostTeam"].ToString() + " <span> VS </span> " + dtIsusesTeat.Rows[i]["QuestTeam"].ToString() + " </div></td>");
                    }

                    sbTeam.Append("<td>&nbsp;</td><td class=\"gray trline trline4 trline5\">单位(元)</td></tr>");
                    sbTeam.Append("<tr class=\"tr2\"><td class=\"gray trline trline3\">选号</td>");

                    for (int i = 0; i < 14; i++)
                    {
                        if (t_str.Substring(0, 1).Equals("("))
                        {
                            sbTeam.Append("<td>" + t_str.Substring(1, t_str.IndexOf(")") - 1) + "</td>");

                            t_str = t_str.Substring(t_str.IndexOf(")") + 1);
                        }
                        else
                        {
                            sbTeam.Append("<td>" + t_str.Substring(0, 1) + "</td>");

                            t_str = t_str.Substring(1);
                        }
                    }

                    sbTeam.Append("<td>" + dr["Multiple"].ToString() + "</td>");
                    sbTeam.Append("<td class=\"red\">¥" + Money.ToString() + "</td></tr></table></div>");

                    labLotteryNumber.Text = sbTeam.ToString();
                }
                else if (dr["LotteryID"].ToString().Equals("2"))
                {
                    DataTable dtIsusesTeat = new DAL.Tables.T_IsuseForJQC().Open("", "IsuseID=" + dr["IsuseID"].ToString(), "");

                    sbTeam.Append("<div class=\"tdbback\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"tablelay\">");
                    sbTeam.Append("<th>场次</th>");
                    sbTeam.Append("<th>1</th>");
                    sbTeam.Append("<th>2</th>");
                    sbTeam.Append("<th>3</th>");
                    sbTeam.Append("<th>4</th>");
                    sbTeam.Append("<th>5</th>");
                    sbTeam.Append("<th>6</th>");
                    sbTeam.Append("<th>7</th>");
                    sbTeam.Append("<th>8</th>");
                    sbTeam.Append("<th>倍数</th>");
                    sbTeam.Append("<th>金额</th></tr>");
                    sbTeam.Append("<tr class=\"tr1\"><td>对阵</td>");

                    for (int i = 0; i < dtIsusesTeat.Rows.Count; i++)
                    {
                        sbTeam.Append("<td><div class=\"texts\">" + dtIsusesTeat.Rows[i]["Team"].ToString() + " <div></td>");
                    }

                    sbTeam.Append("<td>&nbsp;</td><td class=\"gray trline trline4 trline5\">单位(元)</td></tr>");
                    sbTeam.Append("<tr class=\"tr2\"><td class=\"gray trline trline3\">选号</td>");

                    for (int i = 0; i < 8; i++)
                    {
                        if (t_str.Substring(0, 1).Equals("("))
                        {
                            sbTeam.Append("<td>" + t_str.Substring(1, t_str.IndexOf(")") - 1) + "</td>");

                            t_str = t_str.Substring(0, t_str.IndexOf(")") + 1);
                        }
                        else
                        {
                            sbTeam.Append("<td>" + t_str.Substring(0, 1) + "</td>");

                            t_str = t_str.Substring(1);
                        }
                    }

                    sbTeam.Append("<td>" + dr["Multiple"].ToString() + "</td>");
                    sbTeam.Append("<td class=\"red\">¥" + Money.ToString() + "</td></tr></table></div>");

                    labLotteryNumber.Text = sbTeam.ToString();
                }
                else if (dr["LotteryID"].ToString().Equals("15"))
                {
                    DataTable dtIsusesTeat = new DAL.Tables.T_IsuseForLCBQC().Open("", "IsuseID=" + dr["IsuseID"].ToString(), "");

                    sbTeam.Append("<div class=\"tdbback\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"tablelay\">");
                    sbTeam.Append("<th>场次</th>");
                    sbTeam.Append("<th>1</th>");
                    sbTeam.Append("<th>2</th>");
                    sbTeam.Append("<th>3</th>");
                    sbTeam.Append("<th>4</th>");
                    sbTeam.Append("<th>5</th>");
                    sbTeam.Append("<th>6</th>");
                    sbTeam.Append("<th>7</th>");
                    sbTeam.Append("<th>8</th>");
                    sbTeam.Append("<th>9</th>");
                    sbTeam.Append("<th>10</th>");
                    sbTeam.Append("<th>11</th>");
                    sbTeam.Append("<th>12</th>");
                    sbTeam.Append("<th>倍数</th>");
                    sbTeam.Append("<th>金额</th></tr>");
                    sbTeam.Append("<tr class=\"tr1\"><td>对阵</td>");

                    for (int i = 0; i < dtIsusesTeat.Rows.Count; i++)
                    {
                        sbTeam.Append("<td><div class=\"texts\">" + dtIsusesTeat.Rows[i]["HostTeam"].ToString() + " <span> VS </span> " + dtIsusesTeat.Rows[i]["QuestTeam"].ToString() + " </div> <span class=\"red\">半</span></td>");
                        sbTeam.Append("<td><div class=\"texts\">" + dtIsusesTeat.Rows[i]["HostTeam"].ToString() + " <span> VS </span> " + dtIsusesTeat.Rows[i]["QuestTeam"].ToString() + " </div> <span class=\"red\">全</span> </td>");
                    }

                    sbTeam.Append("<td>&nbsp;</td><td class=\"gray trline trline4 trline5\">单位(元)</td></tr>");
                    sbTeam.Append("<tr class=\"tr2\"><td class=\"gray trline trline3\">选号</td>");

                    for (int i = 0; i < 12; i++)
                    {
                        if (t_str.Substring(0, 1).Equals("("))
                        {
                            sbTeam.Append("<td>" + t_str.Substring(1, t_str.IndexOf(")") - 1) + "</td>");

                            t_str = t_str.Substring(0, t_str.IndexOf(")") + 1);
                        }
                        else
                        {
                            sbTeam.Append("<td>" + t_str.Substring(0, 1) + "</td>");

                            t_str = t_str.Substring(1);
                        }
                    }

                    sbTeam.Append("<td>" + dr["Multiple"].ToString() + "</td>");
                    sbTeam.Append("<td class=\"red\">¥" + Money.ToString() + "</td></tr></table></div>");

                    labLotteryNumber.Text = sbTeam.ToString();
                }
                else
                {
                    labLotteryNumber.Text = Shove._Convert.ToHtmlCode(t_str) + "&nbsp;";

                    if (IsuseOpenedWined)
                    {
                        NumberDuiBi(labLotteryNumber.Text, lbWinNumber.Text, PlayTypeID);
                    }
                }
            }
            else if (Shove._String.StringAt(t_str, '\n') < MaxShowLotteryNumberRows && !dr["LotteryID"].ToString().Equals("74") && !dr["LotteryID"].ToString().Equals("75") && !dr["LotteryID"].ToString().Equals("2") && !dr["LotteryID"].ToString().Equals("15") && !dr["LotteryID"].ToString().Equals("72") && !dr["LotteryID"].ToString().Equals("73"))
            {
                labLotteryNumber.Text = Shove._Convert.ToHtmlCode(t_str) + "&nbsp;";

                if (IsuseOpenedWined)
                {
                    NumberDuiBi(labLotteryNumber.Text, lbWinNumber.Text, PlayTypeID);
                }
            }
            else if (!string.IsNullOrEmpty(t_str))
            {
                linkDownloadScheme.Visible     = true;
                linkDownloadScheme.NavigateUrl = "../Web/DownloadSchemeFile.aspx?id=" + tbSchemeID.Text;
            }

            if (dr["LotteryID"].ToString().Equals("72") || dr["LotteryID"].ToString().Equals("73"))
            {
                labEndTime.Text = GetScriptResTable(t_str);
            }
        }

        System.DateTime EndTime = Shove._Convert.StrToDateTime(labEndTime.Text, DateTime.Now.ToString());

        if (DateTime.Now >= EndTime)
        {
            Stop        = true;
            tbStop.Text = Stop.ToString();
        }

        if (All_QuashStatus > 0)
        {
            if (All_QuashStatus == 2)
            {
                labState.Text = "已撤单(系统撤单)";
            }
            else
            {
                labState.Text = "已撤单";
            }
        }
        else
        {
            if (Buyed)
            {
                labState.Text = "<FONT color='red'>已出票</font>";
            }
            else
            {
                if (Stop)
                {
                    labState.Text = "已截止";
                }
                else
                {
                    if (Share <= BuyedShare)
                    {
                        labState.Text = "<FONT color='red'>已满员</font>";
                    }
                    else
                    {
                        labState.Text = "<font color='red'>抢购中...</font>";
                    }
                }
            }
        }

        // 填充
        labSchemeNumber.Text      = dr["SchemeNumber"].ToString();
        labSchemeMoney.Text       = Shove._Convert.StrToDouble(dr["Money"].ToString(), 0).ToString("N");
        labSchemeTitle.Text       = dr["Title"].ToString() + "&nbsp;";
        labSchemeDescription.Text = dr["Description"].ToString() + "&nbsp;";

        labSchemeADUrl.Text = Shove._Web.Utility.GetUrl() + "/Home/Room/Scheme.aspx?id=" + tbSchemeID.Text;

        if (string.IsNullOrEmpty(dr["LotteryNumber"].ToString()) && (LotteryID == "1" || LotteryID == "2" || LotteryID == "15" || LotteryID == "74" || LotteryID == "75") && All_QuashStatus == 0 && !Stop && !Buyed)
        {
            labLotteryNumber.Text = "未上传";

            if (_User != null && dr["InitiateUserID"].ToString() == _User.ID.ToString())
            {
                lbUploadScheme.Visible = true;

                DataTable dtPrepareBet = new DAL.Tables.T_PrepareBet().Open("", "SchemeID=" + SchemeID.ToString(), "");

                if (dtPrepareBet == null)
                {
                    PF.GoError(ErrorNumber.DataReadWrite, "数据访问错误(-364)", this.GetType().FullName);

                    return;
                }

                if (dtPrepareBet.Rows.Count < 1)
                {
                    hidMaxMoney.Value = Money.ToString();
                }
                else
                {
                    hidMaxMoney.Value = dtPrepareBet.Rows[0]["MaxMoney"].ToString();
                }
            }
        }

        labAssureMoney.Text = (AssureMoney > 0) ? string.Format("<FONT color='red'>{0}</font> 元", AssureMoney.ToString("N")) : "未保底";

        if (All_QuashStatus > 0)
        {
            if (All_QuashStatus == 2)
            {
                labWin.Text = "已撤单(系统撤单)";
            }
            else
            {
                labWin.Text = "已撤单";
            }
        }
        else
        {
            if (Stop)
            {
                labWin.Text = string.Format("<FONT color='red'>{0}</font> 元", WinMoney.ToString("N"));
                string WinDescription = dr["WinDescription"].ToString();

                if (WinDescription != "")
                {
                    labWin.Text += "<br />" + WinDescription;
                }
                else
                {
                    if (IsuseOpenedWined)
                    {
                        labWin.Text += "  未中奖";
                    }
                    else
                    {
                        labWin.Text += "  <font color='red'>【注】</font>中奖结果在开奖后需要一段时间才能显示。";
                    }
                }
            }
            else
            {
                labWin.Text = "尚未截止";
            }
        }

        if (IsuseOpenedWined)
        {
            if (LotteryID == "1" || LotteryID == "2" || LotteryID == "15")
            {
                labWin.Text += "(命中<font color='red'>" + CompareLotteryNumberToWinNumber(dr["LotteryNumber"].ToString(), dr["WinLotteryNumber"].ToString()).ToString() + "</font>场)";
            }
        }

        if (Stop)
        {
            labCannotBuyTip.Text    = "方案已截止,不能认购";
            labCannotBuyTip.Visible = true;
            pBuy.Visible            = false;
            btnOK.Enabled           = false;
        }
        else
        {
            if (All_QuashStatus > 0)
            {
                labCannotBuyTip.Text    = "方案已撤单,不能认购";
                labCannotBuyTip.Visible = true;
                pBuy.Visible            = false;
                btnOK.Enabled           = false;
            }
            else
            {
                if (BuyedShare >= Share)
                {
                    labCannotBuyTip.Text    = "方案已满员,不能认购";
                    labCannotBuyTip.Visible = true;
                    pBuy.Visible            = false;
                    btnOK.Enabled           = false;
                }
                else
                {
                    labCannotBuyTip.Visible = false;
                    pBuy.Visible            = true;
                    btnOK.Enabled           = true;
                }
            }
        }

        labShare.Text      = Share.ToString();
        labBuyedShare.Text = (Share - BuyedShare).ToString();
        labShareMoney.Text = (Money / Share).ToString("N");

        // 绑定参与用户列表
        BindDataForUserList();

        if (_User != null)
        {
            DataTable dtMyBuy = new DAL.Views.V_BuyDetailsWithQuashedAll().Open("[id],[DateTime],[Money],Share,SchemeShare,BuyedShare,QuashStatus,Buyed,IsuseID,Code,Schedule,DetailMoney,isWhenInitiate, WinMoneyNoWIthTax", "SiteID = " + _Site.ID.ToString() + " and SchemeID = " + Shove._Web.Utility.FilteSqlInfusion(tbSchemeID.Text) + " and [UserID] = " + _User.ID.ToString(), "[id]");

            if (dtMyBuy == null)
            {
                PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试(-518)", this.GetType().FullName);

                return;
            }

            if (dtMyBuy.Rows.Count == 0)
            {
                labMyBuy.Text    = "此方案还没有我的认购记录。";
                labMyBuy.Visible = true;

                g.Visible = false;
            }
            else
            {
                labMyBuy.Visible = false;

                g.Visible = true;

                PF.DataGridBindData(g, dtMyBuy);

                if (IsuseOpenedWined)
                {
                    double DetailMoney = 0;

                    for (int i = 0; i < dtMyBuy.Rows.Count; i++)
                    {
                        DetailMoney += double.Parse(dtMyBuy.Rows[i]["WinMoneyNoWIthTax"].ToString());
                    }

                    lbReward.Text = DetailMoney.ToString("N");
                }
            }

            if (_User.UserType < 2)
            {
                btnOK.Enabled          = false;
                btnQuashScheme.Enabled = false;
            }
        }
    }
    private void BindData()
    {
        long SchemeID = Shove._Convert.StrToLong(Shove._Web.Utility.GetRequest("id"), -1);

        if (SchemeID < 0)
        {
            PF.GoError(ErrorNumber.Unknow, "参数错误", this.GetType().FullName);

            return;
        }

        DataTable dt = new DAL.Tables.T_Schemes().Open("InitiateUserID,LotteryNumber, PlayTypeID", "SiteID = " + _Site.ID.ToString() + " and [ID] = " + SchemeID.ToString(), "");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().FullName);

            return;
        }

        if (dt.Rows.Count < 1)
        {
            PF.GoError(ErrorNumber.Unknow, "参数错误", this.GetType().FullName);

            return;
        }

        long InitiateUserID = Shove._Convert.StrToLong(dt.Rows[0]["InitiateUserID"].ToString(), -1);

        //既不是发起人,也不在招股对象之内
        if (_User != null && !_User.isCanViewSchemeContent(SchemeID))
        {
            PF.GoError(ErrorNumber.Unknow, "对不起,您不在此方案的招股对象之内。", this.GetType().FullName);

            return;
        }

        string LotteryNumber = dt.Rows[0]["LotteryNumber"].ToString();

        if (Shove._Convert.StrToInt(dt.Rows[0]["PlayTypeID"].ToString(), -1) > 7200 && Shove._Convert.StrToInt(dt.Rows[0]["PlayTypeID"].ToString(), -1) < 7300)
        {
            string CacheKey = "JCZC_Scheme_Bind";

            DataTable dtMatch = Shove._Web.Cache.GetCacheAsDataTable(CacheKey);

            if (dtMatch == null)
            {
                dtMatch = new DAL.Tables.T_Match().Open("ID, MatchNumber, StopSellingTime", "", "");

                if (dtMatch == null)
                {
                    return;
                }

                if (dtMatch.Rows.Count < 1)
                {
                    return;
                }

                Shove._Web.Cache.SetCache(CacheKey, dtMatch, 3600);
            }

            string CanonicalNumber = "";
            int    PlayTypeID      = Shove._Convert.StrToInt(dt.Rows[0]["PlayTypeID"].ToString(), 7201);

            ArrayList al = new ArrayList();

            string[] strs = LotteryNumber.Split('\n');

            if (strs == null)
            {
                return;
            }
            if (strs.Length == 0)
            {
                return;
            }

            string CacheKeyNumbers = "Home_Web_DownloadSchemeFile_" + SchemeID.ToString();

            string[] LotteryNumbers = Shove._Web.Cache.GetCacheAsString(CacheKeyNumbers, "").Split('\n');
            string[] strNumbers     = null;

            if (LotteryNumbers.Length < 2)
            {
                for (int i = 0; i < strs.Length; i++)
                {
                    if (string.IsNullOrEmpty(strs[i]))
                    {
                        continue;
                    }

                    strNumbers = new SLS.Lottery()[Shove._Convert.StrToInt(PlayTypeID.ToString().Substring(0, PlayTypeID.ToString().Length - 2), 72)].ToSingle(strs[i], ref CanonicalNumber, PlayTypeID);

                    if (strNumbers == null)
                    {
                        continue;
                    }

                    for (int j = 0; j < strNumbers.Length; j++)
                    {
                        al.Add(strNumbers[j]);
                    }
                }

                LotteryNumbers = new string[al.Count];

                StringBuilder sbLotteryNumbers = new StringBuilder();

                for (int i = 0; i < al.Count; i++)
                {
                    if (i == al.Count)
                    {
                        sbLotteryNumbers.Append(al[i].ToString());
                    }
                    else
                    {
                        sbLotteryNumbers.Append(al[i].ToString() + "\n");
                    }

                    LotteryNumbers[i] = al[i].ToString();
                }

                Shove._Web.Cache.SetCache(CacheKeyNumbers, sbLotteryNumbers.ToString(), 3600);
            }

            StringBuilder sb = new StringBuilder();

            sb.Append("<table width=\"60%\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"1\" class=\"BgBlue\">");
            sb.Append("<tr align=\"center\" bgcolor=\"#FFFFFF\" class=\"BlueLightBg WhiteWords\">");
            sb.Append("<td width=\"8%\"><strong>序号</strong></td>");
            sb.Append("<td><strong>过关场次</strong></td>");
            sb.Append("<td width=\"10%\"><strong>过关方式</strong></td>");
            sb.Append("<td width=\"10%\"><strong>注数</strong></td>");
            sb.Append("<td width=\"10%\"><strong>投注金额(元)</strong></td></tr>");

            string Number  = "";
            int    No      = 0;
            string BuyWays = "";

            int Multiple = 0;

            int LotID  = 0;
            int PlayID = 0;

            PlayID = Shove._Convert.StrToInt(LotteryNumbers[0].Split(';')[0], 7201);
            LotID  = Shove._Convert.StrToInt(PlayID.ToString().Substring(0, 2), 72);

            DateTime EndTime = DateTime.Now;

            int pageindex = 1;
            if (!string.IsNullOrEmpty(Shove._Web.Utility.GetRequest("p")))
            {
                pageindex = Shove._Convert.StrToInt(Shove._Web.Utility.GetRequest("p").ToString(), 1);
            }

            int perPageRowCount = 30;

            if (pageindex < 1)
            {
                pageindex = 1;
            }

            foreach (string str in LotteryNumbers)
            {
                if (string.IsNullOrEmpty(str))
                {
                    continue;
                }

                No++;

                if (str.Split(';').Length < 3)
                {
                    continue;
                }

                try
                {
                    Multiple = Shove._Convert.StrToInt(str.Split(';')[2].Substring(1, str.Split(';')[2].Length - 2).Substring(2), 1);
                }
                catch
                { }

                if ((No < (pageindex - 1) * perPageRowCount) || No > (pageindex) * perPageRowCount)
                {
                    continue;
                }

                sb.Append("<tr align=\"center\" class=\"" + ((No % 2 == 0) ? "BlueWord WhiteBg" : "BlueLightBg2 BlueWord") + "\">");
                sb.Append("<td>" + No.ToString() + "</td>");

                Number = str.Split(';')[1].Substring(1, str.Split(';')[1].Length - 2);
                string[] Numbers = Number.Split('|');

                //if (Numbers.Length < 2)
                //{
                //    continue;
                //}

                sb.Append("<td height=\"20\">");

                if (Numbers.Length == 1)
                {
                    BuyWays = "单关";
                }
                else
                {
                    BuyWays = Numbers.Length.ToString() + "串1";
                }

                long MatchID = 0;

                for (int i = 0; i < Numbers.Length; i++)
                {
                    if (Numbers[i].IndexOf("(") < 0)
                    {
                        continue;
                    }

                    MatchID = Shove._Convert.StrToLong(Numbers[i].Substring(0, Numbers[i].IndexOf("(")), 1);

                    DataRow[] dr = dtMatch.Select("ID=" + MatchID.ToString());

                    if (dr.Length < 1)
                    {
                        continue;
                    }

                    sb.Append(dr[0]["MatchNumber"].ToString() + "->" + PF.Getesult(PlayID.ToString(), Numbers[i].Substring(Numbers[i].IndexOf("(") + 1, Numbers[i].IndexOf(")") - Numbers[i].IndexOf("(") - 1)) + ";");
                }

                sb.Append("</td>");
                sb.Append("<td height=\"20\">" + BuyWays + "</td>");
                sb.Append("<td>1</td>");
                sb.Append("<td>" + (2 * Multiple).ToString() + "</td></tr>");
            }

            sb.Append("</table>");
            labLotteryNumber.Text = sb.ToString();

            StringBuilder sbpage = new StringBuilder();

            int rowCount  = No;
            int pageCount = rowCount % perPageRowCount == 0 ? rowCount / perPageRowCount : rowCount / perPageRowCount + 1;

            if (SchemeID < 0)
            {
                sbpage.Append("<div id=\"Pagination\" class=\"yahoo\" style=\"width: auto;\"><span id=\"first\"><a href=\"DownloadSchemeFile.aspx\">首页</a></span>");

                if (pageindex == 1)
                {
                    sbpage.Append("<span class=\"disabled\">« 上一页</span>");
                }
                else
                {
                    sbpage.Append("<span><a href=\"DownloadSchemeFile.aspx?p=" + (pageindex - 1).ToString() + "\">« 上一页</a></span>");
                }

                for (int i = 0; i < pageCount; i++)
                {
                    if (i == pageindex - 1)
                    {
                        sbpage.Append("<span class=\"current\">" + (i + 1).ToString() + "</span>");

                        continue;
                    }

                    if ((i < pageindex + 4 || i < 9) && (i > pageindex - 6 || i > pageCount - 10))
                    {
                        sbpage.Append("<a href=\"DownloadSchemeFile.aspx?p=" + (i + 1).ToString() + "\">" + (i + 1).ToString() + "</a>");
                    }
                }

                if (pageindex == pageCount)
                {
                    sbpage.Append("<span class=\"disabled\">下一页 »</span>");
                }
                else
                {
                    sbpage.Append("<span><a href=\"DownloadSchemeFile.aspx?p=" + (pageindex + 1).ToString() + "\">下一页 »</a></span>");
                }

                sbpage.Append("<span id=\"last\" value=\"" + pageCount.ToString() + "\"><a href=\"DownloadSchemeFile.aspx?p=" + (pageCount).ToString() + "\">尾页</a></span><span class=\"jilu\">共" + pageCount.ToString() + "页," + No.ToString() + "条记录</span></div>");
            }
            else
            {
                sbpage.Append("<div id=\"Pagination\" class=\"yahoo\" style=\"width: auto;\"><span id=\"first\"><a href=\"DownloadSchemeFile.aspx?id=" + SchemeID.ToString() + "\">首页</a></span>");

                if (pageindex == 1)
                {
                    sbpage.Append("<span class=\"disabled\">« 上一页</span>");
                }
                else
                {
                    sbpage.Append("<span><a href=\"DownloadSchemeFile.aspx?id=" + SchemeID.ToString() + "&p=" + (pageindex - 1).ToString() + "\">« 上一页</a></span>");
                }

                for (int i = 0; i < pageCount; i++)
                {
                    if (i == pageindex - 1)
                    {
                        sbpage.Append("<span class=\"current\">" + (i + 1).ToString() + "</span>");

                        continue;
                    }

                    if ((i < pageindex + 4 || i < 9) && (i > pageindex - 6 || i > pageCount - 10))
                    {
                        sbpage.Append("<a href=\"DownloadSchemeFile.aspx?id=" + SchemeID.ToString() + "&p=" + (i + 1).ToString() + "\">" + (i + 1).ToString() + "</a>");
                    }
                }

                if (pageindex == pageCount)
                {
                    sbpage.Append("<span class=\"disabled\">下一页 »</span>");
                }
                else
                {
                    sbpage.Append("<span><a href=\"DownloadSchemeFile.aspx?id=" + SchemeID.ToString() + "&p=" + (pageindex + 1).ToString() + "\">下一页 »</a></span>");
                }

                sbpage.Append("<span id=\"last\" value=\"" + pageCount.ToString() + "\"><a href=\"DownloadSchemeFile.aspx?id=" + SchemeID.ToString() + "&p=" + (pageCount).ToString() + "\">尾页</a></span><span class=\"jilu\">共" + pageCount.ToString() + "页," + No.ToString() + "条记录</span></div>");
            }

            labLotteryNumber.Text += sbpage.ToString();
        }
        else
        {
            LotteryNumber = PF.GetScriptResTable(LotteryNumber);

            if (LotteryNumber.IndexOf("table") < 0)
            {
                LotteryNumber = Shove._Convert.ToHtmlCode(LotteryNumber);
            }

            labLotteryNumber.Text = (LotteryNumber == "") ? "未找到相关数据。" : (LotteryNumber + "&nbsp;");
        }
    }
Beispiel #4
0
    private void BindBet()
    {
        double summoney = Shove._Convert.StrToDouble(Shove._Web.Utility.GetRequest("summoney"), 0);
        int    isuseid  = Shove._Convert.StrToInt(Shove._Web.Utility.GetRequest("isuseid"), 0);
        string lotid    = Shove._Web.Utility.GetRequest("lotid");
        string playid   = Shove._Web.Utility.GetRequest("playid");
        string zhushu   = Shove._Web.Utility.GetRequest("zhushu");
        string beishu   = Shove._Web.Utility.GetRequest("beishu");
        string codes    = Shove._Web.Utility.GetRequest("codes").Replace("#", "+");

        if (string.IsNullOrEmpty(zhushu) || string.IsNullOrEmpty(beishu) || string.IsNullOrEmpty(codes) || string.IsNullOrEmpty(lotid))
        {
            return;
        }

        if (summoney < 2 || isuseid == 0)
        {
            return;
        }

        StringBuilder sb = new StringBuilder();

        string Number = codes;

        if (lotid == "74" || lotid == "75")
        {
            if (summoney == 2)
            {
                playid = lotid + "01";
            }
            else
            {
                playid = lotid + "02";
            }

            if (Number.Length < 9)
            {
                return;
            }

            DataTable dtMatch = new DAL.Tables.T_IsuseForSFC().Open("", "IsuseID=" + isuseid.ToString(), "No");

            if (dtMatch == null || dtMatch.Rows.Count != 14)
            {
                return;
            }

            sb.Append("<table bgcolor=\"#afcea4\" border=\"0\" cellpadding=\"4\" cellspacing=\"1\">")
            .Append("<tbody><tr class=\"gg_form_trt_02\"><td width=\"80\">场次</td><td width=\"270\">比赛对阵</td><td width=\"140\" align=\"center\">比赛时间</td><td width=\"100\" align=\"center\">投注结果</td></tr></tbody>")
            .Append("<tbody id=\"matchList\">");

            for (int i = 0; i < 14; i++)
            {
                sb.Append("<tr class=\"dg_trbg1\"><td>").Append(dtMatch.Rows[i]["NO"].ToString())
                .Append("</td><td>").Append(dtMatch.Rows[i]["HostTeam"].ToString()).Append(" VS ").Append(dtMatch.Rows[i]["QuestTeam"].ToString())
                .Append("</td><td>").Append(dtMatch.Rows[i]["DateTime"].ToString())
                .Append("</td><td>");
                if (Number.Substring(0, 1).Equals("("))
                {
                    sb.Append(Number.Substring(1, Number.IndexOf(")") - 1));
                    Number = Number.Substring(Number.IndexOf(")") + 1);
                }
                else
                {
                    sb.Append(Number.Substring(0, 1));
                    Number = Number.Substring(1);
                }
                sb.Append("</td></tr>");
            }

            sb.Append("</tbody></table>");
        }
        else if (lotid == "15")
        {
            if (summoney == 2)
            {
                playid = lotid + "01";
            }
            else
            {
                playid = lotid + "02";
            }

            if (Number.Length < 12)
            {
                return;
            }

            DataTable dtMatch = new DAL.Tables.T_IsuseForLCBQC().Open("", "IsuseID=" + isuseid.ToString(), "No");

            if (dtMatch == null || dtMatch.Rows.Count != 6)
            {
                return;
            }

            sb.Append("<table bgcolor=\"#afcea4\" border=\"0\" cellpadding=\"4\" cellspacing=\"1\">")
            .Append("<tbody><tr class=\"gg_form_trt_02\"><td width=\"80\">场次</td><td width=\"270\">比赛对阵</td><td width=\"140\" align=\"center\">比赛时间</td><td width=\"100\" align=\"center\">投注结果</td></tr></tbody>")
            .Append("<tbody id=\"matchList\">");

            for (int i = 0; i < 6; i++)
            {
                sb.Append("<tr class=\"dg_trbg1\"><td>").Append(dtMatch.Rows[i]["NO"].ToString())
                .Append("</td><td>").Append(dtMatch.Rows[i]["HostTeam"].ToString()).Append(" VS ").Append(dtMatch.Rows[i]["QuestTeam"].ToString())
                .Append("</td><td>").Append(dtMatch.Rows[i]["DateTime"].ToString())
                .Append("</td><td>");
                if (Number.Substring(0, 1).Equals("("))
                {
                    sb.Append(Number.Substring(1, Number.IndexOf(")") - 1));
                    Number = Number.Substring(Number.IndexOf(")") + 1);
                }
                else
                {
                    sb.Append(Number.Substring(0, 1));
                    Number = Number.Substring(1);
                }
                sb.Append("</td></tr>");
            }

            sb.Append("</tbody></table>");
        }
        else if (lotid == "2")
        {
            if (summoney == 2)
            {
                playid = lotid + "01";
            }
            else
            {
                playid = lotid + "02";
            }

            if (Number.Length < 8)
            {
                return;
            }

            DataTable dtMatch = new DAL.Tables.T_IsuseForJQC().Open("", "IsuseID=" + isuseid.ToString(), "No");

            if (dtMatch == null || dtMatch.Rows.Count != 8)
            {
                return;
            }

            sb.Append("<table bgcolor=\"#afcea4\" border=\"0\" cellpadding=\"4\" cellspacing=\"1\">")
            .Append("<tbody><tr class=\"gg_form_trt_02\"><td width=\"80\">场次</td><td width=\"270\">比赛对阵</td><td width=\"140\" align=\"center\">比赛时间</td><td width=\"100\" align=\"center\">投注结果</td></tr></tbody>")
            .Append("<tbody id=\"matchList\">");

            for (int i = 0; i < 8; i = i + 2)
            {
                sb.Append("<tr class=\"dg_trbg1\"><td>").Append(dtMatch.Rows[i]["NO"].ToString())
                .Append("</td><td>").Append(dtMatch.Rows[i]["Team"].ToString()).Append(" VS ").Append(dtMatch.Rows[i + 1]["Team"].ToString())
                .Append("</td><td>").Append(dtMatch.Rows[i]["DateTime"].ToString())
                .Append("</td><td>");
                if (Number.Substring(0, 1).Equals("("))
                {
                    sb.Append(Number.Substring(1, Number.IndexOf(")") - 1));
                    Number = Number.Substring(Number.IndexOf(")") + 1);
                }
                else
                {
                    sb.Append(Number.Substring(0, 1));
                    Number = Number.Substring(1);
                }
                sb.Append("</td></tr>");
            }

            sb.Append("</tbody></table>");
        }
        else if ((new SLS.Lottery.JCLQ().CheckPlayType(Shove._Convert.StrToInt(playid, -1))) || (new SLS.Lottery.JCZQ().CheckPlayType(Shove._Convert.StrToInt(playid, -1))))
        {
            codes = PF.GetScriptResTable(codes);
            sb.Append(codes);
        }
        else
        {
            codes = Shove._Convert.ToHtmlCode(codes) + "&nbsp;";
            sb.Append(codes);
        }

        labLotteryNumber.Text = sb.ToString();
        labMultiple.Text      = beishu;
        labSchemeMoney.Text   = summoney.ToString();
        labNum.Text           = zhushu;

        DataTable dt = new DAL.Tables.T_Isuses().Open("", "ID=" + isuseid.ToString(), "");

        if (dt == null || dt.Rows.Count != 1)
        {
            return;
        }

        labEndTime.Text = Shove._Convert.StrToDateTime(dt.Rows[0]["EndTime"].ToString(), DateTime.Now.AddHours(1).ToString()).ToString("yyyy-MM-dd HH:mm");

        hidplayid.Value       = playid.ToString();
        hidlotid.Value        = lotid;
        hidSchemeMoney.Value  = summoney.ToString();
        hidMultiple.Value     = beishu;
        hidisuseid.Value      = isuseid.ToString();
        hidcodes.Value        = codes;
        hidSumNum.Value       = zhushu;
        HidIsuseEndTime.Value = dt.Rows[0]["EndTime"].ToString();
    }