📄 qt.master.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
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 Model;
using BLL;
using BLL.interfaces;
public partial class QT : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Session["userRole"] != null)
{
lblUserState.Text = Session["userRole"].ToString();
if (Session["userRole"].ToString().Equals("管理员"))
Label1.Visible = true;
}
if (Session["userName"]!=null)
{
lblUserName.Text = Session["userName"].ToString();
}
show(null);
}
}
private void show(TreeNode Pnode)
{
IBookType bookTypeMessage = Factory.greatBookType();
List<BookType> list = new List<BookType>();
try
{
list = (Pnode == null) ? bookTypeMessage.selBookType(0) : bookTypeMessage.selBookType(int.Parse(Pnode.Value));
foreach (BookType b in list)
{
TreeNode node = new TreeNode();
if (Pnode == null)
{
node.Value = b.Id.ToString();
node.Text = b.Name;
TreeView1.Nodes.Add(node);
}
else
{
node.Value = b.Id.ToString();
node.Text = b.Name;
Pnode.ChildNodes.Add(node);
}
show(node);
}
}
catch (Exception ex)
{
throw ex;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string seachtitle =txtSeachTitle.Text;
Response.Redirect("booklist.aspx?seachTitle=" + seachtitle);
}
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
string treeId=TreeView1.SelectedNode.Value;
Response.Redirect("booklist.aspx?treeId=" + treeId);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -