《RFID图书管理系统程序源代码.docx》由会员分享,可在线阅读,更多相关《RFID图书管理系统程序源代码.docx(36页珍藏版)》请在优知文库上搜索。
1、登陆界面usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;namespaceLabrary(PublicpartialclassForinLogin:Form(publicFormLoginOInitializeComponentO;)/验证i6控?件t/privateboolValidControlOif(this.tbID.Text=)(Me
2、ssageBox.ShCW(“请填写用户名!?”);this.tbID.FocusO;returnfalse;)if(this.tbID.Text!=admin)(if(!UserManage.ObjUser.IsllasID(Al1.dbo,this.tbID.Text)(MossageBox.ShCW(不存在此用户!?”);this.tbID.Text=”;this.tbID.FocusO;returnfalse;)if(this.tbID.Text!=admin)(UserManage.ObjUseruser=newUserManage.ObjUser(this.tbID.Text,Al
3、1.dbo);if(user.PWD!=this.tbPWD.Text)MessageBox.Show(密码错误!?);this.tbPWD.Text=”;this.tbPWD.FocusO;returnfalse;)else(if(this.tbPWD.Text!=123456)(MessageBox.ShOW(密码错误!”);this.tbPWD.Text=”;this.tbPWD.FocusO;returnfalse;)returntrue;)privatevoidgbtnCance1_C1ick(objectsender,EventArgse)(this.CloseO;)private
4、voidgbtnOK_Click(objectsender,EventArgse)(如?果?验-证i控?件t通-i过yif(ValidControl0)(if(this.tbID.Text!=admin)(All.UserLogin=newUserManage.ObjUser(this.tbID.Text,All.dbo);)else(All.UserLogin=newUserManage.ObjUser(All.dbo);All.userLogin.ID=admin”;All.userLogin.Name=管理员;this.DialogResult=DialogResult.OK;this.
5、CloseO;主界面usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing:usingSystem.Text;usingSystem.Windows.Forms;namespaceLabrary(PublicpartialclassForniMain:Form(PublicconstintWMJJSER=0x0400:PublicconstintWM_GETBUFFER_LOoP=WMjJSER+2;privateRFID_dll.Re
6、aderrdr;privateRFID_dll.RFIDrfid;1.istrfids=newList();intdirectionFlag=0;l进:出?FormlnAndOulfiao=newForn11,Anl();publicFormMainOInitialiZeComponentO;this,rdr=newRFID_dll.ReaderO;/this.rfid=newRFID_dll.RFID(rdr);)privatevoidFormMain_Load(objectsender,EventArgse)InitO;/初始化/privatevoidInitOfiao.StartPosi
7、tion=EorniStartPosition.Manual:多窗体在不同时间显示Screenscreens=Screen.AllScreens;if(screens.Length=2)(1.istIistScreen=newListO;foreach(ScreenscreeninScreen.AllScreens)if(screen.Primary=false)IistScreen.Add(screen);)fiao.Location=1iStScreen0.WorkingArea.Location;SetMenJin(*PicIn*);fiao.Show();toolStripStatus
8、Label2显示登陆用户名?toolStripStatusLabel2.Text=All.userLogin.Name;this,panel1.BackgroundImage=null;菜单栏全部显示?this.用?户ii管r理CJrTOOIStriPMenUItem.Visible=true;this.系;i统il3初?始?化CTOOlStriPMenUltem.Visible=true;this.应I用?模i。式?TooIStriPMenUItem.Visible=true;this.图”书;管r理QfToolStriPMenUltem.Visible=true;this.退ji?办If卡
9、iToolStripMenuItein.Visible=true;this.借,.阅?ToOIStriPMenUlteIn.Visible=true;this.门?禁?ToOIStriPMenUltem.Visible=true;SetPurviewO;this.toolStripl.Visible=false;this.toolStrip2.Visible=false;this.toolStrip3.Visible=false;/rfid.OpenSerialO;是。?否Q?找一到i?门?禁?设;.备A?/if(rfid.ChangeWorkMode1(2)/rfid.Startlnvent
10、ory(this.Handle.Tolnt32(),2);/)/权限设置/privatevoidSetPurviewOif(Al1.userLogin.ID=admin)(this.应I用?模式?ToOlStriPMenUltenLViSible=false;)else(this.用户管理ToolStripMenuItem.Visible=false;this.系统初始化iCTooIStriPMenUItem.Visible=false;this.读书管理TOOIStriPMenUltem.Visible=false;this.退办卡iToolStripMenuItem.Visible=fal
11、se;this.借阅TOOIStriPMenUltem.Visible=false;this.门禁?ToOIStriPMenUltem.Visible=false;for(inti=O;iAll.serLogin.Purview.Count;i+)(stringpurview=.M1.userLogin.Purviewi;if(purview=T)this.图书管理ToolStripMenuItem.Visible=true;)elseif(purview=2)this.办退卡iToolStripMenuItem.Visible=true;)elseif(purview=3)this.借阅?T
12、OOIStriPMenUItein.Visible=true;)elseif(purview=4)this.门禁TOOlStriPMenUltem.Visible=true;)PriVateVOid用户管理TooistripMenuItenLClick(ObjeCtsender,EventArgse)UserManage.FormUserListful=newUserManage.FormUserList(All.conn):ful.ShowDialogO;PriVateVOid修改密码?TOOlStriPMenUItem_Click(ObjeCtsender,EventArgse)UserM
13、anage.FormliserPwdfup=newUserManage.FormUserPwd(All.conn,All.userLogin);fp.ShowDialogO;)privatevoidtsbtnBookType_Click(objectsender,EvontArgse)ForinBookTypeListfbtl=newFormBookTypeListO:fbtl.ShowDialogO;)privatevoidtsbtnBookAdd_Click(objectsender,EventArgse)FormBookAddfba=newIormBookddO;fba.ShowDial
14、ogO;privatevoidtsbtnBookManage_Click(objectsender,EventArgse)FormBooklnfoListfbi1=newl,ormBookInfoIJst();fbil.ShowDialogO;)privatevoidtsbtnBookStatistics_Click(objectsender,EventArgse)(FormBookStatisticsfbs=HewFormBookStatisticsO;fbs.ShowDialogO;)PriVateVOid退11?出?XTOolStriPMenUlteln_Click(ObjeCtsender,EventArgse)this.CloseO;)privatevoidtsbtnCardAdd_Click(objectsender,EventArgse)FormCardInfofci=newEormCardlnfo(l,newObjCardInfo();fci.ShowDialogO;)privatevoidtsbtnCardManage