




已阅读5页,还剩26页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
郑州轻工业学院实 训 报 告实训名称:图书借阅管理系统的设计与实现姓 名: 梁军 院 (系): 计算机工程 专业班级: 软件开发 学 号: 14528956 指导教师: 王老师 时间: 2011年 2月 2日 至 2011年 2月 15日郑州轻工业学院软件学院学生实训任务书一、题目图书借阅管理系统的设计与实现二、学生信息专业 软件开发 学号 14528956姓名 梁军 三、用户需求及约束条件1 数据库中的数据要能够支持以下功能需求:a) 图书管理系统包括图书馆内书籍信息、读者信息、借阅信息、预约信息等。b) 此系统功能分为面向学生、教师、管理员三部分,其中学生与教师可以查看、借阅、续借、归还等操作,管理员可以对书籍和读者进行添加,删除和修改以及对学生借阅、续借、归还的确认。四、功能模块如下图,读者与管理员登录成功后分别有12个功能模块,带*号的模块为本实训的难点。1模块中,读者可以根据出版社信息、书名、作者等进行书籍查找。2 、3、4项中,读者可以对每个书籍提出借阅等请求,这些请求需要管理员确认(模块10)。这几个模块需要对数据库进行修改。5模块中,读者可以查看某本书的具体信息,包括目录、内容简介等。并可以看到例如(此块内容自己设计):a都有哪些读者借阅此书;b借阅过此书的读者还借阅过其它什么书;c其它读者对此书的评论。6模块中,借阅过某书的读者可以评论此书,系统需要检查此读者是否已经借阅此书。7模块中,读者查看自己的个人信息,还有借阅历史、逾期未还的书籍、预约历史等12模块中,管理员向逾期未还书籍的读者自动发邮件。 除了以上12个模块,系统必须实现一些规范检查。例如,借阅书籍表中还书时间必须小于应还时间。应还时间根据读者类型自动生成。五、设计要求、技术参数及设计规格1 设计的系统能够安全稳定运行。2 提交实训报告,实训报告中给出需求分析、系统设计、功能设计、总结等(写出几个代表即可)。3 所有的工作需要同学们自己真实、独立地完成。六、时间安排天/日期任务描述通过标准2011.6.27理解项目要求,按照要求整理数据库给出需求分析2011.6.29完成系统登录三种身份登录2011.6.30模块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)最后对实训项目和报告完成的质量进行考核和验收。目 录目 录4一、需求分析5二、系统设计(功能模块结构)6三、功能设计(含代码)71系统登录:72 管理员管理读者信息:93 管理员管理图书信息:144 管理员管理用户信息:145 读者查看个人借阅信息:146 读者查找图书信息:187 管理员管理借阅信息:198 读者查看个人信息:279 读者修改个人密码:28总结30一、需求分析1、数据库中的数据要能够支持以下功能需求:a)图书管理系统包括图书馆内书籍信息、读者信息、借阅信息、预约信息等。b)此系统功能分为面向学生、教师、管理员三部分,其中学生与教师可以查看、借阅、续借、归还等操作,管理员可以对书籍和读者进行添加,删除和修改以及对学生借阅、续借、归还的确认。2 图书馆管理信息系统需要完成功能主要有:1)读者基本信息的添加、修改、删除,包括读者编号、读者姓名、读者性别等。2)图书信息的添加、修改、删除,包括图书编号、图书名称、图书类别、作者姓名、出版社名称等。3)用户信息的添加、修改、删除,包括账号、密码、类型、权限等。4)借书信息的输入,包括读者编号、图书编号、借书日期等。5)图书信息的查询,包括图书编号、图书名称、图书类别、作者姓名、出版社名称等。6)借书信息的查询,包括读者编号、读者姓名、图书编号、图书名称、借书日期等。7)还书信息的输入,包括读者编号、图书编号、还书日期等。8)续借图书信息的输入,包括读者编号、图书编号、续借时间等。9)预约图书信息的输入,包括读者编号、图书编号、预约数量等。 二、系统设计(功能模块结构)1、读者查找图书功能模块2、读者借阅图书功能模块3、读者续借图书功能模块4、读者归还图书功能模块5、读者预约图书功能模块6、读者查看个人信息功能模块7、管理员管理图书信息功能模块8、管理员管理读者信息功能模块9、管理员管理用户信息功能模块10、读者评论图书功能模块11、提示读者还书功能模块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 = ) MessageBox.Show(请先输入用户名和密码然后再登录); return; string SQL = select 权限 from 用户信息 where 帐户=; SQL += +textBox1.Text.Trim () + and 密码= + textBox2.Text.Trim() + and 类型= + comboBox1.Text.Trim() + ; string SQL1 = 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 = null; 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.Visible = 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.ExecuteReader(); 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; 读者信息ToolStripMenuItem.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 (状态 =借阅|状态 =续借) 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.Position + 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.SqlClient.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 SqlConnection(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 SqlDataAdapter(); 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, EventArgs e) string insStr = INSERT INTO 读者信息(读者编号,姓名,读者类型,性别,年龄,院系,最大借阅数量,实际借阅数量,最大借阅时间,最大续借时间; insStr += ) values ( + textBox1.Text + , + textBox2.Text + , + textBox3.Text; insStr += , + textBox4.Text + , + textBox5.Text + , + textBox6.Text + , + textBox8.Text + , + textBox9.Text + , + textBox10.Text + , + textBox11.Text + ); ExecuteSQL(insStr); this.读者信息TableAdapter.Fill(this.图书借阅管理系统DataSet2.读者信息); this.label7.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 += Data 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(没有查询到该信息,请确认输入无误!); 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 (状态 = 归还) 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 = 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(必须要更新吗?, 确认, MessageBoxButtons.OKCancel) = DialogResult.Cancel) return; string upStr = UPDATE 读者信息 Set 姓名 = + textBox2.Text; upStr += ,读者类型= + textBox3.Text + ,性别= + textBox4.Text+,最大借阅数量= + textBox8.Text+,实际借阅数量= + textBox9.Text; upStr += ,年龄= + textBox5.Text + ,院系= + textBox6.Text+,最大借阅时间= + textBox10.Text+,最大续借时间= + textBox11.Text; upStr += where 读者编号= + textBox1.Text; ExecuteSQL(upStr); this.读者信息TableAdapter.Fill(this.图书借阅管理系统DataSet2.读者信息); /清除信息/ 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 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.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 = 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, EventArgs 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=图书借阅管理系统; myConStr += Data Source=localhostsqlexpress;Integrated Security=SSPI; SqlConnection myCon = new SqlConnection(myConStr); if (textBox1.Text = | textBox2.Text = | textBox3.Text = ) MessageBox.Show(请先输入读者编号、图书编号和续借时间,然后再借阅!); return; 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.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 pro_图书续借 + textBox1.Text + , + textBox2.Text + , + textBox3.Text + ; ExecuteSQL(jieyue); string str = select * from 借阅信息 ; str += where 图书编号 like + textBox2.Text + % and 读者编号 like + textBox1.Text + % ; sqlCommand1.CommandType = CommandType.Text; sqlCommand1.CommandText = str; sqlDataAdapter1.SelectCommand = sqlCommand1; 图书借阅管理系统DataSet2.Clear(); sqlDataAdapter1.Fill(图书借阅管理系统DataSet2, 借阅信息); MessageBox.Show(续借成功!); else MessageBox.Show(对不起,您的借阅时间已超过上限!无法续借书籍!); else MessageBox.Show(对不起,该书无法进行续借!); /图书评论/ string 状态,评论内容; private void button3_Click(object sender, EventArgs e) string SQL = select 状态 from 借阅信息 where 读者编号= + textBox1.Text + and 图书编号= + textBox2.Text + ; string SQL1 = select 评论内容 from 评论信息 where 读者编号= + textBox1.Text + and 图书编号= + textBox2.Text + ; string myConStr = Persist Security Info=True;Initial Catalog=图书借阅管理系统; myConStr += Data 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); myCon.Close(); myCon.Open(); SqlCommand myCom1 = new SqlCommand(SQL1, myCon); SqlDataReader 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 = select * fr
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 政工科工作汇报
- 窃血综合征的护理
- 2026届浙江省杭州西湖区四校联考英语九年级第一学期期末学业水平测试模拟试题含解析
- 大健康员工培训方案
- 2026届安徽省淮南市潘集区化学九年级第一学期期中联考模拟试题含解析
- 2026届福建省各地英语九上期末监测模拟试题含解析
- 2026届山东省德州市陵城区化学九年级第一学期期末质量检测模拟试题含解析
- 2026届江苏省南京鼓楼区化学九年级第一学期期中质量检测模拟试题含解析
- 湖北省武汉市蔡甸区誉恒联盟2026届九年级英语第一学期期末预测试题含解析
- 2025年急救抢救烧伤病情处理策略及答案解析
- 医院培训课件:《精神科暴力特征及实战技巧》
- 2025年临床执业医师考试《第一单元》新版真题卷(含答案)
- 雅砻江公司招聘笔试题库2025
- T/CACE 0128-2024一次性原竹餐具通用技术要求
- 湖北省2025届高三数学上学期9月起点考试含答案
- 国际压力性损伤-溃疡预防和治疗临床指南(2025年版)解读课件
- 《优化教学策略:打造卓越课件的秘诀》课件
- 猪蹄供货协议书范本
- 2025年数学新课标《义务教育数学课程标准(2025年版)》解读
- 《拍摄校园微视频》教学课件-2024-2025学年冀美版(2024)初中美术七年级下册
- 抗美援朝“铭记历史迎接挑战”-第11年迎回在韩中国人民志愿军烈士遗骸主题班会课件
评论
0/150
提交评论