📄 typeselect.cs
字号:
using System;
using System.Data;
using System.Configuration;
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.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Web.UI.Design.WebControls;
using BookManage.Model;
using BookManage.BLL;
namespace BookManage.Control
{
/// <summary>
/// Summary description for TypeDropDownList
/// </summary>
public class BookTypeSelect : DropDownList
{
public void AutoBindData()
{
//base.Items.Clear();
BookType bookType = new BookType();
IList<BookTypeInfo> bookTypeInfo = bookType.GetBookTypeList();
foreach (BookTypeInfo bti in bookTypeInfo)
{
string typeName = bti.BookTypeName;
if (bti.LevelId > 1)
{
string padding = null;
for (int i = 0; i <= bti.LevelId - 2; i++)
{
padding += " ";
}
typeName = padding + "└ " + typeName;
}
ListItem listItem = new ListItem();
listItem.Text = typeName;
listItem.Value = bti.BookTypeId.ToString();
base.Items.Add(listItem);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -