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

上传人:第*** 文档编号:55463604 上传时间:2018-09-30 格式:DOC 页数:39 大小:930KB
返回 下载 相关 举报
图书管理系统系统设计(含代码)_第1页
第1页 / 共39页
图书管理系统系统设计(含代码)_第2页
第2页 / 共39页
图书管理系统系统设计(含代码)_第3页
第3页 / 共39页
图书管理系统系统设计(含代码)_第4页
第4页 / 共39页
图书管理系统系统设计(含代码)_第5页
第5页 / 共39页
点击查看更多>>
资源描述

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

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

2、版日期 价格种类 出版社 图 1-1 图书实体 ER 图 密码 读者 姓名 编号 专业 借阅时 间 借书量 年龄 性别 图 1-2 实体读者 ER 图 用户 密码 类型 编号 图 1- 3 用户实体 ER 图 1.2 项目规划 图书管理系统是一个典型的数据库应用程序,由应用程序和后台数据库两 部分构成。 (1)应用程序 应用程序主要包括登录,注册,用户信息,读者信息,图书信息管理,借 阅图书,综合查询,出版社信息等几个部分组成。 (2)数据库 数据库负责对图书信息,用户信息等数据的管理。 2 数据库设计说明书数据库设计说明书 21 数据库表结构 2.1.1 图书表 book 2.1.2 借阅信

3、息表 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 图书信息 编号 作者 书名 出版社 出版日期 价格 书类 H319584781 MARK C#入门经典 清华大学出版社 2011/4/

4、5 21.56 计算机 H319584782 哪吒 和猴子的那些事 天庭文印 2010/1/2 216.5 情感 H319584783 二郎神 我也可以闹天宫 天庭文印 2009/8/1 29.32 技术 3 程序功能的实现 3.1 登陆界面 已注册用户登录时,用户类别选择普通用户或管理员,不选择会出现提示 主要代码如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq;

5、using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace WindowsFormsApplication1 public partial class LoginForm : Form public string password; private int ErrorTimes; string User, Pwd; bool flagshow = false; private bool yanzhengshuru() password = textBox3.Text; if(Type

6、name.Text.Trim()=“) MessageBox.Show(“请选择登录类型“,“登录提示“, MessageBoxButtons.OK,MessageBoxIcon.Information); Typename.Focus(); return false; else if(loginid.Text.Trim()=“) MessageBox.Show(“请输入用户名“, “登录提示“, MessageBoxButtons.OK, MessageBoxIcon.Information); loginid.Focus(); return false; else if (password

7、 = “) MessageBox.Show(“请输入密码“, “登录提示“, MessageBoxButtons.OK, MessageBoxIcon.Information); textBox3.Focus(); return false; else return true; public LoginForm() InitializeComponent(); private void cancelbtn_Click(object sender, EventArgs e) Application.Exit(); private void LoginForm_Load(object sender

8、, EventArgs e) private void LoginForm_Closing(object sender, FormClosingEventArgs e) Application.Exit(); private void loginbtn_Click(object sender, EventArgs e) if (yanzhengshuru() if (Typename.Text.Trim() = “管理员“) SqlConnection conConnection = new SqlConnection(“Data Source=.sqlexpress;Initial Cata

9、log=学生管理数据库;Integrated Security=True“); conConnection.Open(); string cmd = “select AdminID,AdminPass from userhelper “; SqlCommand com = new SqlCommand(cmd, conConnection); SqlDataReader reader = com.ExecuteReader(); while (reader.Read() User = reader“AdminID“.ToString(); Pwd = reader“AdminPass“.ToS

10、tring(); if (User.Trim() = loginid.Text reader.Close(); conConnection.Close(); if (flagshow = true) this.Hide(); admin f1 = new admin (); f1.ShowDialog(); else if (Typename.Text.Trim() = “普通用户“) SqlConnection conConnection1 = new SqlConnection(“Data Source=.sqlexpress;Initial Catalog=学生管理数据库;Integra

11、ted Security=True“); conConnection1.Open(); string cnd = “select ReaderID,ReaderPassword from reader “; SqlCommand cnm = new SqlCommand(cnd, conConnection1); SqlDataReader reader1 = cnm.ExecuteReader(); while (reader1.Read() User = reader1“ReaderID“.ToString(); Pwd = reader1“ReaderPassword“.ToString

12、(); if (User.Trim() = loginid.Text 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; private void

13、 label1_Click(object sender, EventArgs e) private void label2_Click(object sender, EventArgs e) private void label3_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e) this.Hide(); 注册 f1 = new 注册(); f1.ShowDialog(); private void usercomboBox_SelectedIndexChanged(

14、object sender, EventArgs e) private void useracctxt_TextChanged(object sender, EventArgs e) private void textBox3_TextChanged(object sender, EventArgs e) 3.2 登陆界面 如果学号已经存在,则会出现“*用户名已经存在,请重新输入”的提示,当重 新输入密码时,如果两次密码不相同,则会出现“*请注意,两次密码不一样” 的提示 主要代码如下: using System; using System.Collections.Generic; using

15、 System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace WindowsFormsApplication1 public partial class 注册 : Form public 注册() InitializeComponent(); public bool UserFlag; private void textBox3_TextChanged(object sender, EventArgs e) if (textBox2.Text.Trim() != textBox3.Text.Trim() label6.Visible = true; else label8.Visible = true; label6.Visible = false; private void 注册_Load(object sender, EventArgs e) private void textBox1_TextChanged(obj

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

当前位置:首页 > 中学教育 > 职业教育

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