예제 #1
0
 private void BindData()
 {
     if (this.ddlIsuse.Items.Count >= 1)
     {
         DataTable table = new Views.V_SchemeSchedules().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.ddlIsuse.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0 and isOpened = 0", "[Money] desc");
         if (table == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", "Admin_PrintOutput");
         }
         else
         {
             table.Columns.Add("LocateWaysAndMultiples", Type.GetType("System.String"));
             string buyContent = "";
             string cnLocateWaysAndMultiples = "";
             for (int i = 0; i < table.Rows.Count; i++)
             {
                 table.Rows[i]["Money"] = double.Parse(table.Rows[i]["Money"].ToString()).ToString("N");
                 if (new Lottery()["45"].CheckPlayType(int.Parse(table.Rows[i]["PlayTypeID"].ToString())))
                 {
                     table.Rows[i]["Multiple"] = 0;
                     try
                     {
                         buyContent = "";
                         cnLocateWaysAndMultiples = "";
                         string str3   = "";
                         string scheme = table.Rows[i]["LotteryNumber"].ToString();
                         if (new Lottery()["45"].GetSchemeSplit(scheme, ref buyContent, ref cnLocateWaysAndMultiples))
                         {
                             string    vote   = "";
                             DataTable table2 = PF.GetZCDCBuyContent(scheme, _Convert.StrToLong(table.Rows[i]["ID"].ToString(), -1L), ref vote);
                             if (table2 == null)
                             {
                                 PF.GoError(4, "数据访问错误", base.GetType().BaseType.FullName);
                                 return;
                             }
                             foreach (DataRow row in table2.Rows)
                             {
                                 if (str3 == "")
                                 {
                                     string str6 = str3;
                                     str3 = str6 + row["No"].ToString() + " " + row["LeagueTypeName"].ToString() + " " + row["HostTeam"].ToString() + " VS " + row["QuestTeam"].ToString() + " " + row["Content"].ToString() + " " + row["LotteryResult"].ToString();
                                 }
                                 else
                                 {
                                     string str7 = str3;
                                     str3 = str7 + "<br />" + row["No"].ToString() + " " + row["LeagueTypeName"].ToString() + " " + row["HostTeam"].ToString() + " VS " + row["QuestTeam"].ToString() + " " + row["Content"].ToString() + " " + row["LotteryResult"].ToString();
                                 }
                             }
                             table.Rows[i]["LocateWaysAndMultiples"] = cnLocateWaysAndMultiples;
                         }
                         else
                         {
                             table.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                         }
                     }
                     catch
                     {
                         table.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                     }
                 }
                 table.AcceptChanges();
             }
             this.g.DataSource = table;
             this.g.DataBind();
             this.btnDownload.Enabled     = table.Rows.Count > 0;
             this.btnDownload_txt.Enabled = table.Rows.Count > 0;
             this.btnBuyAll.Visible       = table.Rows.Count > 0;
             this.fileUp.Disabled         = table.Rows.Count < 1;
             this.btnUpload.Enabled       = table.Rows.Count > 0;
         }
     }
 }
예제 #2
0
    protected void g_ItemDataBound(object sender, DataGridItemEventArgs e)
    {
        if (((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) || (e.Item.ItemType == ListItemType.EditItem))
        {
            e.Item.Attributes["onmouseover"] = "this.name=this.style.backgroundColor;this.style.backgroundColor='MistyRose'";
            e.Item.Attributes["onmouseout"]  = "this.style.backgroundColor=this.name;";
            e.Item.Cells[1].Text             = "<a href='../Home/Room/Scheme.aspx?id=" + e.Item.Cells[11].Text + "' target='_blank'>" + e.Item.Cells[1].Text + "</a>";
            e.Item.Cells[2].Text             = "<a href='../Score.aspx?id=" + e.Item.Cells[12].Text + "&LotteryID=" + this.listLottery.SelectedValue + "' target='_blank'>" + e.Item.Cells[2].Text + "</a>";
            if (_Convert.StrToDouble(e.Item.Cells[10].Text, 0.0) > 0.0)
            {
                TableCell cell1 = e.Item.Cells[2];
                cell1.Text = cell1.Text + "<font color='red'>(保)</font>";
            }
            double num = _Convert.StrToDouble(e.Item.Cells[4].Text, 0.0);
            e.Item.Cells[4].Text = (num == 0.0) ? "" : num.ToString("N");
            e.Item.ToolTip       = e.Item.Cells[5].Text.Trim();
            string text = e.Item.Cells[5].Text;
            e.Item.Cells[5].Text = "";
            if (new Lottery.ZCDC().CheckPlayType(_Convert.StrToInt(e.Item.Cells[14].Text, -1)))
            {
                string    vote  = "";
                DataTable table = PF.GetZCDCBuyContent(text, _Convert.StrToLong(e.Item.Cells[11].Text, -1L), ref vote);
                if (table == null)
                {
                    PF.GoError(4, "数据访问错误", base.GetType().BaseType.FullName);
                    return;
                }
                foreach (DataRow row in table.Rows)
                {
                    if (e.Item.Cells[5].Text == "")
                    {
                        TableCell cell2 = e.Item.Cells[5];
                        string    str3  = cell2.Text;
                        cell2.Text = str3 + row["No"].ToString() + " " + row["LeagueTypeName"].ToString() + " " + row["HostTeam"].ToString() + " VS " + row["QuestTeam"].ToString() + " " + row["Content"].ToString() + " " + row["LotteryResult"].ToString();
                    }
                    else
                    {
                        TableCell cell3 = e.Item.Cells[5];
                        string    str4  = cell3.Text;
                        cell3.Text = str4 + "<br />" + row["No"].ToString() + " " + row["LeagueTypeName"].ToString() + " " + row["HostTeam"].ToString() + " VS " + row["QuestTeam"].ToString() + " " + row["Content"].ToString() + " " + row["LotteryResult"].ToString();
                    }
                }
                TableCell cell4 = e.Item.Cells[5];
                cell4.Text = cell4.Text + "<br /><font color='red'>" + vote + "</font>";
            }
            else
            {
                e.Item.Cells[5].Text = text;
                if (_String.StringAt(text, '\n') >= base._Site.SiteOptions["Opt_MaxShowLotteryNumberRows"].ToShort(0))
                {
                    e.Item.Cells[5].Text = "<a href='../DownLoadSchemeFile.aspx?id=" + e.Item.Cells[11].Text + "' target='_blank'>下载方案</a>";
                }
                else
                {
                    text = e.Item.Cells[5].Text.Replace("\r\n", ", ");
                    if (text.Length > 0x19)
                    {
                        text = text.Substring(0, 0x17) + "..";
                    }
                    e.Item.Cells[5].Text = text;
                }
            }
            int num2 = _Convert.StrToInt(e.Item.Cells[6].Text, 1);
            e.Item.Cells[7].Text = Math.Round((double)(num / ((double)num2)), 2).ToString("N");
            TableCell cell5 = e.Item.Cells[8];
            cell5.Text = cell5.Text + "%";
            switch (_Convert.StrToShort(e.Item.Cells[13].Text, 0))
            {
            case 2:
                e.Item.Cells[9].Text = "<font color='blue'>系统撤单</font>";
                return;

            case 1:
                e.Item.Cells[9].Text = "已撤单";
                return;
            }
            if (_Convert.StrToBool(e.Item.Cells[0x10].Text, false))
            {
                e.Item.Cells[9].Text = "<Font color='Red'>已成功</font>";
            }
            else if (e.Item.Cells[8].Text == "100%")
            {
                e.Item.Cells[9].Text = "<Font color='Red'>满员</font>";
            }
            else
            {
                e.Item.Cells[9].Text = "未满";
            }
        }
    }
예제 #3
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;
                        }
                    }
                }
            }
        }
    }
예제 #4
0
    protected void g_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.EditItem)
        {
            e.Item.Attributes["onmouseover"] = "this.name=this.style.backgroundColor;this.style.backgroundColor='MistyRose'";
            e.Item.Attributes["onmouseout"]  = "this.style.backgroundColor=this.name;";

            e.Item.Cells[1].Text = "<a href='../Home/Room/Scheme.aspx?id=" + e.Item.Cells[11].Text + "' target='_blank'>" + e.Item.Cells[1].Text + "</a>";

            e.Item.Cells[2].Text = "<a href='../Home/Web/Score.aspx?id=" + e.Item.Cells[12].Text + "&LotteryID=" + listLottery.SelectedValue + "' target='_blank'>" + e.Item.Cells[2].Text + "</a>";

            if (Shove._Convert.StrToDouble(e.Item.Cells[10].Text, 0) > 0)
            {
                e.Item.Cells[2].Text += "<font color=\'red\'>(保)</font>";
            }

            double money;

            money = Shove._Convert.StrToDouble(e.Item.Cells[4].Text, 0);
            e.Item.Cells[4].Text = (money == 0) ? "" : money.ToString("N");

            e.Item.ToolTip = e.Item.Cells[5].Text.Trim();

            string str = e.Item.Cells[5].Text;
            e.Item.Cells[5].Text = "";

            if (new SZJS.Lottery.ZCDC().CheckPlayType(Shove._Convert.StrToInt(e.Item.Cells[14].Text, -1)))
            {
                string    vote  = "";
                DataTable dtnew = PF.GetZCDCBuyContent(str, Shove._Convert.StrToLong(e.Item.Cells[11].Text, -1), ref vote);

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

                    return;
                }

                foreach (DataRow dr in dtnew.Rows)
                {
                    if (e.Item.Cells[5].Text == "")
                    {
                        e.Item.Cells[5].Text += dr["No"].ToString() + " " + dr["LeagueTypeName"].ToString() + " " + dr["HostTeam"].ToString() + " VS " + dr["QuestTeam"].ToString() + " " + dr["Content"].ToString() + " " + dr["LotteryResult"].ToString();
                    }
                    else
                    {
                        e.Item.Cells[5].Text += "<br />" + dr["No"].ToString() + " " + dr["LeagueTypeName"].ToString() + " " + dr["HostTeam"].ToString() + " VS " + dr["QuestTeam"].ToString() + " " + dr["Content"].ToString() + " " + dr["LotteryResult"].ToString();
                    }
                }

                e.Item.Cells[5].Text += "<br /><font color='red'>" + vote + "</font>";
            }
            else
            {
                e.Item.Cells[5].Text = str;

                if (Shove._String.StringAt(str, '\n') >= _Site.SiteOptions["Opt_MaxShowLotteryNumberRows"].ToShort(0))
                {
                    e.Item.Cells[5].Text = "<a href='../Home/Web/DownLoadSchemeFile.aspx?id=" + e.Item.Cells[11].Text + "' target='_blank'>下载方案</a>";
                }
                else
                {
                    str = e.Item.Cells[5].Text.Replace("\r\n", ", ");

                    if (str.Length > 25)
                    {
                        str = str.Substring(0, 23) + "..";
                    }

                    e.Item.Cells[5].Text = str;
                }
            }

            int Share = Shove._Convert.StrToInt(e.Item.Cells[6].Text, 1);

            e.Item.Cells[7].Text  = Math.Round(money / Share, 2).ToString("N");
            e.Item.Cells[8].Text += "%";

            short QuashStatus = Shove._Convert.StrToShort(e.Item.Cells[13].Text, 0);

            if (QuashStatus == 2)
            {
                e.Item.Cells[9].Text = "<font color='blue'>系统撤单</font>";
            }
            else if (QuashStatus == 1)
            {
                e.Item.Cells[9].Text = "已撤单";
            }
            else
            {
                bool Buyed = Shove._Convert.StrToBool(e.Item.Cells[16].Text, false);

                if (Buyed)
                {
                    e.Item.Cells[9].Text = "<Font color=\'Red\'>等待出票</font>";
                }
                else
                {
                    if (e.Item.Cells[8].Text == "100%")
                    {
                        e.Item.Cells[9].Text = "<Font color=\'Red\'>满员</font>";
                    }
                    else
                    {
                        e.Item.Cells[9].Text = "未满";
                    }
                }
            }
        }
    }
예제 #5
0
    private void BindData()
    {
        if (ddlIsuse.Items.Count < 1)
        {
            return;
        }

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

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

            return;
        }

        dt.Columns.Add("LocateWaysAndMultiples", System.Type.GetType("System.String"));

        string BuyContent = "";
        string CnLocateWaysAndMultiples = "";

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            dt.Rows[i]["Money"] = double.Parse(dt.Rows[i]["Money"].ToString()).ToString("N");

            if (new SZJS.Lottery()[SZJS.Lottery.ZCDC.sID].CheckPlayType(int.Parse(dt.Rows[i]["PlayTypeID"].ToString())))
            {
                dt.Rows[i]["Multiple"] = 0;

                try
                {
                    BuyContent = "";
                    CnLocateWaysAndMultiples = "";

                    string BuyNumberContent = "";

                    string str = dt.Rows[i]["LotteryNumber"].ToString();;
                    if (new SZJS.Lottery()[SZJS.Lottery.ZCDC.sID].GetSchemeSplit(str, ref BuyContent, ref CnLocateWaysAndMultiples))
                    {
                        string    vote  = "";
                        DataTable dtnew = PF.GetZCDCBuyContent(str, Shove._Convert.StrToLong(dt.Rows[i]["ID"].ToString(), -1), ref vote);

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

                            return;
                        }

                        foreach (DataRow dr in dtnew.Rows)
                        {
                            if (BuyNumberContent == "")
                            {
                                BuyNumberContent += dr["No"].ToString() + " " + dr["LeagueTypeName"].ToString() + " " + dr["HostTeam"].ToString() + " VS " + dr["QuestTeam"].ToString() + " " + dr["Content"].ToString() + " " + dr["LotteryResult"].ToString();
                            }
                            else
                            {
                                BuyNumberContent += "<br />" + dr["No"].ToString() + " " + dr["LeagueTypeName"].ToString() + " " + dr["HostTeam"].ToString() + " VS " + dr["QuestTeam"].ToString() + " " + dr["Content"].ToString() + " " + dr["LotteryResult"].ToString();
                            }
                        }

                        dt.Rows[i]["LocateWaysAndMultiples"] = CnLocateWaysAndMultiples;
                    }
                    else
                    {
                        dt.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                    }
                }
                catch
                {
                    dt.Rows[i]["LocateWaysAndMultiples"] = "<font color='red'>读取错误!</font>";
                }
            }

            dt.AcceptChanges();
        }

        g.DataSource = dt;
        g.DataBind();

        btnDownload.Enabled     = (dt.Rows.Count > 0);
        btnDownload_txt.Enabled = (dt.Rows.Count > 0);

        btnBuyAll.Visible = (dt.Rows.Count > 0);

        fileUp.Disabled   = (dt.Rows.Count < 1);
        btnUpload.Enabled = (dt.Rows.Count > 0);
    }