图书管理系统系统设计含代码.docx

上传人:b****3 文档编号:11268396 上传时间:2023-05-30 格式:DOCX 页数:55 大小:785.55KB
下载 相关 举报
图书管理系统系统设计含代码.docx_第1页
第1页 / 共55页
图书管理系统系统设计含代码.docx_第2页
第2页 / 共55页
图书管理系统系统设计含代码.docx_第3页
第3页 / 共55页
图书管理系统系统设计含代码.docx_第4页
第4页 / 共55页
图书管理系统系统设计含代码.docx_第5页
第5页 / 共55页
图书管理系统系统设计含代码.docx_第6页
第6页 / 共55页
图书管理系统系统设计含代码.docx_第7页
第7页 / 共55页
图书管理系统系统设计含代码.docx_第8页
第8页 / 共55页
图书管理系统系统设计含代码.docx_第9页
第9页 / 共55页
图书管理系统系统设计含代码.docx_第10页
第10页 / 共55页
图书管理系统系统设计含代码.docx_第11页
第11页 / 共55页
图书管理系统系统设计含代码.docx_第12页
第12页 / 共55页
图书管理系统系统设计含代码.docx_第13页
第13页 / 共55页
图书管理系统系统设计含代码.docx_第14页
第14页 / 共55页
图书管理系统系统设计含代码.docx_第15页
第15页 / 共55页
图书管理系统系统设计含代码.docx_第16页
第16页 / 共55页
图书管理系统系统设计含代码.docx_第17页
第17页 / 共55页
图书管理系统系统设计含代码.docx_第18页
第18页 / 共55页
图书管理系统系统设计含代码.docx_第19页
第19页 / 共55页
图书管理系统系统设计含代码.docx_第20页
第20页 / 共55页
亲,该文档总共55页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

图书管理系统系统设计含代码.docx

《图书管理系统系统设计含代码.docx》由会员分享,可在线阅读,更多相关《图书管理系统系统设计含代码.docx(55页珍藏版)》请在冰点文库上搜索。

图书管理系统系统设计含代码.docx

图书管理系统系统设计含代码

《高级程序设计语言》

图书管理系统设计报告

 

   学  院:

  国土资源工程学院  

专  业:

 测绘工程  

成  员:

********************************

*****       黄云*      

日  期:

   2014年11月5日    

 

1系统设计

1.1设计目标

本系统是针对图书管理工作过程进行设计的,主要实现如下目标:

注册用户可以登录此系统;

非注册用户注册后可以使用本系统;

读者可以查询、借阅、归还图书等;

管理员可以对读者、图书进行管理。

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()=="")

{

MessageBox.Show("请输入用户名","登录提示",

MessageBoxButtons.OK,MessageBoxIcon.Information);

loginid.Focus();

returnfalse;

}

elseif(password=="")

{

MessageBox.Show("请输入密码","登录提示",

MessageBoxButtons.OK,MessageBoxIcon.Information);

textBox3.Focus();

returnfalse;

}

else

{

returntrue;

}

}

publicLoginForm()

{

InitializeComponent();

}

privatevoidcancelbtn_Click(objectsender,EventArgse)

{

Application.Exit();

}

privatevoidLoginForm_Load(objectsender,EventArgse)

{

}

privatevoidLoginForm_Closing(objectsender,FormClosingEventArgse)

{

Application.Exit();

}

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"].ToString();

if(User.Trim()==loginid.Text&Pwd.Trim()==textBox3.Text)

{

flagshow=true;

}

}

reader.Close();

conConnection.Close();

if(flagshow==true)

{

this.Hide();

adminf1=newadmin();

f1.ShowDialog();

}

}

else

{

if(Typename.Text.Trim()=="普通用户")

{

SqlConnectionconConnection1=newSqlConnection(@"DataSource=.\sqlexpress;InitialCatalog=学生管理数据库;IntegratedSecurity=True");

conConnection1.Open();

stringcnd="selectReaderID,ReaderPasswordfromreader";

SqlCommandcnm=newSqlCommand(cnd,conConnection1);

SqlDataReaderreader1=cnm.ExecuteReader();

while(reader1.Read())

{

User=reader1["ReaderID"].ToString();

Pwd=reader1["ReaderPassword"].ToString();

if(User.Trim()==loginid.Text&Pwd.Trim()==textBox3.Text)

{

flagshow=true;

}

}

reader1.Close();

conConnection1.Close();

if(flagshow==true)

{

this.Hide();

读者查阅f1=new读者查阅();

f1.ShowDialog();

}

else

{

MessageBox.Show("用户名不存在或密码错误!

","提示");

ErrorTimes++;

if(ErrorTimes>=3)

{

MessageBox.Show("登录次数过多,程序将关闭");

//Application.Exit();

return;

}

}

}

}

}

}

privatevoidlabel1_Click(objectsender,EventArgse)

{

}

privatevoidlabel2_Click(objectsender,EventArgse)

{

}

privatevoidlabel3_Click(objectsender,EventArgse)

{

}

privatevoidbutton1_Click(objectsender,EventArgse)

{

this.Hide();

注册f1=new注册();

f1.ShowDialog();

}

privatevoidusercomboBox_SelectedIndexChanged(objectsender,EventArgse)

{

}

privatevoiduseracctxt_TextChanged(objectsender,EventArgse)

{

}

privatevoidtextBox3_TextChanged(objectsender,EventArgse)

{

}

}

}

3.2登陆界面

如果学号已经存在,则会出现“*用户名已经存在,请重新输入”的提示,当重新输入密码时,如果两次密码不相同,则会出现“*请注意,两次密码不一样”的提示

主要代码如下:

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

usingSystem.Data.SqlClient;

namespaceWindowsFormsApplication1

{

publicpartialclass注册:

Form

{

public注册()

{

InitializeComponent();

}

publicboolUserFlag;

privatevoidtextBox3_TextChanged(objectsender,EventArgse)

{

if(textBox2.Text.Trim()!

=textBox3.Text.Trim())

{

label6.Visible=true;

}

else

{

label8.Visible=true;

label6.Visible=false;

}

}

privatevoid注册_Load(objectsender,EventArgse)

{

}

privatevoidtextBox1_TextChanged(objectsender,EventArgse)

{

SqlConnectionconConnection=newSqlConnection(@"DataSource=.\sqlexpress;InitialCatalog=学生管理数据库;IntegratedSecurity=True");

conConnection.Open();

stringcmd="selectReaderIDfromreader";

SqlCommandcom=newSqlCommand(cmd,conConnection);

SqlDataReaderreaderUser=com.ExecuteReader();

while(readerUser.Read())

{

if(textBox1.Text==readerUser["ReaderID"].ToString().Trim())

{

label7.Visible=true;

UserFlag=true;

return;

}

elseif(textBox1.Text!

=readerUser["ReaderID"].ToString().Trim())

{

label7.Visible=false;

label9.Visible=true;

UserFlag=false;

}

}

}

privatevoidbutton1_Click(objectsender,EventArgse)

{

intindex=textBox4.Text.IndexOf("@");

if(index<1)

{

label10.Visible=true;

label10.Text="邮箱格式不正确,请重新输入";

}

else

{

label10.Visible=true;

label10.Text="邮箱格式正确";

}

if(UserFlag==true)

{

MessageBox.Show("用户已经存在,请重新输入!

");

return;

}

if(UserFlag==false)

{

SqlConnectionconConnection=newSqlConnection(@"DataSource=.\sqlexpress;InitialCatalog=学生管理数据库;IntegratedSecurity=True");

conConnection.Open();

stringcmd="insertintoreader(ReaderID,ReaderPassword,ReaderEmall)values('"+textBox1.Text+"',"+"'"+textBox2.Text+"',"+"'"+textBox4.Text+"')";

SqlCommandcom=newSqlCommand(cmd,conConnection);

com.ExecuteNonQuery();

conConnection.Close();

MessageBox.Show("注册成功!

点击确定,返回登录界面。

","提示");

this.Close();

LoginFormf2=newLoginForm();

}

}

}

}

3.3管理员操作界面

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

namespaceWindowsFormsApplication1

{

publicpartialclassadmin:

Form

{

publicadmin()

{

InitializeComponent();

}

privatevoid查看用户信息ToolStripMenuItem_Click(objectsender,EventArgse)

{

权限设置f8=new权限设置();

f8.ShowDialog();

}

privatevoid查看用户信息ToolStripMenuItem1_Click(objectsender,EventArgse)

{

用户信息fi=new用户信息();

fi.ShowDialog();

}

privatevoid新增用户ToolStripMenuItem1_Click(objectsender,EventArgse)

{

新增用户f2=new新增用户();

f2.ShowDialog();

}

privatevoid删除用户ToolStripMenuItem1_Click(objectsender,EventArgse)

{

用户信息f3=new用户信息();

f3.button2.Visible=true;

f3.ShowDialog();

}

privatevoid录入书籍ToolStripMenuItem_Click(objectsender,EventArgse)

{

书籍信息f5=new书籍信息();

f5.ShowDialog();

}

privatevoid删除书籍ToolStripMenuItem_Click(objectsender,EventArgse)

{

删除书籍f6=new删除书籍();

f6.ShowDialog();

}

privatevoid还书处理ToolStripMenuItem_Click(objectsender,EventArgse)

{

还书处理f9=new还书处理();

f9.ShowDialog();

}

privatevoidadmin_Load(objectsender,EventArgse)

{

}

privatevoid借阅处理ToolStripMenuItem_Click(objectsender,EventArgse)

{

借阅处理f10=new借阅处理();

f10.ShowDialog();

}

}

}

3.3.1管理用户

管理用户下共有三个子菜单

3.3.1.1

新增用户界面

主要代码如下:

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

usingSystem.Data.SqlClient;

namespaceWindowsFormsApplication1

{

publicpartialclass新增用户:

Form

{

public新增用户()

{

InitializeComponent();

}

privatevoidbutton1_Click(objectsender,EventArgse)

{

SqlConnectionconConnection=newSqlConnection(@"DataSource=.\sqlexpress;InitialCatalog=学生管理数据库;IntegratedSecurity=True");

conConnection.Open();

stringcmd="insertintoreader(ReaderID,ReaderName,ReaderPassword,ReaderSex,ReaderAge,ReaderDept,ReaderZhuanYe,MaxNumber,ReaderEmall)values('"+textBox1.Text+"',"+"'"+textBox2.Text+"',"+"'"+textBox3.Text+"',"+"'"+textBox4.Text+"',"+"'"+textBox5.Text+"',"+"'"+textBox6.Text+"',"+"'"+textBox7.Text+"',"+"'"+textBox8.Text+"',"+"'"+textBox9.Text+"')";

SqlCommandcom=newSqlCommand(cmd,conConnection);

com.ExecuteNonQuery();

conConnection.Close();

MessageBox.Show("添加成功!

点击确定,返回登录界面。

","提示");

this.Close();

}

}

}

3.3.1.2删除用户界面

输入学号即可查询用户信息,如图,点击删除即删除该用户

主要代码如下:

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

usingSystem.Data.SqlClient;

namespaceWindowsFormsApplication1

{

publicpartialclass用户信息:

Form

{

boolUserFlag;

public用户信息()

{

InitializeComponent();

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2