Пример #1
0
 private string BindNewsForLottery(string TypeName)
 {
     string lotteryName = this.LotteryName;
     if (lotteryName == "福彩3D")
     {
         lotteryName = "3D";
     }
     string key = "Home_Room_Buy_BindNewsForLottery" + this.LotteryID.ToString();
     DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key);
     if (cacheAsDataTable == null)
     {
         cacheAsDataTable = new Views.V_News().Open("Title,Content,DateTime,TypeName", "IsShow=1 and TypeName like '" + lotteryName + "%'", "");
         if ((cacheAsDataTable == null) || (cacheAsDataTable.Rows.Count == 0))
         {
             return "";
         }
         Shove._Web.Cache.SetCache(key, cacheAsDataTable, 0x1770);
     }
     DataRow[] rowArray = cacheAsDataTable.Select("TypeName='" + TypeName + "'", "DateTime desc");
     StringBuilder builder = new StringBuilder();
     builder.Append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
     string input = "";
     string str4 = "";
     int num = 0;
     foreach (DataRow row in rowArray)
     {
         num++;
         if ((num % 6) == 0)
         {
             builder.Append("<tr><td colspan='2'><div id='hr' style=\"margin-top: 5px;margin-bottom: 5px;\" ></div> </td></tr>");
         }
         input = row["Title"].ToString().Trim();
         if ((input.IndexOf("<font class=red12>") > -1) || (input.IndexOf("<font class=black12>") > -1))
         {
             if (input.Contains("<font class=red12>"))
             {
                 str4 = "red12";
             }
             if (input.Contains("<font class=black12>"))
             {
                 str4 = "black12";
             }
             input = input.Replace("<font class=red12>", "").Replace("<font class=black12>", "").Replace("</font>", "");
             builder.Append("<tr>").Append("<td width=\"5%\" height=\"22\" align=\"center\" class=\"hui14\">").Append("<img src=\"../Home/Room/Images/jiantou_3.gif\" width=\"4\" height=\"8\" />").Append("</td>").Append("<td width=\"95%\" height=\"22\" class=\"hui12\">").Append("<a href='" + row["Content"].ToString() + "' target='_blank'>").Append("<font class = '" + str4 + "'>").Append(_String.Cut(input, 20)).Append("</font>").Append("</a></td></tr>");
         }
         else
         {
             builder.Append("<tr>").Append("<td width=\"5%\" height=\"22\" align=\"center\" class=\"hui14\">").Append("<img src=\"../Home/Room/Images/jiantou_3.gif\" width=\"4\" height=\"8\" />").Append("</td>").Append("<td width=\"95%\" height=\"22\" class=\"hui12\">").Append("<a href='" + row["Content"].ToString() + "' target='_blank'>").Append(_String.Cut(input, 20)).Append("</a></td></tr>");
         }
     }
     builder.Append("</table>");
     return builder.ToString();
 }
Пример #2
0
 public static string GetLotteryNews(int LotteryID)
 {
     DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(LotteryNews + LotteryID.ToString());
     StringBuilder builder = new StringBuilder();
     if ((cacheAsDataTable == null) || (cacheAsDataTable.Rows.Count == 0))
     {
         string str = "";
         if (LotteryID == 0x1c)
         {
             str = "重庆时时彩资讯";
         }
         if (LotteryID == 0x1d)
         {
             str = "时时乐资讯";
         }
         if (LotteryID == 0x3e)
         {
             str = "十一运夺金资讯";
         }
         if (LotteryID == 5)
         {
             str = "双色球资讯";
         }
         if (LotteryID == 6)
         {
             str = "3D资讯";
         }
         if (LotteryID == 0x27)
         {
             str = "超级大乐透资讯";
         }
         if (LotteryID == 0x3d)
         {
             str = "时时彩咨询";
         }
         if ((LotteryID == 0x3f) || (LotteryID == 0x40))
         {
             str = "排列3/5资讯";
         }
         if (((LotteryID == 1) || (LotteryID == 15)) || (LotteryID == 2))
         {
             str = "足彩资讯";
         }
         if (LotteryID == 70)
         {
             str = "11选5资讯";
         }
         if (LotteryID == 0x29)
         {
             str = "浙江体彩6+1资讯";
         }
         cacheAsDataTable = new Views.V_News().Open("top 8 Title,Content", "isShow = 1  and [TypeName] = '" + str + "'", "isCommend,DateTime desc");
         if ((cacheAsDataTable != null) && (cacheAsDataTable.Rows.Count > 0))
         {
             Cache.SetCache(LotteryNews + LotteryID.ToString(), cacheAsDataTable, 0xe10);
         }
     }
     string input = "";
     foreach (DataRow row in cacheAsDataTable.Rows)
     {
         if ((row["Title"].ToString().IndexOf("</font>") > -1) && (row["Title"].ToString().IndexOf("</font>") > -1))
         {
             input = row["Title"].ToString();
             if (input.IndexOf("class=red12") > 0)
             {
                 input = input.Substring(input.IndexOf(">") + 1, (input.IndexOf("</font>") - input.IndexOf(">")) - 1);
                 builder.Append("<tr>").Append("<td width=\"5%\" height=\"24\" align=\"center\" class=\"hui14\">").Append("&#9642;&nbsp;").Append("</td>").Append("<td width=\"95%\" height=\"22\" class=\"blue12\">").Append("<a href='").Append(row["Content"].ToString()).Append("' target='_blank'>").Append("<font class = 'red12'>").Append(_String.Cut(input, 15)).Append("</font>").Append("</a>").Append("</td>").Append("</tr>");
             }
             else
             {
                 input = input.Substring(input.IndexOf(">") + 1, (input.IndexOf("</font>") - input.IndexOf(">")) - 1);
                 builder.Append("<tr>").Append("<td width=\"5%\" height=\"24\" align=\"center\" class=\"hui14\">").Append("&#9642;&nbsp;").Append("</td>").Append("<td width=\"95%\" height=\"22\" class=\"blue12\">").Append("<a href='").Append(row["Content"].ToString()).Append("' target='_blank'>").Append("<font class = 'black12'>").Append(_String.Cut(input, 0x11)).Append("</font>").Append("</a>").Append("</td>").Append("</tr>");
             }
             continue;
         }
         builder.Append("<tr>").Append("<td width=\"5%\" height=\"24\" align=\"center\" class=\"hui14\">").Append("&#9642;&nbsp;").Append("</td>").Append("<td width=\"95%\" height=\"22\" class=\"blue12\">").Append("<a href='").Append(row["Content"].ToString()).Append("' target='_blank'>").Append(_String.Cut(row["Title"].ToString(), 15)).Append("</a>").Append("</td>").Append("</tr>");
     }
     return builder.ToString();
 }