using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using xl_data;
using xl_utils;

/* Add by Firgray.XL (Friday,February 06,2009) */
public partial class WebMain_news_newsshow : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string _content = null;
        DataTable dataTable = new Connection().GetDataTable("Select Top 5 * From News Where Showpic <> ''");
        int iCount = dataTable.Rows.Count;
        if (iCount > 0)
        {
            for (int i = 0; i < iCount; i++)
            {
                _content += string.Concat(new object[] { "<a href=\"china/newscenter.aspx?id=", dataTable.Rows[i]["Id"].ToString(), "\"><img src=\"", dataTable.Rows[i]["ShowPic"].ToString(), "\" alt=\"", dataTable.Rows[i]["Title"].ToString(), "\" style=\"width:130px;height:80px;border:1px solid #BED1DF;padding:2px;margin:3px\" /><br /><img src=\"images/pic/", dataTable.Rows[i]["PicSmall"].ToString(), "\" border=\"0\" />", Text.Left(dataTable.Rows[i]["Title"].ToString(), 20, false), "</a>" });
            }
        }
        dataTable.Dispose();
        this.newslist.InnerHtml = _content;
    }
}
