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

上传人:ni****g 文档编号:504009854 上传时间:2023-01-24 格式:DOCX 页数:31 大小:235.56KB
返回 下载 相关 举报
图书管理系统系统设计含代码_第1页
第1页 / 共31页
图书管理系统系统设计含代码_第2页
第2页 / 共31页
图书管理系统系统设计含代码_第3页
第3页 / 共31页
图书管理系统系统设计含代码_第4页
第4页 / 共31页
图书管理系统系统设计含代码_第5页
第5页 / 共31页
点击查看更多>>
资源描述

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

1、高级程序设计语言图书管理系统设计报告学院:国土资源工程学院专业:测绘工程|Q.*指导教师:黄云铠日期:2014年11月5日1系统设计1.1 设计目标本系统是针对图书管理工作过程进行设计的,主要实现如下目标:注册用户可以登录此系统;非注册用户注册后可以使用本系统;读者可以查询、借阅、归还图书等;管理员可以对读者、图书进行管理。1.2 数据库设计概述1.2.1 概念结构设计将从需求分析中得到的数据信息抽象为概念模型,经分析可得到数据库的E-R模型。如图1-2实体读者ER图用户图1-3用户实体ER图1.2项目规划图书管理系统是一个典型的数据库应用程序,由应用程序和后台数据库两部分构成。(1)应用程序

2、应用程序主要包括登录,注册,用户信息,读者信息,图书信息管理,借阅图书,综合查询,出版社信息等几个部分组成。(2)数据库数据库负责对图书信息,用户信息等数据的管理。2数据库设计说明书2.1数据库表结构2.1.1 图书表book2.1.2 借阅信息表borrow2.1.3 用户信息表Reader2.1.4 用户信息权限表right2.1.5 用户账号表user2.1.6 管理员账号表usererheper2.1.7 关系图2.1.8 管理系统暂有数据(模拟运行)编号作者书名出版社出版日期价格书类MARKC#入门经典清华大学出版社2011/4/521.56计算机2哪吒和猴子的那些事大庭文印2010

3、/1/2216.5情感3二郎神我也可以闹天宫天庭文印2009/8/129.32技术3程序功能的实现3.1 登陆界面已注册用户登录时,用户类别选择普通用户或管理员,不选择会出现提示主要代码如下:usingSystem;usingusingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingusingnamespaceWindowsFormsApplication1publicpartialclassLoginForm:Formpublicstringpa

4、ssword;privateintErrorTimes;stringUser,Pwd;boolflagshow=false;privateboolyanzhengshuru()password=textBox3.Text;if)MessageBox.Show(请选择登录类型,登录提示,MessageBoxButtons.OK,MessageBoxIcon.Information);Typename.Focus();returnfalse;elseif)MessageBox.Show(请输入用户名,登录提示,MessageBoxButtons.OK,MessageBoxIcon.Informat

5、ion);loginid.Focus();returnfalse;elseif(password=)MessageBox.Show(请输入密码,登录提示,MessageBoxButtons.OK,MessageBoxIcon.Information);textBox3.Focus();returnfalse;elsereturntrue;publicLoginForm()InitializeComponent();学生管理数据学生管理数privatevoidcancelbtn_Click(objectsender,EventArgse)Application.Exit();privatevoi

6、dLoginForm_Load(objectsender,EventArgse)privatevoidLoginForm_Closing(objectsender,FormClosingEventArgse)Application.Exit();privatevoidloginbtn_Click(objectsender,EventArgse)if(yanzhengshuru()if管理员)SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress;InitialCatalog=库;IntegratedSecurity=

7、True);conConnection.Open();stringcmd=selectAdminID,AdminPassfromuserhelper;SqlCommandcom=newSqlComman(dcmd,conConnection);SqlDataReaderreader=com.ExecuteReader();while(reader.Read()User=readerAdminID.ToString();Pwd=readerAdminPass.ToString();if(User.Trim()=loginid.Text&Pwd.Trim()=textBox3.Text)flags

8、how=true;reader.Close();conConnection.Close();if(flagshow=true)this.Hide();adminf1=newadmin();f1.ShowDialog();elseif普通用户)SqlConnectionconConnection1=newSqlConnection(DataSource=.sqlexpress;InitialCatalog=据库;IntegratedSecurity=True);conConnection1.Open();stringcnd=selectReaderID,ReaderPasswordfromrea

9、derSqlCommandcnm=newSqlComman(dcnd,conConnection1);SqlDataReaderreader1=cnm.ExecuteReader();while(reader1.Read()User=reader1ReaderID.ToString();Pwd=reader1ReaderPassword.ToString();if(User.Trim()=loginid.Text&Pwd.Trim()=textBox3.Text)flagshow=true;reader1.Close();conConnection1.Close();if(flagshow=t

10、rue)this.Hide();读者查阅f1=new读者查阅();f1.ShowDialog();elseMessageBoxShow(用户名不存在或密码错误!,提示);ErrorTimes+;if(ErrorTimes=3)MessageBox.Show(登录次数过多,程序将关闭);/Application.Exit();return;privatevoidlabel1_Click(objectsender,EventArgse)privatevoidlabel2_Click(objectsender,EventArgse)privatevoidlabel3_Click(objectsend

11、er,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 登陆界面如果学号已

12、经存在,则会出现“*用户名已经存在,请重新输入”的提示,当重新输入密码时,如果两次密码不相同,则会出现“*请注意,两次密码不一样”的提示主要代码如下:usingSystem;usingusingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingusingnamespaceWindowsFormsApplication1publicpartialclass注册:Formpublic注册()InitializeComponent();publicbool

13、UserFlag;privatevoidtextBox3_TextChanged(objectsender,EventArgse)iflabel6.Visible=true;elselabel8.Visible=true;label6.Visible=false;privatevoid注册_Load(objectsender,EventArgse)privatevoidtextBox1_TextChanged(objectsender,EventArgse)SqlConnectionconConnection=newSqlConnection(DataSource=.sqlexpress;In

14、itialCatalog=学生管理数据库;IntegratedSecurity=True);conConnection.Open();stringcmd=selectReaderIDfromreader;SqlCommandcom=newSqlComman(dcmd,conConnection);SqlDataReaderreaderUser=com.ExecuteReader();while(readerUser.Read()if(textBox1.Text=readerUserReaderID.ToString().Trim()label7.Visible=true;UserFlag=true;return;elseif(textBox1.Text!=readerUserReaderID.ToString().Trim()label7.Visible=fal

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 商业/管理/HR > 市场营销

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号