图书馆管理系统设计附带源代码.docx

上传人:b****7 文档编号:24942997 上传时间:2023-06-03 格式:DOCX 页数:58 大小:386.56KB
下载 相关 举报
图书馆管理系统设计附带源代码.docx_第1页
第1页 / 共58页
图书馆管理系统设计附带源代码.docx_第2页
第2页 / 共58页
图书馆管理系统设计附带源代码.docx_第3页
第3页 / 共58页
图书馆管理系统设计附带源代码.docx_第4页
第4页 / 共58页
图书馆管理系统设计附带源代码.docx_第5页
第5页 / 共58页
点击查看更多>>
下载资源
资源描述

图书馆管理系统设计附带源代码.docx

《图书馆管理系统设计附带源代码.docx》由会员分享,可在线阅读,更多相关《图书馆管理系统设计附带源代码.docx(58页珍藏版)》请在冰豆网上搜索。

图书馆管理系统设计附带源代码.docx

图书馆管理系统设计附带源代码

毕业设计_图书管理系统

一、数据库设计数据库设

CREATEDATABASETSGL

GO

USETSGL

GO

CREATETABLEBmanage--添加图书

bIdvarchar(10)PRIMARYKEY,--图书编号bNamevarchar(50),--书名

bNumbervarchar(10),--书数目

bSorevarchar(50)--分类

GO

--图书员管理

--图书管理员姓名--图书管理员密码--图书管理员年龄--图书管理员性别--图书管理员电话--图书管理员角色

CREATETABLEMadmin(

mNamevarchar(10)PRIMARYKEYmPwdvarchar(25),mAgevarchar(8),mSexvarchar(4),

mNumbervarchar(15),mrolevarchar(8)

)GO

CREATETABLEReader--读者信息表reader(

rSno

varchar

(10)PRIMARYKEY,

--

、土一FZ.口

读者号

rName

varchar

(10),

--

姓名

rPwd

varchar

(25),

--密码

rAge

varchar

(8),

--年龄

rSex

varchar

(4),

--性别

rState

varchar

(8),

--

状态

rNumbervarchar(15),

--电话号码

rEmail

varchar

(25),

--

电子邮件

rAdressvarChar(50),

--

地址

rGrade

varChar(15),

--

年级

rClass

varchar

(15),

--

班级

rRole

varchar

(8)

--角色

)GO

CREATETABLERrecord

rSnovarchar(10)PRIMARYKEY,

--读者编号学号

rNamevarChar(10),

--读者姓名

bIdvarchar(10),

--图书编号

bNamevarChar(50),

--图书名称

bTimevarchar(10),

--借书时间

GO

bBackTimevarchar(10)

--还书时间

--读者角色

--读者可借书数

--过期罚款设置

--可借书天数

CREATETABLESysSet(

rRolevarchar(8)PRIMARYKEYrStatevarchar(8),

Finefloat(25),

rDayvarchar(8)

二、界面截图及说明

1)登录窗口(实现管理员和馆长的登陆)

2)管理员窗口

3)馆长窗口

哙Wft⅛5∏Ξ∏~Ξ~∣∣i⅛∣

菩理员信息莒理系现iθiSi关于退出

πriit∣πu5tripl

4)关于窗口

a9S]-■匚LP回IIFjW

软件舌稱U阿书⅛¾⅛M

M≠:

VRo

作j⅛:

JaSOn

日熱:

2011/08/13

OK

5)新增图书窗口

叮萨B典痒

r

0创l∣5⅛∣

图书编号

圏书名称

圏书数目

圏书类别

T

KCH

-

6)新增管理员、查找及修改窗口

⅛W{⅛1B≡

■=I≡3

用户窖I

⅛I⅛

側疋就

⅛⅛⅞

修改∙jw⅛Ir^

tιa”

电SSII

7)新增读者、查找及修改窗口

TSlrfIflSW

「P1回4

读音枝名

用户書⅛∙i'l雏⅛K

 

8)图书的查找及修改窗口

⅛E=WI■=■IlI-IIB

类别

T

賤改

戲目

船7

IhB

9)借阅窗口

I亠~⅞∏∣⅛⅜

 

10)系统设置窗口

三、主要代码主要代

1)登录窗口(实现管理员和馆长的登陆)

登陆检查:

USingSystem;

USingSyStem.CoIIectionsGeneric;

USingSyStem.Linq;

USingSyStem.Text;

USingSyStem.Data;

USingPrjTSGL.ClassLibQBAccess;

namespaceprjTSGL.CIassLib.Logic

{

classclsLoginCheck

{

PUbIiCStatiCDataTabIeCheCkLogin(StringUserid,StringPWD)

{

{

StringSQLStmt="seIectmName,mPwd,mRolefromMadminWheremName='"+USerId

+"'andmPwd='"+PWD+'"";

DataTabIedt=clsGIobalVar.GetDataTabIe(SQLstmt);retUrndt;

}

登陆:

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

usingprjTSGL.ClassLib.Logic;

namespaceprjTSGL.TSGL_UI

{

publicpartialclassfrmLogin:

Form

{

publicfrmLogin()

{

InitializeComponent();

}

privatevoidbtnLogin_Click(objectsender,EventArgse)

{

stringstrUserID=loginid.Text.Trim();

stringstrPWD=loginpwd.Text.Trim();

stringtype="";

try

{

DataTabledt=clsLoginCheck.CheckLogin(strUserID,strPWD);if(dt.Rows.Count==0)

{

MeSSageBoX.Show("登陆失败,请重新输入!

");

loginpwd.Focus();

return;

}

elSe

{

type=dt.Rows[0]["mRole"].ToString().Trim();

if(cboLT.Text.Trim()=="馆长")

{

if(type=="馆长")

{

this.Hide();

frmManagerobjManager=newfrmManager();

objManager.Show();

}

else

{

MeSSageBoX.Show("您没有权限!

");

loginpwd.Focus();

return;

}

}

elSe

{

if(type=="管理员")

{

thiS.Hide();

frmAdminobjAdmin=newfrmAdmin();

objAdmin.Show();

}

elSe

{

MeSSageBox.Show("您没有权限!

");

loginpwd.FocuS();

return;

}

}

}

catch(Exceptionex)

{

throwex;

privatevoidbtnExit_Click(objectsender,EventArgse){

this.Close();

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

namespaceprjTSGL.TSGL_UI

{

publicpartialclassfrmAdmin:

Form

{

publicfrmAdmin()

{

InitializeComponent();

privatevoidShowForm(FormfrmToShow)

{

this.Cursor=Cursors.WaitCursor;

foreach(FormfrmChildinthis.MdiChildren){

if(frmChild.GetType()==frmToShow.GetType()){

frmToShow.Dispose();

frmChild.Activate();

this.Cursor=Cursors.Default;

return;

}

frmToShow.MdiParent=this;

frmToShow.Show();

this.Cursor=Cursors.Default;

privatevoid读者信息修改ToolStripMenuItem_Click(objectsender,EventArgse)

{

ShowForm(newfrmUpdateReader());

}

privatevoid新增图书ToolStripMenuItem_Click(objectsender,EventArgse)

{

ShowForm(newfrmAddNewBook());

}

privatevoid图书的查找和修改ToolStripMenuItem_Click(objectsender,EventArgse){

ShowForm(newfrmUpdateBook());

}

privatevoid流通管理ToolStripMenuItem_Click(objectsender,EventArgse)

{

ShowForm(newfrmBorrow());

}

privatevoid帮助ToolStripMenuItem_Click(objectsender,EventArgse)

{

ShowForm(newfrmAbout());

}

privatevoid退出ToolStripMenuItem_Click(objectsender,EventArgse)

{

Application.Exit();

}

3)馆长窗口

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

namespaceprjTSGL.TSGL_UI

{

publicpartialclassfrmManager:

Form

{

publicfrmManager()

{

InitializeComponent();

}

privatevoidShowForm(FormfrmToShow)

{

this.Cursor=Cursors.WaitCursor;

foreach(FormfrmChildinthis.MdiChildren)

{

if(frmChild.GetType()==frmToShow.GetType())

{frmToShow.Dispose();frmChild.Activate();this.Cursor=Cursors.Default;return;

}

}frmToShow.MdiParent=this;

frmToShow.Show();this.Cursor=Cursors.Default;

}

privatevoidfrmManager_FormClosed(objectsender,FormClosedEventArgse){

Application.Exit();

}

privatevoid管理员信息管理ToolStripMenuItem_Click_1(objectsender,EventArgse){

ShowForm(newfrmSelectAdmin());privatevoid系统设置ToolStripMenuItem_Click_1(objectsender,EventArgse){

ShowForm(newfrmSys());

}

privatevoid关于ToolStripMenuItem_Click(objectsender,EventArgse){

ShowForm(newfrmAbout());

privatevoid退出ToolStripMenuItem_Click_1(objectsender,EventArgse){

Application.Exit();

}

}

}

4)关于窗口

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

namespaceprjTSGL.TSGL_UI

{

publicpartialclassfrmAbout:

Form

{

publicfrmAbout()

{

InitializeComponent();

}

privatevoidbutton1_Click(objectsender,EventArgse){

this.Close();

5)新增图书窗口

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

usingprjTSGL.ClassLib.DBAccess;

namespaceprjTSGL.TSGL_UI

{

publicpartialclassfrmAddNewBook:

Form

{

publicfrmAddNewBook()

{

InitializeComponent();

}

privateboolValidatInput()

{

if(textBox1.Text==""){

MessageBox.Show("请输入图书编号!

","输入提示",MessageBoxButtons.OK,MessageBoxIcon.Information);

textBox1.Focus();

returnfalse;

}

if(textBox2.Text=="")

{

MessageBoxShow("请输入图书名称!

","输入提示",MessageBoxButtonsOK,

MessageBoxIcon.Information);

textBox2.Focus();

returnfalse;

}

if(textBox3.Text=="")

{

MessageBoxShow("请输入图书数目!

","输入提示",MessageBoxButtonsOK,MessageBoxIcon.Information);

textBox3.Focus();returnfalse;

}

if(comboBox1.Text=="")

{MessageBox.Show("请选择图书类别!

","输入提示",MessageBoxButtons.OK,MessageBoxIcon.Information);

textBox3.Focus();

returnfalse;

}

returntrue;

}

privatevoidbtnOK_Click_1(objectsender,EventArgse)

{

if(ValidatInput())

{

//stringid=textBox1.Text;

//stringname=textBox2.Text;

//stringNumber=textBox3.Text;

//stringsore=comboBox1.Text;

stringsql="SELECT*FROMBmanageWHEREbId='"+textBox1.Text.Trim()+"'";DataTabledt=clsGlobalVar.GetDataTable(sql);

if(dt.Rows.Count==0)

{

stringSQL="insertintoBmanage(bId,bName,bNumber,bSore)values('"+textBox1.Text.Trim()+"','"+textBox2.Text.Trim()+"','"+textBox3.Text.Trim()+"','"+comboBox1.Text.Trim()+"')";

try

{

boolresult=clsGlobalVar.ExecSQL(SQL);

if(result){

MeSSageBoX.Show("添加成功!

","操作提示",MessageBoxButtonsQK,MessageBoxIcon.Information);

textBox1.Text="";

textBox2.Text="";

textBox3.Text="";

comboBox1.Text=""textBox1.Focus();

}

else{

MeSSageBoX.Show("添加失败!

","操作提示",MessageBoxButtonsQK,MessageBoxIcon.Error);

}

}

catch(Exceptionex)

{

MeSSageBox.Show("操作数据库出错!

","操作演示",MessageBoxButtonsOK,MessageBoxIcon.Error);

Console.WriteLine(ex.Message);

}

}

else

{

MeSSageBox.Show("图书编号已存在!

","操作提示",MessageBoxButtonsQK,MessageBoxIcon.Information);

textBox1.Focus();

}

}

}

privatevoidbtnCancel_Click(objectsender,EventArgse)

{

this.Close();

}

6)新增管理员、查找及修改窗口

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

usingprjTSGL.ClassLib.DBAccess;

namespaceprjTSGL.TSGL_UI

{

publicpartialclassfrmSelectAdmin:

Form

{

publicfrmSelectAdmin()

{

InitializeComponent();

}

stringname="";

stringSQL="";

stringPWD="";

stringAge="";

stringSex="";

stringTel="";

stringRole="";

privatevoidSelectAdmin()

{

stringstrfilter="";

stringSQL="selectmNameAS用户名,mPwdAS密码,mAgeAS年龄,mSexAS性别,mNumberAS电话,mRoleAS角色fromMadmin";

if(txtName.Text=="")

strfilter="";

else

strfilter="wheremName='"+txtName.Text.Trim()+"'";

try

{

DataTabledt=clsGlobalVar.GetDataTable(SQL+strfilter);

intintIndex=0;

if(dt.Rows.Count==0)

{

MeSSageBoX.Show("抱歉,没有您要找的用户!

","结果提示",MessageBoxButtons.OK,MessageBoxIcon.Information);

tXtName.TeXt="";

tXtPWD.TeXt="";

tXtAge.TeXt="";

cboSeX.TeXt="";

tXtTel

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

当前位置:首页 > PPT模板 > 商务科技

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1