viewcomment.aspx.cs

来自「精通网络应用系统开发 光盘 该书是人民邮电出版社出版的」· CS 代码 · 共 67 行

CS
67
字号
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;
using System.Linq;
using System.Data.Linq;
using System.Collections.Generic;

public partial class ViewComment : System.Web.UI.Page
{
	private int nCommentID = -1;
	private int nCategoryID = -1;

	protected void Page_Load(object sender, EventArgs e)
	{
		if (Request.Params["CategoryID"] != null)
		{
			nCategoryID = Int32.Parse(Request.Params["CategoryID"].ToString());
		}
		if (Request.Params["CommentID"] != null)
		{
			nCommentID = Int32.Parse(Request.Params["CommentID"].ToString());
		}
		if (!Page.IsPostBack)
		{
			if (nCommentID > -1)
			{
				///显示被修改书籍的数据
				BindCommentData(nCommentID);
			}
		}
	}

	private void BindCommentData(int nCommentID)
	{
		///从数据库获取数据
		CommentM comment = new CommentM();
        Comment recc = comment.GetSingleComment(nCommentID);

		///显示数据
		if (recc!=null)
		{
			Desn.Text = recc.Desn;
			Body.Text = recc.Body;
			CreateDate.Text = recc.CreateDate.ToString();

			///设置评论所属的书籍
			ASPNET35System.SetListBoxItem(BookList,recc.BookID.ToString());
			
		}
	}

	protected void ReturnBtn_Click(object sender,EventArgs e)
	{
		///返回管理页面
		Response.Redirect("~/DesktopModules/Book/CommentManage.aspx"
			+ "?CategoryID=" + nCategoryID.ToString());
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?