Exemplo n.º 1
0
    public string GetAddone(int LotteryID, string IsuseID)
    {
        string    t_str = "";
        DataTable dt    = Shove._Web.Cache.GetCacheAsDataTable("DataCache_SFC" + IsuseID);

        if (dt == null || dt.Rows.Count == 0)
        {
            dt = new DAL.Tables.T_IsuseForSFC().Open(" top 14 * ", "IsuseID = " + IsuseID, "[No]");

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

            Shove._Web.Cache.SetCache("DataCache_SFC" + IsuseID, dt, 300);
        }

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            t_str += dt.Rows[i]["HostTeam"].ToString().Trim() + "," + dt.Rows[i]["QuestTeam"].ToString().Trim() + "," + dt.Rows[i]["DateTime"].ToString();
            if (i < dt.Rows.Count - 1)
            {
                t_str += ";";
            }
        }

        return(t_str);
    }
Exemplo n.º 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;
            }
        }
    }
Exemplo n.º 3
0
    private void BindData()
    {
        DataTable dt = new DAL.Tables.T_Isuses().Open("", "[ID]=" + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "");

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

            return;
        }

        tbIsuse.Text     = dt.Rows[0]["Name"].ToString();
        tbStartTime.Text = Shove._Convert.StrToDateTime(dt.Rows[0]["StartTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss");
        tbEndTime.Text   = Shove._Convert.StrToDateTime(dt.Rows[0]["EndTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss");

        if (tbLotteryID.Text == SLS.Lottery.SFC.sID || tbLotteryID.Text == SLS.Lottery.ZCSFC.sID || tbLotteryID.Text == SLS.Lottery.ZCRJC.sID)
        {
            dt = new DAL.Tables.T_IsuseForSFC().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "[No]");

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

                return;
            }

            if (dt.Rows.Count != 14)
            {
                return;
            }

            for (int i = 0; i < 14; i++)
            {
                TextBox tb   = (TextBox)this.FindControl("tbSFC" + (i + 1).ToString());
                TextBox tb_1 = (TextBox)this.FindControl("tbSFC" + (i + 1).ToString() + "_1");
                TextBox tb_2 = (TextBox)this.FindControl("tbSFC" + (i + 1).ToString() + "_2");

                tb.Text   = dt.Rows[i]["HostTeam"].ToString();
                tb_1.Text = dt.Rows[i]["QuestTeam"].ToString();
                tb_2.Text = dt.Rows[i]["DateTime"].ToString();
            }
        }

        if (tbLotteryID.Text == SLS.Lottery.JQC.sID)
        {
            dt = new DAL.Tables.T_IsuseForJQC().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "[No]");

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

                return;
            }

            for (int i = 0; i < 8; i++)
            {
                TextBox tb   = (TextBox)this.FindControl("tbJQC" + (i + 1).ToString());
                TextBox tb_2 = (TextBox)this.FindControl("tbJQC" + (i + 1).ToString() + "_2");

                tb.Text   = dt.Rows[i]["Team"].ToString();
                tb_2.Text = dt.Rows[i]["DateTime"].ToString();
            }
        }

        if (tbLotteryID.Text == SLS.Lottery.LCBQC.sID)
        {
            dt = new DAL.Tables.T_IsuseForLCBQC().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "[No]");

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

                return;
            }

            for (int i = 0; i < 6; i++)
            {
                TextBox tb   = (TextBox)this.FindControl("tbLCBQC" + (i + 1).ToString());
                TextBox tb_1 = (TextBox)this.FindControl("tbLCBQC" + (i + 1).ToString() + "_1");
                TextBox tb_2 = (TextBox)this.FindControl("tbLCBQC" + (i + 1).ToString() + "_2");

                tb.Text   = dt.Rows[i]["HostTeam"].ToString();
                tb_1.Text = dt.Rows[i]["QuestTeam"].ToString();
                tb_2.Text = dt.Rows[i]["DateTime"].ToString();
            }
        }

        if (tbLotteryID.Text == SLS.Lottery.LCDC.sID)
        {
            dt = new DAL.Tables.T_IsuseForLCDC().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "[No]");

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

                return;
            }

            for (int i = 0; i < 1; i++)
            {
                TextBox tb   = (TextBox)this.FindControl("tbLCDC" + (i + 1).ToString());
                TextBox tb_1 = (TextBox)this.FindControl("tbLCDC" + (i + 1).ToString() + "_1");
                TextBox tb_2 = (TextBox)this.FindControl("tbLCDC" + (i + 1).ToString() + "_2");

                tb.Text   = dt.Rows[i]["HostTeam"].ToString();
                tb_1.Text = dt.Rows[i]["QuestTeam"].ToString();
                tb_2.Text = dt.Rows[i]["DateTime"].ToString();
            }
        }

        DataTable dtTestNumber = new DAL.Tables.T_TestNumber().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "");

        DataTable dtTotalMoney = new DAL.Tables.T_TotalMoney().Open("", "IsuseID= " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "");


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

            return;
        }
        if (dtTotalMoney == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
            return;
        }
        if (dtTestNumber.Rows.Count > 0)
        {
            tbTestNumber.Text = dtTestNumber.Rows[0]["TestNumber"].ToString();
            hidID.Value       = dtTestNumber.Rows[0]["ID"].ToString();
        }
        if (dtTotalMoney.Rows.Count > 0)
        {
            tbMoney.Text  = dtTotalMoney.Rows[0]["TotalMoney"].ToString();
            moneyID.Value = dtTotalMoney.Rows[0]["ID"].ToString();
        }
    }
Exemplo n.º 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();
    }