图书馆管理系统-详细设计4_第1页
图书馆管理系统-详细设计4_第2页
图书馆管理系统-详细设计4_第3页
图书馆管理系统-详细设计4_第4页
图书馆管理系统-详细设计4_第5页
已阅读5页,还剩15页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

实 验 报 告 课 程 名 称 软 件 工 程 实验项目名称 图书管理系统 详细设计 2 实验学生班级 05 计算机科学与技术 控制技术 实验学生姓名 何 南 学生所属院部 信息技术学院 同组学生姓名 肖静 鞠久勤 候芬 陈青 朱纪超 实 验 时 间 2008年12月8日 2008年12月15 日 实 验 地 点 B407 实验成绩评定 指导教师签字 年 月 日 1 一 实验目的和要求 对系统进行详细的设计 严格按照规格说明书的要求 其中我主要完成的是 主界面的设计 读者管理 图书借阅管理三个部分 其中读者管理又分为读者 类别管理 读者信息管理 可对图书的类别和图书的信息进行添加 修改 删 除 查询操作 图书借阅管理分为借书管理和还书管理 可对图书进行借书还 书和查询操作 二 实验主要仪器和设备 PC 机 Microsoft Visual Basic 6 0 三 实验原理 在本次的系统开发中我主要完成以下三个部分的详细设计 其主要内容如 下 1 系统主界面 进入系统后所运行的主要平台 其主要采用了菜单的方式来完成整个系统 的运行 2 读者管理 1 读者类别管理 单击 读者管理 菜单下的 读者类别管理 进入读者类别管理 再单 击该菜单的子菜单 可以添加 修改 删除读者类别 2 读者信息管理 单击 读者管理 菜单下的 读者信息管理 再单击该菜单的子菜单 可以添加 修改 删除 查询读者信息 3 图书借阅管理 1 借书管理 单击 图书借阅管理 菜单下的 借书管理 再单击该菜单下的子菜单 可以添加 查询借书信息 2 还书管理 单击 图书借阅管理 菜单下的 还书管理 再单击该菜单下的子菜单 可以添加还书信息 四 实验方法与步骤 1 系统主界面 如图 1 2 图 1 其主要实现方法是采用菜单编辑器来完成下拉菜单的设计 主界面的程序 比较简单 主要完成的功能是对各自功能窗体的调用 这边就不具体描述了 2 读者管理 1 读者类别管理 添加读者类别 单击 添加读者类别 子菜单进入图 2 界面 图 2 系统操作者根据读者具体情况填写相关信息 添加读者类别窗体中的确定 按键其主要程序如下 sql select from 读者类别 where 种类名称 Text1 Text 3 rs readerstyle Open sql conn adOpenKeyset adLockPessimistic If rs readerstyle EOF Then rs readerstyle AddNew rs readerstyle Fields 0 Trim Text1 Text rs readerstyle Fields 1 CInt Text2 Text rs readerstyle Fields 2 CInt Text3 Text rs readerstyle Fields 3 CInt Text4 Text rs readerstyle Update MsgBox 添加读者类别成功 vbOKOnly rs readerstyle Close Else MsgBox 读者类别重复 vbOKOnly vbExclamation Text1 SetFocus Text1 Text rs readerstyle Close Exit Sub End If 系统已有的读者类别如图 3 所示 图 3 修改读者类别 单击 修改读者类别 子菜单进入图 4 界面 4 图 4 系统操作者可以进行 修改类别 的操作 读者类别窗体的修改类别按键 中程序如下 Dim answer As String On Error GoTo cmdmodify cmddel Enabled False cmdmodify Enabled False cmdupdate Enabled True cmdcancel Enabled True DataGrid1 AllowUpdate True cmdmodify If Err Number 0 Then MsgBox Err Description End If 读者类别窗体的更新按键中程序如下 If Not IsNull DataGrid1 Bookmark Then rs reader Update End If cmdmodify Enabled True 5 cmddel Enabled True cmdcancel Enabled False cmdupdate Enabled False DataGrid1 AllowUpdate False MsgBox 修改成功 vbOKOnly vbExclamation 删除读者类别 系统操作者可以进行 删除类别 的操作 读者类别窗体中的删除类别按 键其程序如下 Dim answer As String On Error GoTo delerror answer MsgBox 确定要删除吗 vbYesNo If answer vbYes Then DataGrid1 AllowDelete True rs reader Delete rs reader Update DataGrid1 Refresh MsgBox 成功删除 vbOKOnly vbExclamation DataGrid1 AllowDelete False Else Exit Sub End If delerror If Err Number 0 Then MsgBox Err Description End If 2 读者信息管理 添加读者信息 6 单击 添加读者信息 子菜单进入图 5 界面 图 5 其中 读者类别 可以从图 6 类别中选择 图 6 系统操作者根据读者具体情况填写相关信息 添加读者信息窗体中的确定 按键其主要程序如下 sql select from 读者信息 where 读者编号 Text2 Text rs addreader Open sql conn adOpenKeyset adLockPessimistic If rs addreader EOF Then rs addreader AddNew rs addreader Fields 0 Trim Text1 Text rs addreader Fields 1 Trim Text2 Text rs addreader Fields 2 Trim Combo2 Text rs addreader Fields 3 Trim Combo1 Text rs addreader Fields 4 Trim Text3 Text rs addreader Fields 5 Trim Text4 Text 7 rs addreader Fields 6 Trim Text5 Text rs addreader Fields 7 CDate Text6 Text rs addreader Update MsgBox 添加读者信息成功 vbOKOnly rs addreader Close Else MsgBox 读者编号重复 vbOKOnly vbExclamation Text1 SetFocus Text1 Text rs addreader Close Exit Sub End If 修改读者信息 单击 修改读者类别 子菜单进入图 7 界面 图 7 系统操作员可以进行 修改信息 读者信息管理窗体中的修改信息按键 其主要程序如下 Dim answer As String 8 On Error GoTo cmdmodify cmddel Enabled False cmdmodify Enabled False cmdupdate Enabled True cmdcancel Enabled True DataGrid1 AllowUpdate True cmdmodify If Err Number 0 Then MsgBox Err Description End If 读者信息管理窗体中的更新按键其主要程序如下 If Not IsNull DataGrid1 Bookmark Then rs reader Update End If cmdmodify Enabled True cmddel Enabled True cmdcancel Enabled False cmdupdate Enabled False DataGrid1 AllowUpdate False MsgBox 修改成功 vbOKOnly vbExclamation 删除信息 系统操作员可以进行 删除信息 读者信息管理窗体中的修改信息按键 其主要程序如下 Dim answer As String On Error GoTo delerror answer MsgBox 确定要删除吗 vbYesNo If answer vbYes Then DataGrid1 AllowDelete True rs reader Delete 9 rs reader Update DataGrid1 Refresh MsgBox 成功删除 vbOKOnly vbExclamation DataGrid1 AllowDelete False Else Exit Sub End If delerror If Err Number 0 Then MsgBox Err Description End If 查询读者信息 单击 修改读者类别 子菜单进入图 8 界面 图 8 查询读者信息窗体中的确定按键其主要程序如下 Dim rs findreader As New ADODB Recordset Dim sql As String If Check1 Value vbChecked Then sql 读者编号 Trim Text1 Text End If If Check2 Value vbChecked Then If Trim sql Then sql 读者姓名 Trim Text2 Text 10 Else sql sql and 读者姓名 Trim Text2 Text End If End If If Check3 Value vbChecked Then If Trim sql Then sql 读者类别 Trim Combo1 Text Else sql sql and 读者类别 Trim Combo1 Text End If End If sql select from 读者信息 where sql rs findreader CursorLocation adUseClient rs findreader Open sql conn adOpenKeyset adLockPessimistic DataGrid1 AllowAddNew False DataGrid1 AllowDelete False DataGrid1 AllowUpdate False Set DataGrid1 DataSource rs findreader rs findreader Close 然后可以选择 读者姓名 并输入相应信息后点击 确定 按钮 即可出 现该读者的相关信息 如图 9 所示 11 图 9 3 图书借阅管理 1 借书管理 添加借书信息 在 借书管理 菜单中单击 添加借书信息 后进入图 10 界面 图 10 添加借书信息窗体中的确定按键中的程序如下 Dim rs findbook As New ADODB Recordset Dim sql As String If Check1 Value vbChecked Then sql 书名 Trim Text1 Text End If If Check2 Value vbChecked Then If Trim sql Then sql 类别 Trim Combo1 Text Else 12 sql sql and 书名 Trim Combo1 Text End If End If If Check3 Value vbChecked Then If Trim sql Then sql 作者 Trim Text2 Text Else sql sql and 作者 Trim Text2 Text End If End If If Check4 Value vbChecked Then If Trim sql Then sql 出版社 Trim Text3 Text Else sql sql and 出版社 Trim Text3 Text End If End If If Check5 Value vbChecked Then If Trim sql Then sql 书籍编号 Trim Text4 Text Else sql sql and 书籍编号 Trim Text4 Text End If End If If Trim sql Then MsgBox 请选择查询方式 vbOKOnly vbExclamation Exit Sub 13 End If sql select from 书籍信息 where sql rs findbook CursorLocation adUseClient rs findbook Open sql conn adOpenKeyset adLockPessimistic DataGrid1 AllowAddNew False DataGrid1 AllowDelete False DataGrid1 AllowUpdate False Set DataGrid1 DataSource rs findbook rs findbook Close 查询借书信息 在 借书管理 菜单中单击 查询借书信息 后进入图 11 界面 图 11 可以选中 查询已借出信息 然后点击 开始查询 可以查看已经借出 图书的信息 如下图 12 所示 图 12 查询借书信息窗体中的开始查询按键中的程序如下 Dim sql As String 14 Dim rs find As New ADODB Recordset If Option1 Value True Then sql select from 书籍信息 where 是否被借出 是 End If If Option2 Value True Then sql select from 书籍信息 where 是否被借出 否 End If If Option3 Value True Then sql select from 借阅信息 where 读者姓名 Text1 Text End If rs find CursorLocation adUseClient rs find Open sql conn adOpenKeyset adLockPessimistic DataGrid1 AllowAddNew False DataGrid1 AllowDelete False DataGrid1 AllowUpdate False Set DataGrid1 DataSource rs find 2 还书管理 添加还书信息 单击 添加还书信息 即可进入图 13 界面 15 图 13 选择相应的信息即可查询相关的还书信息 还书窗体中的两个查询按键程 序大同小异 其按键中的程序如下 Dim rs reader As New ADODB Recordset Dim sql As String findform True sql select from 借阅信息 where 读者姓名 Combo2 Text rs reader CursorLocation adUseClient rs reader Open sql conn adOpenKeyset adLockPessimistic Set DataGrid1 DataSource rs reader DataGrid1 AllowAddNew False DataGrid1 AllowDelete False DataGrid1 AllowUpdate False 还书窗体中的还书按键中的程序如下 Dim book num As String Dim reader num As String Dim answer As String Dim rs back As New ADODB Recordset 16 Dim sql As String On Error GoTo delerror book num DataGrid1 Columns 3 CellValue DataGrid1 Bookmark reader num DataGrid1 Columns 1 CellValue DataGrid1 Bookmark answer MsgBox 确定要还这本书吗 vbYesNo If answer vbYes Then sql select from 借阅信息 where 书籍编号 book num rs back CursorLocation adUseClient rs back Open sql conn adOpenKeyset adLockPessimistic rs back Delete rs back Update rs back Close sql select from 书籍信息 where 书籍编号 book num rs back CursorLocation adUseClient rs back Open sql conn adOpenKeyset adLockPessimistic rs back Fields 7 否 rs back Update rs back Close sql select from 读者信息 where 读者编号 reader num rs back CursorLocation adUseClient rs back Open sql conn adOpenKeyset adLockPessimistic rs back Fields 8 rs back Fields 8 1 rs back Update rs back Close If findform True Then Command1 Click Else Command2 Click End If 17 MsgBox 成功删除 vbOKOnly vbExclamation DataGrid1 AllowDelete False Else Exit Sub End If delerror If Err Number 0 Then MsgBox Err Description End If 五 实验原始记录 导教师签字 六 实验记录处理 计算过程与结果 数据曲线 图表等 七 实验结果分析 在规格说明书的要求下 我所做的三部分都能够按要求完成实现具体的功 能 其结果完全符合实验要求

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论