青岛理工大学毕业设计(论文)
图6.6个人资料管理界面示意图
借阅者进入到相关权限界面后,首先出现的是相关书架信息,即图书馆里的所有图书信息列表。借阅者可以通过该图书列表浏览相关图书信息并选出想要借阅的图书。界面设计效果如下:
图6.7书架界面示意图
借阅者可以通过该界面查阅自己的借书记录,并把已经归还的图书记录进行删除,还可以点击评论按钮进入到书籍评论界面对借阅的图书进行相关评论。界面设计效果如下:
33
青岛理工大学毕业设计(论文)
图6.8我借的图书界面示意图
6.4 主要代码附录
系统关键代码: 1. 登录代码
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) {
if (RadioButton1.Checked) {
string user = Common.UrnHtml(txt_user.Text.Trim()); string
pwd
=
FormsAuthentication.HashPasswordForStoringInConfigFile(txt_pwd.Text, \ string sql = \+ \
SqlConnection cn = DB.OpenConnection(); SqlCommand cmd = new SqlCommand(sql, cn); SqlDataReader dr = cmd.ExecuteReader();
34
青岛理工大学毕业设计(论文)
if (dr.Read()) {
HttpCookie cookies;
cookies = new HttpCookie(\ cookies.Values.Add(\HttpUtility.UrlEncode(this.txt_user.Text.Trim()));
cookies.Expires = DateTime.Now.AddHours(24);//1天有效24小时 Response.Cookies.Set(cookies);//存储!~ dr.Close(); dr.Dispose();
Response.Redirect(\ } else {
dr.Close(); dr.Dispose();
Common.ShowMessage(Page, \对不起您的帐号或密码不正确,请核对后再登陆!\ } } else {
string user = Common.UrnHtml(txt_user.Text.Trim()); string
pwd
=
FormsAuthentication.HashPasswordForStoringInConfigFile(txt_pwd.Text, \ string
sql
=
\
*
from
X_Read_Card
where
X_Read_Card_Other_Name='\
35
青岛理工大学毕业设计(论文)
SqlConnection cn = DB.OpenConnection(); SqlCommand cmd = new SqlCommand(sql, cn); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) {
HttpCookie cookies;
cookies = new HttpCookie(\ cookies.Values.Add(\HttpUtility.UrlEncode(this.txt_user.Text.Trim()));
cookies.Expires = DateTime.Now.AddHours(24);//1天有效24小时 Response.Cookies.Set(cookies);//存储!~ dr.Close(); dr.Dispose();
Response.Redirect(\ } else {
dr.Close(); dr.Dispose();
Common.ShowMessage(Page, \对不起您的帐号或密码不正确,请核对后再登陆!\ } }
2. 列表页代码
public static string sqltxt = \* from [X_Manager] order by X_Manager_ID desc\
public static string cmdtxt2 = \
36
青岛理工大学毕业设计(论文)
protected void Page_Load(object sender, EventArgs e) {
if (!IsPostBack) {
Get_Pager_Data(); } }
void Get_Pager_Data() {
SqlConnection cn = DB.OpenConnection();
SqlCommand cmd0 = new SqlCommand(cmdtxt2, cn); AspNetPager1.AlwaysShow = true; AspNetPager1.PageSize = 15;
AspNetPager1.RecordCount = (int)cmd0.ExecuteScalar(); cn.Close(); Get_Data(); } protected
void
AspNetPager1_PageChanging(object
Wuqi.Webdiyer.PageChangingEventArgs e) {
AspNetPager1.CurrentPageIndex = e.NewPageIndex; Get_Data(); }
void Get_Data()//绑定数据 {
SqlConnection cn = DB.OpenConnection(); SqlCommand cmd = new SqlCommand(sqltxt, cn);
37
src,