{
string sSql = "update News set PublishDate='" + TextBox3.Text + "',Checks=1 where id="+Request["id"].ToString();
SQL s = new SQL();
bool result = s.SqlResults(sSql);
if (result == true)
{
Response.Write("<script>alert('审核通过');window.location='News_check.aspx';</script>");
TextBox1.Text = "";
TextBox2.Text = "";
}
else
{
Page.RegisterStartupScript("alert", "<script>alert('审核失败!');</script>");
}
}
}
4.5主页面设计及实现
主页面是本系统的亮点模块,主要包括站内公告、即时信息、国内信息、国际信息、时尚娱乐等栏目。在后台的一些操作中,撰写信息的内容添加的数据库中,在主页面中通过对数据库的调用来实现对已添加信息的浏览、评论等功能。如4.9图所示。
图4.9 信息浏览页面
该页面的关键代码如下:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
gnxw();
gjxw();
ssyl();
}
}
private void gnxw()
{
string sSql = "select top 5 * from News where sort='国内新闻' and checks=1 order by PublishDate desc";
SQL s = new SQL();
DataSet ds = s.DSSearch(sSql);
DataList1.DataSource = ds;
DataList1.DataKeyField = "id";
DataList1.DataBind();
}
private void gjxw()
{
string sSql = "select top 5 * from News where sort='国际新闻' and checks=1 order by PublishDate desc";
SQL s = new SQL();
DataSet ds = s.DSSearch(sSql);
DataList2.DataSource = ds;
DataList2.DataKeyField = "id";
DataList2.DataBind();
}
private void ssyl()
{
string sSql = "select top 5 * from News where sort='时尚娱乐' and checks=1 order by PublishDate desc";
SQL s = new SQL(); ASP.net网络信息发布系统设计与实现+ER图+流程图(12):http://www.youerw.com/jisuanji/lunwen_760.html