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.SqlClient;

public partial class showone : System.Web.UI.Page
{
    DataBaseLayer db = new DataBaseLayer();
    public string Author, UpdateTime,contents;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Request.QueryString["pid"].ToString() != "")
            {
                SqlDataReader dr = GetYuanWangByPromiseID(Convert.ToInt32(Request.QueryString["pid"].ToString()));
                if (dr.Read())
                {
                    Author = dr["Author"].ToString();
                    Contents.Text = dr["Contents"].ToString();
                    contents = Contents.Text;
                    UpdateTime = Convert.ToDateTime(dr["UpdateTime"]).ToString("yyyy-MM-dd");
                }
            }
        }
    }
    public SqlDataReader GetYuanWangByPromiseID(int PromiseID)
    {
        SqlParameter[] prams ={
            db.ParamBuilder("@PromiseID",PromiseID,SqlDbType.Int)
        };
        SqlDataReader dr = db.DataReader("Pr_Mp4_GetYuanWangByPromiseID", prams);
        return dr;
    }
}
