图书管理系统系统设计Word文件下载.docx
《图书管理系统系统设计Word文件下载.docx》由会员分享,可在线阅读,更多相关《图书管理系统系统设计Word文件下载.docx(53页珍藏版)》请在冰豆网上搜索。
注册用户可以登录此系统;
非注册用户注册后可以使用本系统;
读者可以查询、借阅、归还图书等;
管理员可以对读者、图书进行管理。
1.2数据库设计概述
1.2.1概念结构设计
将从需求分析中得到的数据信息抽象为概念模型,经分析可得到数据库的E-R模型。
如图所示。
图1-1图书实体ER图
图1-2实体读者ER图
图1-3用户实体ER图
1.2项目规划
图书管理系统是一个典型的数据库应用程序,由应用程序和后台数据库两部分构成。
(1)应用程序
应用程序主要包括登录,注册,用户信息,读者信息,图书信息管理,借阅图书,综合查询,出版社信息等几个部分组成。
(2)数据库数据库负责对图书信息,用户信息等数据的管理。
2数据库设计说明书
2.1数据库表结构
2.1.1图书表book
2.1.2借阅信息表borrow
2.1.2用户信息表Reader
2.1.4用户信息权限表right
2.1.5用户账号表user
2.1.6管理员账号表usererheper
2.2数据关系图
2.3图书管理系统暂有数据(模拟运行)
2.3.1管理员
学工号:
2014701020姓名:
邢吉昌密码:
111
2.3.2普通用户
2014701021姓名:
猪八戒密码:
333
2014701022姓名:
孙悟空密码:
444
2.3.3图书信息
编号作者书名出版社出版日期价格书类
H319584781MARKC#入门经典清华大学出版社2011/4/521.56计算机
H319584782哪吒和猴子的那些事天庭文印2010/1/2216.5情感
H319584783二郎神我也可以闹天宫天庭文印2009/8/129.32技术
3程序功能的实现
3.1登陆界面
已注册用户登录时,用户类别选择普通用户或管理员,不选择会出现提示
主要代码如下:
usingSystem;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Windows.Forms;
usingSystem.Data.SqlClient;
namespaceWindowsFormsApplication1
{
publicpartialclassLoginForm:
Form
{
publicstringpassword;
privateintErrorTimes;
stringUser,Pwd;
boolflagshow=false;
privateboolyanzhengshuru()
password=textBox3.Text;
if(Typename.Text.Trim()=="
"
)
MessageBox.Show("
请选择登录类型"
"
登录提示"
MessageBoxButtons.OK,MessageBoxIcon.Information);
Typename.Focus();
returnfalse;
}
elseif(loginid.Text.Trim()=="
请输入用户名"
"
MessageBoxButtons.OK,MessageBoxIcon.Information);
loginid.Focus();
elseif(password=="
请输入密码"
textBox3.Focus();
else
returntrue;
publicLoginForm()
InitializeComponent();
privatevoidcancelbtn_Click(objectsender,EventArgse)
Application.Exit();
privatevoidLoginForm_Load(objectsender,EventArgse)
privatevoidLoginForm_Closing(objectsender,FormClosingEventArgse)
privatevoidloginbtn_Click(objectsender,EventArgse)
if(yanzhengshuru())
if(Typename.Text.Trim()=="
管理员"
SqlConnectionconConnection=newSqlConnection(@"
DataSource=.\sqlexpress;
InitialCatalog=学生管理数据库;
IntegratedSecurity=True"
);
conConnection.Open();
stringcmd="
selectAdminID,AdminPassfromuserhelper"
;
SqlCommandcom=newSqlCommand(cmd,conConnection);
SqlDataReaderreader=com.ExecuteReader();
while(reader.Read())
User=reader["
AdminID"
].ToString();
Pwd=reader["
AdminPass"
if(User.Trim()==loginid.Text&
Pwd.Trim()==textBox3.Text)
flagshow=true;
reader.Close();
conConnection.Close();
if(flagshow==true)
this.Hide();
adminf1=newadmin();
f1.ShowDialog();
普通用户"
SqlConnectionconConnection1=newSqlConnection(@"
conConnection1.Open();
stringcnd="
selectReaderID,ReaderPasswordfromreader"
SqlCommandcnm=newSqlCommand(cnd,conConnection1);
SqlDataReaderreader1=cnm.ExecuteReader();
while(reader1.Read())
User=reader1["
ReaderID"
Pwd=reader1["
ReaderPassword"
reader1.Close();
conConnection1.Close();
读者查阅f1=new读者查阅();
用户名不存在或密码错误!
提示"
ErrorTimes++;
if(ErrorTimes>
=3)
登录次数过多,程序将关闭"
//Application.Exit();
return;
privatevoidlabel1_Click(objectsender,EventArgse)
privatevoidlabel2_Click(objectsender,EventArgse)
privatevoidlabel3_Click(objectsender,EventArgse)
privatevoidbutton1_Click(objectsender,EventArgse)
注册f1=new注册();
privatevoidusercomboBox_SelectedIndexChanged(objectsender,EventArgse)
privatevoiduseracctxt_TextChanged(objectsender,EventArgse)
privatevoidtextBox3_TextChanged(objectsender,EventArgse)
}
}
3.2登陆界面
如果学号已经存在,则会出现“*用户名已经存在,请重新输入”的提示,当重新输入密码时,如果两次密码不相同,则会出现“*请注意,两次密码不一样”的提示
namespaceWindowsFormsApplica