图书馆标准管理系统设计附带源代码.doc

上传人:牧羊曲112 文档编号:1618086 上传时间:2022-12-11 格式:DOC 页数:48 大小:543.50KB
返回 下载 相关 举报
图书馆标准管理系统设计附带源代码.doc_第1页
第1页 / 共48页
图书馆标准管理系统设计附带源代码.doc_第2页
第2页 / 共48页
图书馆标准管理系统设计附带源代码.doc_第3页
第3页 / 共48页
图书馆标准管理系统设计附带源代码.doc_第4页
第4页 / 共48页
图书馆标准管理系统设计附带源代码.doc_第5页
第5页 / 共48页
点击查看更多>>
资源描述

《图书馆标准管理系统设计附带源代码.doc》由会员分享,可在线阅读,更多相关《图书馆标准管理系统设计附带源代码.doc(48页珍藏版)》请在三一办公上搜索。

1、图书馆标准管理系统设计附带源代码毕业设计_图书管理系统 一、数据库设计数据库设CREATEDATABASETSGL GO USETSGL GO CREATETABLEBmanage( bId varchar(10)PRIMARYKEY,bNamevarchar(50),-添加图书-图书编号-书名bNumbervarchar(10),-书数目) GO bSorevarchar(50)-分类CREATETABLEMadmin( mNamevarchar(10)PRIMARYKEY,mPwdvarchar(25),mAgevarchar(8),mSexvarchar(4),mNumbervarcha

2、r(15),mrolevarchar(8) GO -图书员管理-图书管理员姓名-图书管理员密码-图书管理员年龄-图书管理员性别-图书管理员电话-图书管理员角色CREATETABLEReader( rSnovarchar(10)PRIMARYKEY,rNamevarchar(10),rPwdvarchar(25),rAgevarchar(8),rSexvarchar(4),rStatevarchar(8),rNumbervarchar(15),rEmailvarchar(25),-读者信息表reader -读者号-姓名-密码-年龄-性别-状态-电话号码-电子邮件rAdressvarChar(50

3、),-地址) GO rGradevarChar(15),rClassvarchar(15),rRolevarchar(8)-年级-班级-角色CREATETABLERrecord( rSnovarchar(10)PRIMARYKEY,rNamevarChar(10),bId varchar(10),bNamevarChar(50),bTimevarchar(10),bBackTimevarchar(10) GO CREATETABLESysSet( rRolevarchar(8)PRIMARYKEY,rStatevarchar(8),Finefloat(25),rDayvarchar(8)-读者

4、编号学号-读者姓名-图书编号-图书名称-借书时间-还书时间-读者角色-读者可借书数-过期罚款设置-可借书天数)二、界面截图及说明1)登录窗口(实现管理员和馆长的登陆) 2)管理员窗口 3)馆长窗口 4)关于窗口 5)新增图书窗口 6)新增管理员、查找及修改窗口 7)新增读者、查找及修改窗口 8)图书的查找及修改窗口 9)借阅窗口 10)系统设置窗口 三、主要代码主要代1)登录窗口(实现管理员和馆长的登陆) 登陆检查: using System; using System.Collections.Generic; using System.Linq; using System.Text; usi

5、ng System.Data; using prjTSGL.ClassLib.DBAccess; namespace prjTSGL.ClassLib.Logic classclsLoginCheck publicstaticDataTable CheckLogin(string UserId, string PWD) string SQLstmt = select mName,mPwd,mRole from Madmin where mName= + UserId + and mPwd= + PWD + ; DataTable dt = clsGlobalVar.GetDataTable(S

6、QLstmt); return dt; 登陆: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using prjTSGL.ClassLib.Logic; namespace prjTSGL.TSGL_UI publicpartialclassfrmLogin : Form pu

7、blic frmLogin() InitializeComponent(); privatevoid btnLogin_Click(object sender, EventArgs e) string strUserID = loginid.Text.Trim(); string strPWD = loginpwd.Text.Trim(); string type = ; try DataTable dt = clsLoginCheck.CheckLogin(strUserID, strPWD); if (dt.Rows.Count = 0) MessageBox.Show(登陆失败,请重新输

8、入!); loginpwd.Focus(); return; else type = dt.Rows0mRole.ToString().Trim(); if (cboLT.Text.Trim()=馆长 ) if (type = 馆长) this.Hide(); frmManager objManager = newfrmManager(); objManager.Show(); else MessageBox.Show(您没有权限!); loginpwd.Focus(); return; else if (type =管理员) this.Hide(); frmAdmin objAdmin =

9、newfrmAdmin(); objAdmin.Show(); else MessageBox.Show(您没有权限!); loginpwd.Focus(); return; catch (Exception ex) throw ex; privatevoid btnExit_Click(object sender, EventArgs e) this.Close(); 2)管理员窗口 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using Sys

10、tem.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace prjTSGL.TSGL_UI publicpartialclassfrmAdmin : Form public frmAdmin() InitializeComponent(); privatevoid ShowForm(Form frmToShow) this.Cursor = Cursors.WaitCursor; foreach (Form frmChild inthis.MdiChildren) if (fr

11、mChild.GetType() = frmToShow.GetType() frmToShow.Dispose(); frmChild.Activate(); this.Cursor = Cursors.Default; return; frmToShow.MdiParent = this; frmToShow.Show(); this.Cursor = Cursors.Default; privatevoid 读者信息修改ToolStripMenuItem_Click(object sender, EventArgs e) ShowForm(newfrmUpdateReader(); pr

12、ivatevoid 新增图书ToolStripMenuItem_Click(object sender, EventArgs e) ShowForm(newfrmAddNewBook(); privatevoid 图书的查找和修改ToolStripMenuItem_Click(object sender, EventArgs e) ShowForm(newfrmUpdateBook(); privatevoid 流通管理ToolStripMenuItem_Click(object sender, EventArgs e) ShowForm(newfrmBorrow(); privatevoid

13、 帮助ToolStripMenuItem_Click(object sender, EventArgs e) ShowForm(newfrmAbout(); privatevoid 退出ToolStripMenuItem_Click(object sender, EventArgs e) Application.Exit(); 3)馆长窗口 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using Syst

14、em.Linq; using System.Text; using System.Windows.Forms; namespace prjTSGL.TSGL_UI publicpartialclassfrmManager : Form public frmManager() InitializeComponent(); privatevoid ShowForm(Form frmToShow) this.Cursor = Cursors.WaitCursor; foreach (Form frmChild inthis.MdiChildren) if (frmChild.GetType() =

15、frmToShow.GetType() frmToShow.Dispose(); frmChild.Activate(); this.Cursor = Cursors.Default; return; frmToShow.MdiParent = this; frmToShow.Show(); this.Cursor = Cursors.Default; privatevoid frmManager_FormClosed(object sender, FormClosedEventArgs e) Application.Exit(); privatevoid 管理员信息管理ToolStripMe

16、nuItem_Click_1(object sender, EventArgs e) ShowForm(newfrmSelectAdmin(); privatevoid 系统设置ToolStripMenuItem_Click_1(object sender, EventArgs e) ShowForm(newfrmSys(); privatevoid 关于ToolStripMenuItem_Click(object sender, EventArgs e) ShowForm(newfrmAbout(); privatevoid 退出ToolStripMenuItem_Click_1(objec

17、t sender, EventArgs e) Application.Exit(); 4)关于窗口 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace prjTSGL.TSGL_UI publicpartialclassfrmAbout : Form public

18、 frmAbout() InitializeComponent(); privatevoid button1_Click(object sender, EventArgs e) this.Close(); 5)新增图书窗口 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; usin

19、g prjTSGL.ClassLib.DBAccess; namespace prjTSGL.TSGL_UI publicpartialclassfrmAddNewBook : Form public frmAddNewBook() InitializeComponent(); privatebool ValidatInput() if (textBox1.Text = ) MessageBox.Show(请输入图书编号!, 输入提示, MessageBoxButtons.OK, MessageBoxIcon.Information); textBox1.Focus(); returnfals

20、e; if (textBox2.Text = ) MessageBox.Show(请输入图书名称!, 输入提示, MessageBoxButtons.OK, MessageBoxIcon.Information); textBox2.Focus(); returnfalse; if (textBox3.Text = ) MessageBox.Show(请输入图书数目!, 输入提示, MessageBoxButtons.OK, MessageBoxIcon.Information); textBox3.Focus(); returnfalse; if (comboBox1.Text = ) Me

21、ssageBox.Show(请选择图书类别!, 输入提示, MessageBoxButtons.OK, MessageBoxIcon.Information); textBox3.Focus(); returnfalse; returntrue; privatevoid btnOK_Click_1(object sender, EventArgs e) if (ValidatInput() /string id = textBox1.Text; /string name = textBox2.Text; /string Number = textBox3.Text; /string sore

22、= comboBox1.Text; string sql = SELECT *FROM Bmanage WHERE bId= + textBox1.Text.Trim() + ; DataTable dt = clsGlobalVar.GetDataTable(sql); if (dt.Rows.Count = 0) string SQL = insert into Bmanage(bId,bName,bNumber,bSore)values( + textBox1.Text.Trim() + , + textBox2.Text.Trim() + , + textBox3.Text.Trim(

23、) + ,+ comboBox1.Text.Trim() + ); try bool result = clsGlobalVar.ExecSQL(SQL); if (result) MessageBox.Show(添加成功!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); textBox1.Text = ; textBox2.Text = ; textBox3.Text = ; comboBox1.Text = ; textBox1.Focus(); else MessageBox.Show(添加失败!, 操作提示, Mess

24、ageBoxButtons.OK, MessageBoxIcon.Error); catch (Exception ex) MessageBox.Show(操作数据库出错!, 操作演示, MessageBoxButtons.OK, MessageBoxIcon.Error); Console.WriteLine(ex.Message); else MessageBox.Show(图书编号已存在!, 操作提示, MessageBoxButtons.OK, MessageBoxIcon.Information); textBox1.Focus(); privatevoid btnCancel_Cl

25、ick(object sender, EventArgs e) this.Close(); 6)新增管理员、查找及修改窗口 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using prjTSGL.ClassLib.DBAccess; namespace prjTSGL.TSG

26、L_UI publicpartialclassfrmSelectAdmin : Form public frmSelectAdmin() InitializeComponent(); string name = ; string SQL = ; string PWD = ; string Age = ; string Sex = ; string Tel = ; string Role = ; privatevoid SelectAdmin() string strfilter = ; string SQL = select mName AS 用户名,mPwd AS 密码,mAge AS 年龄

27、 ,mSex AS 性别,mNumber AS 电话,mRole AS 角色 from Madmin ; if (txtName.Text = ) strfilter = ; else strfilter = where mName= + txtName.Text.Trim() + ; try DataTable dt = clsGlobalVar.GetDataTable(SQL + strfilter); int intIndex = 0; if (dt.Rows.Count = 0) MessageBox.Show(抱歉,没有您要找的用户!, 结果提示, MessageBoxButton

28、s.OK, MessageBoxIcon.Information); txtName.Text = ; txtPWD.Text = ; txtAge.Text = ; cboSex.Text = ; txtTel.Text = ; cboRole.Text = ; else LV.Columns.Clear(); LV.Items.Clear(); LV.Columns.Add(序号, 100, HorizontalAlignment.Center); for (int intJ = 0; intJ dt.Columns.Count; intJ+) LV.Columns.Add(dt.Colu

29、mnsintJ.ColumnName, 200, HorizontalAlignment.Center); for (int intI = 0; intI dt.Rows.Count; intI+) intIndex = intI + 1; LV.Items.Add(intIndex.ToString(); LV.ItemsintI.SubItems.Add(dt.RowsintI用户名.ToString().Trim(); LV.ItemsintI.SubItems.Add(dt.RowsintI密码.ToString().Trim(); LV.ItemsintI.SubItems.Add(

30、dt.RowsintI年龄.ToString().Trim(); LV.ItemsintI.SubItems.Add(dt.RowsintI性别.ToString().Trim(); LV.ItemsintI.SubItems.Add(dt.RowsintI电话.ToString().Trim(); LV.ItemsintI.SubItems.Add(dt.RowsintI角色.ToString().Trim(); /连接数据库,将数据读取出放入MadminData catch (Exception ex) MessageBox.Show(查询数据库出错!, 提示, MessageBoxButtons.OK, MessageBoxIcon.Error); Console.WriteLine(ex.Message); privatevoid btnSearch_Click(object sender, EventArgs e) SelectAdmin();/调用函数 /实现修改功能 privatevoid btnUpdata_Click(object sender, EventArgs e) if (txtName.Text = | cboRole.Text=) MessageBox.Show(请选择要修改的用户!); else SQL = UPDATE Madmin SET

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号