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 System.Data.OleDb;
using System.Text;

public partial class ShowArticle : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string s = Request.QueryString["id"];
        if (!string.IsNullOrEmpty(s))
            getArticle(s);
    }

    void getArticle(string s)
    {
        OleDbDataReader dr = null;
        try
        {
            
            int id = Convert.ToInt32(s);
            string sqlu = "Update Article set arthit=arthit+1 where id="+id;
            SqlHelper.ExecuteSql(sqlu);
            string sql = string.Format("SELECT * FROM ARTICLE WHERE ID = {0}", id);
            dr = SqlHelper.ExecuteReader(sql);
            StringBuilder sb = new StringBuilder();
            if (dr.Read())
            {
                sb.AppendFormat("<tr><td valign=\"top\"><div  class=\"artdiv1\"><span>{0}</span>", dr["arttitle"]);
                sb.AppendFormat("<li>文章来源：{0}</li><li>发表人：{1}</li>", dr["artFrom"], dr["artAuthor"]);
                sb.AppendFormat("<li>点击次数：{0}</li><li>发表时间：{1}</li>", dr["artHit"], (DateTime.Parse(dr["artTime"].ToString())).ToString("yyyy-MM-dd"));
                sb.Append("</div><br /><br /><div ><div class=\"artdiv\"><li style=\"text-align:left;\">");
                sb.AppendFormat("{0}", dr["artText"]);
                sb.Append("</div></div><div style=\"margin:10px;\"></div></td></tr>");
                this.Page.Title = dr["arttitle"] + "--实用网址批量提交(SEO)工具";
            }
            else
                sb.Append("未找到该文章数据");
            this.artList.InnerHtml = sb.ToString();
        }
        catch (Exception ex)
        {
            this.artList.InnerHtml = "未找到该文章数据--" + Server.HtmlEncode(ex.Message);
        }
        finally { if (dr != null) dr.Close(); }
    }
}

////////////5//1//a//s//p//x///////////////////////