NET课程设计论文图书借阅管理系统的设计与实现_第1页
NET课程设计论文图书借阅管理系统的设计与实现_第2页
NET课程设计论文图书借阅管理系统的设计与实现_第3页
NET课程设计论文图书借阅管理系统的设计与实现_第4页
NET课程设计论文图书借阅管理系统的设计与实现_第5页
已阅读5页,还剩26页未读 继续免费阅读

下载本文档

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

文档简介

1、郑州轻工业学院实 训 报 告实训名称:图书借阅管理系统的设计与实现姓 名: 院 (系): 软件学院 专业班级: .net1001 学 号: 指导教师: 成 绩: 时间: 2011年 6 月 27日 至 2011年 7月 8日郑州轻工业学院软件学院学生实训任务书一、题目图书借阅管理系统的设计与实现二、学生信息专业 .net10-01 学号 姓名 曾 三、用户需求及约束条件1 数据库中的数据要能够支持以下功能需求:a) 图书管理系统包括图书馆内书籍信息、读者信息、借阅信息、预约信息等。b) 此系统功能分为面向学生、教师、管理员三部分,其中学生与教师可以查看、借阅、续借、归还等操作,管理员可以对书籍

2、和读者进行添加,删除和修改以及对学生借阅、续借、归还的确认。四、功能模块如下图,读者与管理员登录成功后分别有12个功能模块,带*号的模块为本实训的难点。1模块中,读者可以根据出版社信息、书名、作者等进行书籍查找。2 、3、4项中,读者可以对每个书籍提出借阅等请求,这些请求需要管理员确认(模块10)。这几个模块需要对数据库进行修改。5模块中,读者可以查看某本书的具体信息,包括目录、内容简介等。并可以看到例如(此块内容自己设计):a都有哪些读者借阅此书;b借阅过此书的读者还借阅过其它什么书;c其它读者对此书的评论。6模块中,借阅过某书的读者可以评论此书,系统需要检查此读者是否已经借阅此书。7模块中

3、,读者查看自己的个人信息,还有借阅历史、逾期未还的书籍、预约历史等12模块中,管理员向逾期未还书籍的读者自动发邮件。 除了以上12个模块,系统必须实现一些规范检查。例如,借阅书籍表中还书时间必须小于应还时间。应还时间根据读者类型自动生成。五、设计要求、技术参数及设计规格1 设计的系统能够安全稳定运行。2 提交实训报告,实训报告中给出需求分析、系统设计、功能设计、总结等(写出几个代表即可)。3 所有的工作需要同学们自己真实、独立地完成。六、时间安排天/日期任务描述通过标准2011.6.27理解项目要求,按照要求整理数据库给出需求分析2011.6.29完成系统登录三种身份登录2011.6.30模块

4、8、9的实现2011.7.1模块1的实现2011.7.2模块2、3、4、10的实现2011.7.4模块5的实现2011.7.5模块6、11的实现2011.7.6模块7的实现2011.7.7模块12的实现2011.7.8完成实训报告六、考核形式、考核时间、考核指标及成绩评定实训成绩由下面几项构成:1)整个实训27次点名(每天上午下午各一次,时间点随机),共27分。2)实训结果占433)实训报告占30%考核形式:1)老师每日对学生的考察、评估和考核;2)最后对实训项目和报告完成的质量进行考核和验收。完 成 期 限: 2011年7月8日 指导教师签章: _ 王 文 冰_ 专业负责人签章: 梁 树 军

5、 教学院长签章: 邓 璐 娟 2011年 6月 24日目 录目 录4一、需求分析5二、系统设计(功能模块结构)6三、功能设计(含代码)71系统登录:72 管理员管理读者信息:93 管理员管理图书信息:144 管理员管理用户信息:145 读者查看个人借阅信息:146 读者查找图书信息:187 管理员管理借阅信息:198 读者查看个人信息:279 读者修改个人密码:28总结30一、需求分析1、数据库中的数据要能够支持以下功能需求:a)图书管理系统包括图书馆内书籍信息、读者信息、借阅信息、预约信息等。b)此系统功能分为面向学生、教师、管理员三部分,其中学生与教师可以查看、借阅、续借、归还等操作,管理

6、员可以对书籍和读者进行添加,删除和修改以及对学生借阅、续借、归还的确认。2 图书馆管理信息系统需要完成功能主要有:1)读者基本信息的添加、修改、删除,包括读者编号、读者姓名、读者性别等。2)图书信息的添加、修改、删除,包括图书编号、图书名称、图书类别、作者姓名、出版社名称等。3)用户信息的添加、修改、删除,包括账号、密码、类型、权限等。4)借书信息的输入,包括读者编号、图书编号、借书日期等。5)图书信息的查询,包括图书编号、图书名称、图书类别、作者姓名、出版社名称等。6)借书信息的查询,包括读者编号、读者姓名、图书编号、图书名称、借书日期等。7)还书信息的输入,包括读者编号、图书编号、还书日期

7、等。8)续借图书信息的输入,包括读者编号、图书编号、续借时间等。9)预约图书信息的输入,包括读者编号、图书编号、预约数量等。 ··············二、系统设计(功能模块结构)1、读者查找图书功能模块2、读者借阅图书功能模块3、读者续借图书功能模块4、读者归还图书功能模块5、读者预约图书功能模块6、读者查看个人信息功能模块7、管理员管理图书信息功能模块8、管理员管理读者信息功能模块9、管理员管理用户信息功能模块10、读者评论图书功能模块11、提示读者

8、还书功能模块12、读者修改密码功能模块三、功能设计(含代码)1系统登录:此系统功能分为面向学生、教师、管理员三部分,每部分的功能权限不相同(代码中包含提示读者还书)private int 权限; public static string x; string 状态; private void button1_click(object sender, eventargs e) datetime edate = datetime.now; edate = edate.addyears(10); if (textbox1.text = "" | textbox2.text = &q

9、uot;") messagebox.show("请先输入用户名和密码然后再登录"); return; string sql = "select 权限 from 用户信息 where 帐户=" sql += ""+textbox1.text.trim () + " and 密码= '" + textbox2.text.trim() + "' and 类型='" + combobox1.text.trim() + "'" string s

10、ql1 = "select 状态,到期时间 from 借阅信息 where 读者编号=" + textbox1.text + "" string myconstr = "persist security info=true;initial catalog=图书借阅管理系统;" myconstr += "data source=localhostsqlexpress;integrated security=sspi;" sqlcommand mycom = null; sqlconnection mycon = nu

11、ll; try mycon = new sqlconnection(myconstr); mycon.open(); mycom = new sqlcommand(sql, mycon); sqldatareader rd = mycom.executereader(); if (rd.hasrows) rd.read(); 权限 = convert.toint32(rd0); label1.visible = false ; label2.visible = false; label3.visible = false; label4.visible = false; combobox1.vi

12、sible = false; textbox1.visible = false; textbox2.visible = false; button1.visible = false; else messagebox.show("没有这个用户名或密码不正确,请重新登录!"); textbox1.clear(); textbox2.clear(); mycon.close(); mycon.open(); sqlcommand mycom1 = new sqlcommand(sql1, mycon); sqldatareader rd1 = mycom1.executeread

13、er(); if (rd1.hasrows) rd1.read(); 状态 = convert.tostring(rd10); edate = convert.todatetime(rd11); catch (sqlexception oe) messagebox.show(oe.message, "error"); finally if (mycon.state = connectionstate.open) mycon.close(); switch (权限) case 1: 图书信息toolstripmenuitem.enabled = true; 读者信息tools

14、tripmenuitem.enabled = true; 借阅信息toolstripmenuitem.enabled = true; 用户信息toolstripmenuitem.enabled = true; break; case 2: 个人信息toolstripmenuitem.enabled = true; break; default: / messagebox.show("你没有使用本系统的权限"); break; form1.x = convert.tostring(textbox1.text); if (状态 ="借阅"|状态 ="

15、;续借") if (edate < datetime.now) messagebox.show("您有图书到期未还,请尽快归还!"); 2 管理员管理读者信息:private void form3_load(object sender, eventargs e) / todo: 这行代码将数据加载到表“图书借阅管理系统dataset2.读者信息”中。您可以根据需要移动或移除它。 this.读者信息tableadapter.fill(this.图书借阅管理系统dataset2.读者信息); this.textbox7.text = (navigator.pos

16、ition + 1).tostring(); this.label7.text = navigator.count.tostring(); mycon = new sqlconnection(); mycom = new sqlcommand(); private system.data.dataset myds =null; private system.data.sqlclient.sqldataadapter myad = null; private system.data.sqlclient.sqlcommand mycom = null; private system.data.sq

17、lclient.sqlconnection mycon = null; private void executesql(string sql) string myconstr = "persist security info = false;initial catalog = 图书借阅管理系统;" myconstr += "data source = localhostsqlexpress;integrated security = sspi; " mycon.connectionstring = myconstr; try mycon = new sq

18、lconnection(myconstr); mycon.open(); mycom = new sqlcommand(myconstr, mycon); mycom.commandtext = sql; mycom.commandtype = commandtype.text; mycom.connection = mycon; mycom.executenonquery(); mycom.commandtext = "select *from 读者信息" myds = new dataset(); myds.clear(); myad = new sqldataadap

19、ter(); myad.selectcommand = mycom; myad.fill(myds, "读者信息"); this.label7.text = navigator.count.tostring(); catch (sqlexception oe) messagebox.show(oe.message, "error"); finally if (mycon.state = connectionstate.open) mycon.close(); /添加信息/ private void button5_click(object sender,

20、 eventargs e) string insstr = "insert into 读者信息(读者编号,姓名,读者类型,性别,年龄,院系,最大借阅数量,实际借阅数量,最大借阅时间,最大续借时间" insstr += ") values (" + textbox1.text + ",'" + textbox2.text + "','" + textbox3.text; insstr += "','" + textbox4.text + "'

21、;," + textbox5.text + ",'" + textbox6.text + "'," + textbox8.text + "," + textbox9.text + "," + textbox10.text + "," + textbox11.text + ")" executesql(insstr); this.读者信息tableadapter.fill(this.图书借阅管理系统dataset2.读者信息); this.label7

22、.text = navigator.count.tostring(); /删除信息/ string 状态; private void button6_click(object sender, eventargs e) string sql = "select 状态 from 借阅信息 where 读者编号=" + textbox1.text + "" string myconstr = "persist security info=true;initial catalog=图书借阅管理系统;" myconstr += "da

23、ta source=localhostsqlexpress;integrated security=sspi;" sqlconnection mycon = new sqlconnection(myconstr); try mycon.open(); sqlcommand mycom = new sqlcommand(sql, mycon); sqldatareader rd = mycom.executereader(); if (rd.hasrows) rd.read(); 状态 = convert.tostring(rd0); else messagebox.show(&quo

24、t;没有查询到该信息,请确认输入无误!"); return; catch (sqlexception oe) messagebox.show(oe.message, "error"); finally if (mycon.state = connectionstate.open) mycon.close(); if (this.textbox1.text = "") messagebox.show("必须输入'读者编号',才能进行删除"); return; else if (状态 = "归还&quo

25、t;) if (messagebox.show("必须要删除吗?", "确认", messageboxbuttons.okcancel) = dialogresult.cancel) return; string delstr = "delete from 读者信息 where 读者编号=" delstr += this.textbox1.text; executesql(delstr); this.读者信息tableadapter.fill(this.图书借阅管理系统dataset2.读者信息); this.label7.text

26、= navigator.count.tostring(); else messagebox.show("次读者有图书未归还,请先归还图书!"); /修改信息/ private void button7_click(object sender, eventargs e) if (this.textbox1.text = "") messagebox.show("必须输入读者编号,才能进行更新"); return; else if (messagebox.show("必须要更新吗?", "确认",

27、messageboxbuttons.okcancel) = dialogresult.cancel) return; string upstr = "update 读者信息 set 姓名 = '" + textbox2.text; upstr += " ',读者类型='" + textbox3.text + "',性别='" + textbox4.text+"',最大借阅数量=" + textbox8.text+",实际借阅数量=" + textb

28、ox9.text; upstr += ",年龄=" + textbox5.text + ",院系='" + textbox6.text+"',最大借阅时间=" + textbox10.text+",最大续借时间=" + textbox11.text; upstr += " where 读者编号=" + textbox1.text; executesql(upstr); this.读者信息tableadapter.fill(this.图书借阅管理系统dataset2.读者信息);

29、/清除信息/ private void button8_click(object sender, eventargs e) textbox1.clear(); textbox2.clear(); textbox3.clear(); textbox4.clear(); textbox5.clear(); textbox6.clear(); textbox8.clear(); textbox9.clear(); textbox10.clear(); textbox11.clear(); /返回/ private void button9_click(object sender, eventargs

30、 e) if (messagebox.show("确定要离开?", "确认", messageboxbuttons.okcancel) = dialogresult.ok) this.close(); /到第一个/ private void button1_click(object sender, eventargs e) navigator.position = 0; /到最后一个/ private void button2_click(object sender, eventargs e) navigator.position = navigator

31、.count - 1; /到上一个/ private void button3_click(object sender, eventargs e) if (navigator.position = 0) navigator.position = navigator.count - 1; else navigator.position -= 1; /到下一个/ private void button4_click(object sender, eventargs e) if (navigator.position = navigator.count - 1) navigator.position

32、 = 0; else navigator.position += 1; /跳转事件/ private void textbox7_keydown(object sender, keyeventargs e) if (e.keyvalue = 13) navigator.position = int32.parse(textbox7.text) - 1; 3 管理员管理图书信息: (代码略)4 管理员管理用户信息: (代码略)5 读者查看个人借阅信息:/图书续借/ int 续借时间, 最大续借时间; private void button2_click(object sender, eventa

33、rgs e) string sql = "select 最大续借时间 from 读者信息 where 读者编号=" + textbox1.text + "" string sql1 = "select 状态 from 借阅信息 where 图书编号=" + textbox2.text + " and 读者编号=" + textbox1.text + "" string myconstr = "persist security info=true;initial catalog=图书借阅

34、管理系统;" myconstr += "data source=localhostsqlexpress;integrated security=sspi;" sqlconnection mycon = new sqlconnection(myconstr); if (textbox1.text = "" | textbox2.text = "" | textbox3.text = "") messagebox.show("请先输入读者编号、图书编号和续借时间,然后再借阅!"); ret

35、urn; try mycon.open(); sqlcommand mycom = new sqlcommand(sql, mycon); sqldatareader rd = mycom.executereader(); if (rd.hasrows) rd.read(); 最大续借时间 = convert.toint32(rd0); mycon.close(); mycon.open(); sqlcommand mycom1 = new sqlcommand(sql1, mycon); sqldatareader rd1 = mycom1.executereader(); if (rd1.

36、hasrows) rd1.read(); 状态 = convert.tostring(rd10); catch (sqlexception oe) messagebox.show(oe.message, "error"); finally if (mycon.state = connectionstate.open) mycon.close(); 续借时间 = convert.toint32(textbox3.text); if (状态 = "借阅") if (续借时间 < 最大续借时间) string jieyue = " exec p

37、ro_图书续借 '" + textbox1.text + "','" + textbox2.text + "','" + textbox3.text + "'" executesql(jieyue); string str = "select * from 借阅信息 " str += "where 图书编号 like '" + textbox2.text + "%' and 读者编号 like '&quo

38、t; + textbox1.text + "%' " sqlcommand1.commandtype = commandtype.text; sqlcommand1.commandtext = str; sqldataadapter1.selectcommand = sqlcommand1; 图书借阅管理系统dataset2.clear(); sqldataadapter1.fill(图书借阅管理系统dataset2, "借阅信息"); messagebox.show("续借成功!"); else messagebox.sho

39、w("对不起,您的借阅时间已超过上限!无法续借书籍!"); else messagebox.show("对不起,该书无法进行续借!"); /图书评论/ string 状态,评论内容; private void button3_click(object sender, eventargs e) string sql = "select 状态 from 借阅信息 where 读者编号=" + textbox1.text + " and 图书编号=" + textbox2.text + "" stri

40、ng sql1 = " select 评论内容 from 评论信息 where 读者编号=" + textbox1.text + " and 图书编号=" + textbox2.text + "" string myconstr = "persist security info=true;initial catalog=图书借阅管理系统;" myconstr += "data source=localhostsqlexpress;integrated security=sspi;" sqlcon

41、nection mycon = new sqlconnection(myconstr); try mycon.open(); sqlcommand mycom = new sqlcommand(sql, mycon); sqldatareader rd = mycom.executereader(); if (rd.hasrows) rd.read(); 状态 = convert.tostring (rd0); mycon.close(); mycon.open(); sqlcommand mycom1 = new sqlcommand(sql1, mycon); sqldatareader

42、rd1 = mycom1.executereader(); if (rd1.hasrows) rd1.read(); 评论内容 = convert.tostring(rd10); catch (sqlexception oe) messagebox.show(oe.message, "error"); finally if (mycon.state = connectionstate.open) mycon.close(); if (状态 = "归还") string pinglun = " insert into 评论信息(读者编号,图书编号, 评论内容) values " pinglun += "(" + textbox1.text + "," + textbox2.text + ",'" + richtextbox1.text + "')" executesql(pinglun); textbox1.text = convert.tostring(form1.x); string str = &qu

温馨提示

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

评论

0/150

提交评论