📄 viewbook.aspx.cs
字号:
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.Linq;
using System.Data.Linq;
using System.Collections.Generic;
using System.Data.SqlClient;
public partial class ViewBook : System.Web.UI.Page
{
private int nBookID = -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["BookID"] != null)
{
nBookID = Int32.Parse(Request.Params["BookID"].ToString());
}
if (!Page.IsPostBack)
{
if (nBookID > -1)
{
///显示被修改书籍的数据
BindBookData(nBookID);
}
}
}
private void BindBookData(int nBookID)
{
///从数据库获取数据
BookM book = new BookM();
Book recb = book.GetSingleBook(nBookID);
///显示数据
if (recb!=null)
{
Name.Text = recb.Name;
Desn.Text = recb.Desn;
Author.Text = recb.Author;
Publish.Text = recb.Publish;
PublishDate.Text = recb.PublishDate.ToString();
Foreword.Text = recb.Foreword;
List.Text = recb.List;
OutLine.Text = recb.OutLine;
BuyInDate.Text = recb.BuyInDate.ToString();
Price.Text = recb.Price.ToString();
TotalNum.Text = recb.TotalNum.ToString();
StoreNum.Text = recb.StoreNum.ToString();
SellOrder.Text = recb.SellOrder.ToString();
Attribute1.Text = recb.Attribute1;
Attribute2.Text = recb.Attribute2;
Attribute3.Text = recb.Attribute3;
Attribute4.Text = recb.Attribute4;
Attribute5.Text = recb.Attribute5;
Remark.Text = recb.Remark;
}
}
protected void ReturnBtn_Click(object sender,EventArgs e)
{
///返回管理页面
Response.Redirect("~/DesktopModules/Book/MainManage.aspx"
+ "?CategoryID=" + nCategoryID.ToString());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -