コード例 #1
0
ファイル: Receive.aspx.cs プロジェクト: object8421/ichari
    // 返奖查询 查询类型106(查询返奖)
    private void QueryOpen()
    {
        DataTable dt = new DAL.Views.V_Isuses().Open("top 1 [ID], LotteryID, [Name]", " IsOpened = 0 and EndTime <  GetDate()", " EndTime desc");

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

        DataRow  dr  = dt.Rows[0];
        DateTime Now = DateTime.Now;

        string Body = "<body><bonusQuery><issue gameName=\"" + GetGameName(int.Parse(dr["LotteryID"].ToString())) + "\" number=\"" + dr["Name"].ToString() + "\"/></bonusQuery></body>";

        string MessageID = ElectronTicket_HPCQ_UserName + Now.ToString("yyyyMMdd") + Now.ToString("HHmmss") + "00";
        string TimeStamp = Now.ToString("yyyyMMdd") + Now.ToString("HHmmss");

        string Message = "<?xml version=\"1.0\" encoding=\"GBK\"?>";

        Message += "<message version=\"1.0\" id=\"" + MessageID + "\">";
        Message += "<header>";
        Message += "<messengerID>" + ElectronTicket_HPCQ_UserName + "</messengerID>";
        Message += "<timestamp>" + TimeStamp + "</timestamp>";
        Message += "<transactionType>106</transactionType>";
        Message += "<digest>" + Shove._Security.Encrypt.MD5(MessageID + TimeStamp + ElectronTicket_HPCQ_UserPassword + Body, "gb2312") + "</digest>";
        Message += "</header>";
        Message += Body;
        Message += "</message>";

        string MessageInfo = PF.Post(ElectronTicket_HPCQ_Getway, "transType=106&transMessage=" + Message, TimeoutSeconds);

        BonusQuery(MessageInfo.Substring(27));
    }
コード例 #2
0
ファイル: PrintOutput.aspx.cs プロジェクト: object8421/ichari
    protected void btnDownload_txt_Click(object sender, EventArgs e)
    {
        DataTable dt = new DAL.Views.V_Isuses().Open("", "[ID] = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue), "");

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

            return;
        }

        string FileName = dt.Rows[0]["Code"].ToString() + dt.Rows[0]["Name"].ToString() + ".txt";

        dt = new DAL.Views.V_SchemeSchedules().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0", "[Money] desc");

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

            return;
        }

        if (dt.Rows.Count < 1)
        {
            Shove._Web.JavaScript.Alert(this.Page, "没有数据。");

            return;
        }

        HttpResponse response;

        response = Page.Response;
        response.AppendHeader("Content-Disposition", "attachment;filename=" + FileName);
        Response.ContentType     = "application/ms-txt";
        response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");

        foreach (DataRow dr in dt.Rows)
        {
            string LotteryNumber = dr["LotteryNumber"].ToString();

            response.Write("***********************************************\r\n");
            response.Write("站点编号: " + dr["SiteID"].ToString() + "\r\n");
            response.Write("方案编号: " + dr["SchemeNumber"].ToString() + "\t内部编号:" + dr["ID"].ToString() + "\r\n");
            response.Write("方案类别: " + dr["PlayTypeName"].ToString() + "\r\n");
            response.Write("方案倍数: " + dr["Multiple"].ToString() + "\t方案金额:" + double.Parse(dr["Money"].ToString()).ToString("N") + "\r\n");
            response.Write("***********************************************\r\n");
            response.Write(LotteryNumber);
            response.Write("\r\n\r\n\r\n");
        }

        response.End();
    }
コード例 #3
0
ファイル: PrintOutput.aspx.cs プロジェクト: object8421/ichari
    protected void btnDownload_Click(object sender, EventArgs e)
    {
        DataTable dt = new DAL.Views.V_Isuses().Open("", "[id] = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue), "");

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

            return;
        }

        string FileName = dt.Rows[0]["Code"].ToString() + dt.Rows[0]["Name"].ToString() + ".xls";

        dt = new DAL.Views.V_SchemeSchedules().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0", "[Money] desc");

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

            return;
        }

        if (dt.Rows.Count < 1)
        {
            Shove._Web.JavaScript.Alert(this.Page, "没有数据。");

            return;
        }

        HttpResponse response;

        response = Page.Response;
        response.AppendHeader("Content-Disposition", "attachment;filename=" + FileName);
        Response.ContentType     = "application/ms-excel";
        response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
        response.Write("站点编号\t内部编号\t方案编号\t类别\t购买内容\t倍数\t金额\t彩票标识号\n");

        foreach (DataRow dr in dt.Rows)
        {
            string LotteryNumber = "";
            try
            {
                LotteryNumber = "| " + dr["LotteryNumber"].ToString().Replace("\r\n", " | ") + " |";
            }
            catch { }
            response.Write(dr["SiteID"].ToString() + "\t" + dr["ID"].ToString() + "\t" + dr["SchemeNumber"].ToString() + "\t" + dr["PlayTypeName"].ToString() + "\t" + LotteryNumber + "\t" + dr["Multiple"].ToString() + "\t" + dr["Money"].ToString() + "\t<请输入标识号>\n");
        }

        response.End();
    }
コード例 #4
0
 protected void btnDownload_Click(object sender, EventArgs e)
 {
     DataTable table = new Views.V_Isuses().Open("", "[id] = " + Utility.FilteSqlInfusion(this.ddlIsuse.SelectedValue), "");
     if ((table == null) || (table.Rows.Count < 1))
     {
         PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
     }
     else
     {
         string str = table.Rows[0]["Code"].ToString() + table.Rows[0]["Name"].ToString() + ".xls";
         table = new Views.V_SchemeSchedules().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.ddlIsuse.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0", "[Money] desc");
         if (table == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
         }
         else if (table.Rows.Count < 1)
         {
             JavaScript.Alert(this.Page, "没有数据。");
         }
         else
         {
             HttpResponse response = this.Page.Response;
             response.AppendHeader("Content-Disposition", "attachment;filename=" + str);
             base.Response.ContentType = "application/ms-excel";
             response.ContentEncoding = Encoding.GetEncoding("gb2312");
             response.Write("站点编号\t内部编号\t方案编号\t类别\t购买内容\t倍数\t金额\t彩票标识号\n");
             foreach (DataRow row in table.Rows)
             {
                 string str2 = "";
                 try
                 {
                     str2 = "| " + row["LotteryNumber"].ToString().Replace("\r\n", " | ") + " |";
                 }
                 catch
                 {
                 }
                 response.Write(row["SiteID"].ToString() + "\t" + row["ID"].ToString() + "\t" + row["SchemeNumber"].ToString() + "\t" + row["PlayTypeName"].ToString() + "\t" + str2 + "\t" + row["Multiple"].ToString() + "\t" + row["Money"].ToString() + "\t<请输入标识号>\n");
             }
             response.End();
         }
     }
 }
コード例 #5
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;
            }
        }
    }
コード例 #6
0
ファイル: PrintOutput.aspx.cs プロジェクト: object8421/ichari
    protected void btnOkoooDownload_txt_Click(object sender, EventArgs e)
    {
        DataTable dt = new DAL.Views.V_Isuses().Open("", "[ID] = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue), "");

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

            return;
        }

        string FileName = dt.Rows[0]["Code"].ToString() + dt.Rows[0]["Name"].ToString() + ".txt";

        dt = new DAL.Views.V_SchemeSchedules().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0", "[Money] desc");

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

            return;
        }

        if (dt.Rows.Count < 1)
        {
            Shove._Web.JavaScript.Alert(this.Page, "没有数据。");

            return;
        }

        HttpResponse response;

        response = Page.Response;
        response.AppendHeader("Content-Disposition", "attachment;filename=" + FileName);
        Response.ContentType     = "application/ms-txt";
        response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");

        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);
        }

        foreach (DataRow dr in dt.Rows)
        {
            string LotteryNumber = dr["LotteryNumber"].ToString();
            int    PlayTypeID    = Shove._Convert.StrToInt(dr["PlayTypeID"].ToString(), 0);

            ArrayList al = new ArrayList();

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

            string CanonicalNumber = "";

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

            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]);
                }
            }

            string[] 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();
            }

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

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

                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
                { }

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


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

                long MatchID = 0;

                response.Write(dr["SchemeNumber"].ToString() + "," + PlayTypeName(PlayTypeID) + ",T,");

                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[] drMatch = dtMatch.Select("ID=" + MatchID.ToString());

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

                    response.Write("(" + GetMatchNumber(drMatch[0]["MatchNumber"].ToString()) + ">" + Getesult(PlayTypeID, Numbers[i].Substring(Numbers[i].IndexOf("(") + 1, Numbers[i].IndexOf(")") - Numbers[i].IndexOf("(") - 1)) + ")");
                }

                response.Write("," + BuyWays + "," + Multiple + "," + (2 * Multiple).ToString() + "\r\n");
            }
        }

        response.End();
    }
コード例 #7
0
ファイル: PrintOutput.aspx.cs プロジェクト: ichari/ichari
    protected void btnOkoooDownload_txt_Click(object sender, EventArgs e)
    {
        DataTable dt = new DAL.Views.V_Isuses().Open("", "[ID] = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue), "");

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

            return;
        }

        string FileName = dt.Rows[0]["Code"].ToString() + dt.Rows[0]["Name"].ToString() + ".txt";

        dt = new DAL.Views.V_SchemeSchedules().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0", "[Money] desc");

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

            return;
        }

        if (dt.Rows.Count < 1)
        {
            Shove._Web.JavaScript.Alert(this.Page, "没有数据。");

            return;
        }

        HttpResponse response;

        response = Page.Response;
        response.AppendHeader("Content-Disposition", "attachment;filename=" + FileName);
        Response.ContentType = "application/ms-txt";
        response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");

        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);
        }

        foreach (DataRow dr in dt.Rows)
        {
            string LotteryNumber = dr["LotteryNumber"].ToString();
            int PlayTypeID = Shove._Convert.StrToInt(dr["PlayTypeID"].ToString(), 0);

            ArrayList al = new ArrayList();

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

            string CanonicalNumber = "";

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

            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]);
                }
            }

            string[] 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();
            }

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

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

                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
                { }

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


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

                long MatchID = 0;

                response.Write(dr["SchemeNumber"].ToString() + "," + PlayTypeName(PlayTypeID) + ",T,");

                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[] drMatch = dtMatch.Select("ID=" + MatchID.ToString());

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

                    response.Write("(" + GetMatchNumber(drMatch[0]["MatchNumber"].ToString()) + ">" + Getesult(PlayTypeID, Numbers[i].Substring(Numbers[i].IndexOf("(") + 1, Numbers[i].IndexOf(")") - Numbers[i].IndexOf("(") - 1)) + ")");

                }

                response.Write("," + BuyWays + "," + Multiple + "," + (2 * Multiple).ToString() + "\r\n");
            }
        }

        response.End();
    }
コード例 #8
0
ファイル: PrintOutput.aspx.cs プロジェクト: ichari/ichari
    protected void btnDownload_txt_Click(object sender, EventArgs e)
    {
        DataTable dt = new DAL.Views.V_Isuses().Open("", "[ID] = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue), "");

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

            return;
        }

        string FileName = dt.Rows[0]["Code"].ToString() + dt.Rows[0]["Name"].ToString() + ".txt";

        dt = new DAL.Views.V_SchemeSchedules().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0", "[Money] desc");

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

            return;
        }

        if (dt.Rows.Count < 1)
        {
            Shove._Web.JavaScript.Alert(this.Page, "没有数据。");

            return;
        }

        HttpResponse response;

        response = Page.Response;
        response.AppendHeader("Content-Disposition", "attachment;filename=" + FileName);
        Response.ContentType = "application/ms-txt";
        response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");

        foreach (DataRow dr in dt.Rows)
        {
            string LotteryNumber = dr["LotteryNumber"].ToString();

            response.Write("***********************************************\r\n");
            response.Write("站点编号: " + dr["SiteID"].ToString() + "\r\n");
            response.Write("方案编号: " + dr["SchemeNumber"].ToString() + "\t内部编号:" + dr["ID"].ToString() + "\r\n");
            response.Write("方案类别: " + dr["PlayTypeName"].ToString() + "\r\n");
            response.Write("方案倍数: " + dr["Multiple"].ToString() + "\t方案金额:" + double.Parse(dr["Money"].ToString()).ToString("N") + "\r\n");
            response.Write("***********************************************\r\n");
            response.Write(LotteryNumber);
            response.Write("\r\n\r\n\r\n");
        }

        response.End();
    }
コード例 #9
0
ファイル: PrintOutput.aspx.cs プロジェクト: ichari/ichari
    protected void btnDownload_Click(object sender, EventArgs e)
    {
        DataTable dt = new DAL.Views.V_Isuses().Open("", "[id] = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue), "");

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

            return;
        }

        string FileName = dt.Rows[0]["Code"].ToString() + dt.Rows[0]["Name"].ToString() + ".xls";

        dt = new DAL.Views.V_SchemeSchedules().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0", "[Money] desc");

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

            return;
        }

        if (dt.Rows.Count < 1)
        {
            Shove._Web.JavaScript.Alert(this.Page, "没有数据。");

            return;
        }

        HttpResponse response;

        response = Page.Response;
        response.AppendHeader("Content-Disposition", "attachment;filename=" + FileName);
        Response.ContentType = "application/ms-excel";
        response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
        response.Write("站点编号\t内部编号\t方案编号\t类别\t购买内容\t倍数\t金额\t彩票标识号\n");

        foreach (DataRow dr in dt.Rows)
        {
            string LotteryNumber = "";
            try
            {
                LotteryNumber = "| " + dr["LotteryNumber"].ToString().Replace("\r\n", " | ") + " |";
            }
            catch { }
            response.Write(dr["SiteID"].ToString() + "\t" + dr["ID"].ToString() + "\t" + dr["SchemeNumber"].ToString() + "\t" + dr["PlayTypeName"].ToString() + "\t" + LotteryNumber + "\t" + dr["Multiple"].ToString() + "\t" + dr["Money"].ToString() + "\t<请输入标识号>\n");
        }

        response.End();
    }
コード例 #10
0
ファイル: Receive.aspx.cs プロジェクト: ichari/ichari
    // 返奖查询 查询类型106(查询返奖)
    private void QueryOpen()
    {
        DataTable dt = new DAL.Views.V_Isuses().Open("top 1 [ID], LotteryID, [Name]", " IsOpened = 0 and EndTime <  GetDate()", " EndTime desc");

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

        DataRow dr = dt.Rows[0];
        DateTime Now = DateTime.Now;

        string Body = "<body><bonusQuery><issue gameName=\"" + GetGameName(int.Parse(dr["LotteryID"].ToString())) + "\" number=\"" + dr["Name"].ToString() + "\"/></bonusQuery></body>";

        string MessageID = ElectronTicket_HPCQ_UserName + Now.ToString("yyyyMMdd") + Now.ToString("HHmmss") + "00";
        string TimeStamp = Now.ToString("yyyyMMdd") + Now.ToString("HHmmss");

        string Message = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
        Message += "<message version=\"1.0\" id=\"" + MessageID + "\">";
        Message += "<header>";
        Message += "<messengerID>" + ElectronTicket_HPCQ_UserName + "</messengerID>";
        Message += "<timestamp>" + TimeStamp + "</timestamp>";
        Message += "<transactionType>106</transactionType>";
        Message += "<digest>" + Shove._Security.Encrypt.MD5(MessageID + TimeStamp + ElectronTicket_HPCQ_UserPassword + Body, "gb2312") + "</digest>";
        Message += "</header>";
        Message += Body;
        Message += "</message>";

        string MessageInfo = PF.Post(ElectronTicket_HPCQ_Getway, "transType=106&transMessage=" + Message, TimeoutSeconds);

        BonusQuery(MessageInfo.Substring(27));
    }
コード例 #11
0
 private void BindData()
 {
     DataTable table = new Views.V_SchemeSchedulesWithQuashed().Open("", "SiteID = " + base._Site.ID.ToString() + " and [id] = " + Shove._Web.Utility.FilteSqlInfusion(this.tbSchemeID.Text), "");
     if ((table == null) || (table.Rows.Count < 1))
     {
         PF.GoError(4, "数据库繁忙,请重试(-141)", base.GetType().BaseType.FullName);
     }
     else
     {
         DataTable table4;
         DataRow row = table.Rows[0];
         long num = _Convert.StrToLong(row["InitiateUserID"].ToString(), 0L);
         this.hfID.Value = num.ToString();
         this.LotteryName = row["LotteryName"].ToString();
         if (this.LotteryName == "江西时时彩")
         {
             this.LotteryName = this.LotteryName.Replace("江西", "");
         }
         this.Label3.Text = this.LotteryName + "<font class='red14'>" + row["IsuseName"].ToString() + "</font>期" + row["PlayTypeName"].ToString() + "认购方案";
         this.labTitle.Text = row["IsuseName"].ToString();
         this.labStartTime.Text = row["StartTime"].ToString();
         this.tbIsuseID.Text = row["IsuseID"].ToString();
         this.tbLotteryID.Text = row["LotteryID"].ToString();
         this.LotteryID = this.tbLotteryID.Text;
         this.PlayTypeID = _Convert.StrToInt(row["PlayTypeID"].ToString(), 0);
         this.labEndTime.Text = row["SystemEndTime"].ToString();
         if (_Convert.StrToInt(row["LotteryID"].ToString(), 0) == 0x2d)
         {
             string scheme = row["LotteryNumber"].ToString();
             string buyContent = "";
             string cnLocateWaysAndMultiples = "";
             Lottery lottery = new Lottery();
             if (lottery["45"].GetSchemeSplit(scheme, ref buyContent, ref cnLocateWaysAndMultiples))
             {
                 string str4 = buyContent.Split(new char[] { '|' })[0].ToString();
                 DataTable table2 = new Views.V_IsuseForZCDC().Open("DateTime", "[IsuseID]=" + this.tbIsuseID.Text + " and [No]=" + str4.Split(new char[] { '(' })[0], "");
                 if ((table2 == null) || (table2.Rows.Count == 0))
                 {
                     PF.GoError(4, "数据库繁忙,请重试(-184)", base.GetType().FullName);
                     return;
                 }
                 DataTable table3 = new Tables.T_PlayTypes().Open("SystemEndAheadMinute", "[ID] = " + row["PlayTypeID"], "");
                 this.labEndTime.Text = _Convert.StrToDateTime(table2.Rows[0][0].ToString(), DateTime.Now.ToString()).AddMinutes(_Convert.StrToDouble(table3.Rows[0][0].ToString(), 0.0)).ToString();
             }
         }
         this.labInitiateUser.Text = row["InitiateName"].ToString() + "&nbsp;&nbsp;【<A class=li3 href='../Web/Score.aspx?id=" + row["InitiateUserID"].ToString() + "&LotteryID=" + this.tbLotteryID.Text + "' target='_blank'>发起人历史战绩</A>】";
         short num2 = _Convert.StrToShort(row["QuashStatus"].ToString(), 0);
         Shove._Web.Cache.SetCache("All_QuashStatus" + this.SchemeID, num2, 0xe10);
         bool flag = _Convert.StrToBool(row["Buyed"].ToString(), false);
         int num3 = _Convert.StrToInt(row["Share"].ToString(), 0);
         int num4 = _Convert.StrToInt(row["BuyedShare"].ToString(), 0);
         double num5 = _Convert.StrToDouble(row["Money"].ToString(), 0.0);
         double num6 = _Convert.StrToDouble(row["AssureMoney"].ToString(), 0.0);
         double num7 = _Convert.StrToDouble(row["WinMoney"].ToString(), 0.0);
         short num8 = _Convert.StrToShort(row["SecrecyLevel"].ToString(), 0);
         bool flag2 = false;
         _Convert.StrToBool(row["isCanChat"].ToString(), false);
         if (num3 > 1)
         {
             this.trBonusScale.Visible = true;
             this.lbSchemeBonus.Text = ((_Convert.StrToDouble(row["SchemeBonusScale"].ToString(), 0.04) * 100.0)).ToString() + "%";
         }
         this.HidSchedule.Value = row["Schedule"].ToString();
         table4 = table4 = new Views.V_Isuses().Open("IsOpened, WinLotteryNumber,Code", "[id] = " + row["IsuseID"].ToString(), "");
         if (table4 == null)
         {
             PF.GoError(4, "数据库繁忙,请重试(-213)", base.GetType().FullName);
         }
         else if (table4.Rows.Count < 1)
         {
             PF.GoError(1, "系统错误(-220)", base.GetType().FullName);
         }
         else
         {
             flag2 = _Convert.StrToBool(table4.Rows[0]["IsOpened"].ToString(), true);
             this.lbWinNumber.Text = table4.Rows[0]["WinLotteryNumber"].ToString();
             this.ImageLogo.ImageUrl = "images/lottery/" + table4.Rows[0]["Code"].ToString().ToLower() + ".jpg";
             if (!base._Site.SiteOptions["Opt_FullSchemeCanQuash"].ToBoolean(false))
             {
                 this.btnQuashScheme.Visible = (((num2 == 0) && !flag) && ((num3 > num4) && (base._User != null))) && (num == base._User.ID);
             }
             else
             {
                 this.btnQuashScheme.Visible = (((num2 == 0) && !flag) && (base._User != null)) && (num == base._User.ID);
             }
             short num10 = _Convert.StrToShort(row["AtTopStatus"].ToString(), 0);
             bool flag4 = num10 != 0;
             if (num10 == 0)
             {
                 this.cbAtTopApplication.Visible = (((num2 == 0) && !flag) && ((num3 > num4) && (base._User != null))) && (num == base._User.ID);
                 this.cbAtTopApplication.Checked = flag4;
             }
             else
             {
                 this.labAtTop.Visible = true;
             }
             bool flag5 = false;
             bool flag6 = false;
             DateTime time5 = _Convert.StrToDateTime(this.labEndTime.Text, DateTime.Now.ToString());
             if (DateTime.Now >= time5)
             {
                 flag6 = true;
                 this.tbStop.Text = flag6.ToString();
             }
             if (num2 > 0)
             {
                 if (num2 == 2)
                 {
                     this.labState.Text = "已撤单(系统撤单)";
                 }
                 else
                 {
                     this.labState.Text = "已撤单";
                 }
             }
             else if (flag6)
             {
                 this.labState.Text = "已截止";
             }
             else if (flag)
             {
                 this.labState.Text = "<FONT color='red'>已成功</font>";
             }
             else if (num3 <= num4)
             {
                 this.labState.Text = "<FONT color='red'>已满员</font>";
             }
             else
             {
                 this.labState.Text = "<font color='red'>抢购中...</font>";
                 flag5 = true;
             }
             this.labMultiple.Text = row["Multiple"].ToString();
             if (((num8 == 1) && !flag6) && ((base._User == null) || (((base._User != null) && (num != base._User.ID)) && !base._User.isOwnedViewSchemeCompetence())))
             {
                 this.labLotteryNumber.Text = "投注内容已经被保密,将在本期投注截止后公开。";
             }
             else if (((num8 == 2) && !flag2) && ((base._User == null) || (((base._User != null) && (num != base._User.ID)) && !base._User.isOwnedViewSchemeCompetence())))
             {
                 this.labLotteryNumber.Text = "投注内容已经被保密,将在本期开奖后公开。";
             }
             else if ((num8 == 3) && ((base._User == null) || (((base._User != null) && (num != base._User.ID)) && !base._User.isOwnedViewSchemeCompetence())))
             {
                 this.labLotteryNumber.Text = "投注内容已经被保密。";
             }
             else
             {
                 int num11 = base._Site.SiteOptions["Opt_MaxShowLotteryNumberRows"].ToShort(0);
                 string str = "";
                 try
                 {
                     str = row["LotteryNumber"].ToString();
                 }
                 catch
                 {
                 }
                 if (_String.StringAt(str, '\n') < num11)
                 {
                     if (new Lottery.ZCDC().CheckPlayType(_Convert.StrToInt(row["PlayTypeID"].ToString(), -1)))
                     {
                         string vote = "";
                         DataTable table5 = PF.GetZCDCBuyContent(str, this.SchemeID, ref vote);
                         if (table5 == null)
                         {
                             PF.GoError(4, "数据访问错误(-358)", base.GetType().FullName);
                             return;
                         }
                         this.labMultiple.Text = vote;
                         this.rptScheme.DataSource = table5;
                         this.rptScheme.DataBind();
                         this.rptScheme.Visible = true;
                     }
                     else
                     {
                         this.labLotteryNumber.Text = _Convert.ToHtmlCode(str) + "&nbsp;";
                         if (flag2)
                         {
                             this.NumberDuiBi(this.labLotteryNumber.Text, this.lbWinNumber.Text, this.PlayTypeID);
                         }
                     }
                 }
                 else
                 {
                     this.linkDownloadScheme.Visible = true;
                     this.linkDownloadLotteryIdentifiers.Visible = (base._User == null) || ((base._User != null) && ((base._User.ID.ToString() == row["InitiateUserID"].ToString()) || base._User.Competences["Administrator"]));
                     this.linkDownloadLotteryIdentifiers.NavigateUrl = "../Web/DownLotteryIdentifiers.aspx?id=" + this.tbSchemeID.Text;
                     this.linkDownloadScheme.NavigateUrl = "../Web/DownloadSchemeFile.aspx?id=" + this.tbSchemeID.Text;
                 }
             }
             this.labSchemeNumber.Text = row["SchemeNumber"].ToString();
             this.labSchemeDateTime.Text = row["DateTime"].ToString();
             this.labSchemeMoney.Text = _Convert.StrToDouble(row["Money"].ToString(), 0.0).ToString("N");
             this.labSchemeTitle.Text = row["Title"].ToString() + "&nbsp;";
             this.labSchemeDescription.Text = row["Description"].ToString() + "&nbsp;";
             this.labSchemeADUrl.Text = Shove._Web.Utility.GetUrl() + "/Home/Room/Scheme.aspx?id=" + this.tbSchemeID.Text;
             object[] args = new object[] { this.labSchemeMoney.Text, num3, (num5 / ((double)num3)).ToString("N"), num4, ((num5 / ((double)num3)) * num4).ToString("N") };
             this.labSchemeDetail.Text = string.Format("此方案总金额 <FONT color='red'>{0}</font> 元,共 <FONT color='red'>{1}</font> 份,每份 <FONT color='red'>{2}</font> 元。<br />已认购 <FONT color='red'>{3}</font> 份(金额 <FONT color='red'>{4}</font> 元)", args) + (flag5 ? string.Format(",还有 <FONT color='red'>{0}</font> 份(金额 <FONT color='red'>{1}</font> 元)可以认购!", num3 - num4, ((num5 / ((double)num3)) * (num3 - num4)).ToString("N")) : "");
             if ((string.IsNullOrEmpty(row["LotteryNumber"].ToString()) && (((this.LotteryID == "1") || (this.LotteryID == "2")) || (this.LotteryID == "15"))) && (((num2 == 0) && !flag6) && !flag))
             {
                 this.labLotteryNumber.Text = "未上传";
                 if ((base._User != null) && (row["InitiateUserID"].ToString() == base._User.ID.ToString()))
                 {
                     this.lbUploadScheme.Visible = true;
                 }
             }
             if (flag)
             {
                 this.labLotteryCode.Text = "已出票,彩票标识:";
                 this.linkDownloadLotteryIdentifiers.Visible = true;
                 this.linkDownloadLotteryIdentifiers.NavigateUrl = "../Web/DownLotteryIdentifiers.aspx?id=" + this.tbSchemeID.Text;
             }
             else
             {
                 this.labLotteryCode.Text = "暂未出票";
                 this.linkDownloadLotteryIdentifiers.Visible = false;
             }
             this.labAssureMoney.Text = (num6 > 0.0) ? string.Format("发起人保底 <FONT color='red'>{0}</font> 份,<FONT color='red'>{1}</font> 元", Math.Round((double)(num6 / (num5 / ((double)num3))), 0).ToString(), num6.ToString("N")) : "未保底";
             if (num2 > 0)
             {
                 if (num2 == 2)
                 {
                     this.labWin.Text = "已撤单(系统撤单)";
                 }
                 else
                 {
                     this.labWin.Text = "已撤单";
                 }
             }
             else if (flag6)
             {
                 this.labWin.Text = string.Format("<FONT color='red'>{0}</font> 元", num7.ToString("N"));
                 string str7 = row["WinDescription"].ToString();
                 if (str7 != "")
                 {
                     this.labWin.Text = this.labWin.Text + "<br />" + str7;
                 }
                 else if (flag2)
                 {
                     this.labWin.Text = this.labWin.Text + "  未中奖";
                 }
                 else
                 {
                     this.labWin.Text = this.labWin.Text + "  <font color='red'>【注】</font>中奖结果在开奖后需要一段时间才能显示。";
                 }
             }
             else
             {
                 this.labWin.Text = "尚未截止";
             }
             if (flag2 && (((this.LotteryID == "1") || (this.LotteryID == "2")) || (this.LotteryID == "15")))
             {
                 this.labWin.Text = this.labWin.Text + "(命中<font color='red'>" + this.CompareLotteryNumberToWinNumber(row["LotteryNumber"].ToString(), row["WinLotteryNumber"].ToString()).ToString() + "</font>场)";
             }
             if (flag6)
             {
                 this.labCannotBuyTip.Text = "方案已截止,不能认购";
                 this.labCannotBuyTip.Visible = true;
                 this.pBuy.Visible = false;
                 this.btnOK.Enabled = false;
             }
             else if (num2 > 0)
             {
                 this.labCannotBuyTip.Text = "方案已撤单,不能认购";
                 this.labCannotBuyTip.Visible = true;
                 this.pBuy.Visible = false;
                 this.btnOK.Enabled = false;
             }
             else if (num4 >= num3)
             {
                 this.labCannotBuyTip.Text = "方案已满员,不能认购";
                 this.labCannotBuyTip.Visible = true;
                 this.pBuy.Visible = false;
                 this.btnOK.Enabled = false;
             }
             else
             {
                 this.labCannotBuyTip.Visible = false;
                 this.pBuy.Visible = true;
                 this.btnOK.Enabled = true;
             }
             this.labShare.Text = (num3 - num4).ToString();
             this.labShareMoney.Text = (num5 / ((double)num3)).ToString("N");
             this.BindDataForUserList();
             if (base._User != null)
             {
                 DataTable dt = new Views.V_BuyDetailsWithQuashedAll().Open("[id],[DateTime],[Money],Share,SchemeShare,BuyedShare,QuashStatus,Buyed,IsuseID,Code,Schedule,DetailMoney,isWhenInitiate, WinMoneyNoWIthTax", "SiteID = " + base._Site.ID.ToString() + " and SchemeID = " + Shove._Web.Utility.FilteSqlInfusion(this.tbSchemeID.Text) + " and [UserID] = " + base._User.ID.ToString(), "[id]");
                 if (dt == null)
                 {
                     PF.GoError(4, "数据库繁忙,请重试(-518)", base.GetType().FullName);
                 }
                 else
                 {
                     if (dt.Rows.Count == 0)
                     {
                         this.labMyBuy.Text = "此方案还没有我的认购记录。";
                         this.labMyBuy.Visible = true;
                         this.g.Visible = false;
                     }
                     else
                     {
                         this.labMyBuy.Visible = false;
                         this.g.Visible = true;
                         PF.DataGridBindData(this.g, dt);
                         if (flag2)
                         {
                             double num23 = 0.0;
                             for (int i = 0; i < dt.Rows.Count; i++)
                             {
                                 num23 += double.Parse(dt.Rows[i]["WinMoneyNoWIthTax"].ToString());
                             }
                             this.lbReward.Text = num23.ToString("N");
                         }
                     }
                     if (base._User.UserType < 2)
                     {
                         this.btnOK.Enabled = false;
                         this.btnQuashScheme.Enabled = false;
                     }
                 }
             }
         }
     }
 }
コード例 #12
0
 protected void btnDownload_txt_Click(object sender, EventArgs e)
 {
     DataTable table = new Views.V_Isuses().Open("", "[ID] = " + Utility.FilteSqlInfusion(this.ddlIsuse.SelectedValue), "");
     if ((table == null) || (table.Rows.Count < 1))
     {
         PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
     }
     else
     {
         string str = table.Rows[0]["Code"].ToString() + table.Rows[0]["Name"].ToString() + ".txt";
         table = new Views.V_SchemeSchedules().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.ddlIsuse.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0", "[Money] desc");
         if (table == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
         }
         else if (table.Rows.Count < 1)
         {
             JavaScript.Alert(this.Page, "没有数据。");
         }
         else
         {
             HttpResponse response = this.Page.Response;
             response.AppendHeader("Content-Disposition", "attachment;filename=" + str);
             base.Response.ContentType = "application/ms-txt";
             response.ContentEncoding = Encoding.GetEncoding("utf-8");
             foreach (DataRow row in table.Rows)
             {
                 string s = row["LotteryNumber"].ToString();
                 response.Write("***********************************************\r\n");
                 response.Write("站点编号: " + row["SiteID"].ToString() + "\r\n");
                 response.Write("方案编号: " + row["SchemeNumber"].ToString() + "\t内部编号:" + row["ID"].ToString() + "\r\n");
                 response.Write("方案类别: " + row["PlayTypeName"].ToString() + "\r\n");
                 response.Write("方案倍数: " + row["Multiple"].ToString() + "\t方案金额:" + double.Parse(row["Money"].ToString()).ToString("N") + "\r\n");
                 response.Write("***********************************************\r\n");
                 response.Write(s);
                 response.Write("\r\n\r\n\r\n");
             }
             response.End();
         }
     }
 }
コード例 #13
0
 private void QueryOpen()
 {
     DataTable table = new Views.V_Isuses().Open("top 1 [ID], LotteryID, [Name]", " IsOpened = 0 and EndTime <  GetDate()", " EndTime desc");
     if ((table != null) && (table.Rows.Count >= 1))
     {
         DataRow row = table.Rows[0];
         DateTime now = DateTime.Now;
         string str = "<body><bonusQuery><issue gameName=\"" + this.GetGameName(int.Parse(row["LotteryID"].ToString())) + "\" number=\"" + row["Name"].ToString() + "\"/></bonusQuery></body>";
         string str2 = this.ElectronTicket_HPCQ_UserName + now.ToString("yyyyMMdd") + now.ToString("HHmmss") + "00";
         string str3 = now.ToString("yyyyMMdd") + now.ToString("HHmmss");
         string str5 = PF.Post(this.ElectronTicket_HPCQ_Getway, "transType=106&transMessage=" + (((((((("<?xml version=\"1.0\" encoding=\"GBK\"?>" + "<message version=\"1.0\" id=\"" + str2 + "\">") + "<header>") + "<messengerID>" + this.ElectronTicket_HPCQ_UserName + "</messengerID>") + "<timestamp>" + str3 + "</timestamp>") + "<transactionType>106</transactionType>") + "<digest>" + Encrypt.MD5(str2 + str3 + this.ElectronTicket_HPCQ_UserPassword + str, "gb2312") + "</digest>") + "</header>") + str + "</message>"), 120);
         this.BonusQuery(str5.Substring(0x1b));
     }
 }
コード例 #14
0
ファイル: Scheme.aspx.cs プロジェクト: ichari/ichari
    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;
            }
        }

    }