RFID图书管理系统程序源代码.docx
《RFID图书管理系统程序源代码.docx》由会员分享,可在线阅读,更多相关《RFID图书管理系统程序源代码.docx(22页珍藏版)》请在冰豆网上搜索。
RFID图书管理系统程序源代码
登陆界面
usingSystem;
using;
using;
using;
using;
usingLabrary
{
publicpartialclassFormLogin:
Form
{
publicFormLogin()
{
InitializeComponent();
}
}
SetMenJin("PicIn");
();
户ì管¨1理¤¨=true;
this.系|ì统a3初始o化¥=true;
this.应|用模ê式o=true;
this.图a书o¨|管¨1理¤¨=true;
this.退a办¨卡§=true;
this.借¨¨阅=true;
this.门禁=true;
SetPurview();
=false;
=false;
=false;
|用模ê式o=false;
}
else
{
this.用户管理¨=false;
this.系统初始化¥=false;
this.读书管理¨=false;
this.退办卡§=false;
this.借阅=false;
this.门禁=false;
for(inti=0;i
{
stringpurview=if(purview=="1")
{
this.图书管理¨=true;
}
elseif(purview=="2")
{
this.办退卡§=true;
}
elseif(purview=="3")
{
this.借阅=true;
}
elseif(purview=="4")
{
this.门禁=true;
}
}
}
}
privatevoid用户管理¨aToolStripMenuItem_Click(objectsender,EventArgse)
{
ful=new;
();
}
privatevoid修改密码ToolStripMenuItem_Click(objectsender,EventArgse)
{
fup=new,;
();
}
privatevoidtsbtnBookType_Click(objectsender,EventArgse)
{
FormBookTypeListfbtl=newFormBookTypeList();
();
}
privatevoidtsbtnBookAdd_Click(objectsender,EventArgse)
{
FormBookAddfba=newFormBookAdd();
();
}
privatevoidtsbtnBookManage_Click(objectsender,EventArgse)
{
FormBookInfoListfbil=newFormBookInfoList();
();
}
privatevoidtsbtnBookStatistics_Click(objectsender,EventArgse)
{
FormBookStatisticsfbs=newFormBookStatistics();
();
}
privatevoid退a出XToolStripMenuItem_Click(objectsender,EventArgse)
{
();
}
privatevoidtsbtnCardAdd_Click(objectsender,EventArgse)
{
FormCardInfofci=newFormCardInfo(1,newObjCardInfo());
();
}
privatevoidtsbtnCardManage_Click(objectsender,EventArgse)
{
FormCardListfcl=newFormCardList();
();
}
privatevoidtsbtnAddTime_Click(objectsender,EventArgse)
{
stringrfid=();
if(rfid=="")
{
("请把借阅卡放到桌面读写器上!
");
}
else
{
if(rfid))
{
ObjCardInfooci=newObjCardInfo(rfid);
FormCardInfofci=newFormCardInfo(5,oci);
();
}
else
{
("没有此借阅卡信息");
}
}
}
privatevoidtsbtnCardDelete_Click(objectsender,EventArgse)
{
stringrfid=();
if(rfid=="")
{
("请把借阅卡到读写器上");
}
else
{
if(rfid))
{
ObjCardInfooci=newObjCardInfo(rfid);
intcount=();
if(count==0)
{
if("是否决定退卡!
ê","",==
{
();
("退卡成功|!
ê");
}
}
else
{
+"还有一本"+()+"本书未归还不能退卡");
}
}
else
{
("没有此借阅信息");
}
}
}
privatevoidtsbtnJie_Click(objectsender,EventArgse)
{
FormBookJiefbj=newFormBookJie
(1);
();
}
privatevoidtsbtnHuan_Click(objectsender,EventArgse)
{
FormBookHuanfbh=newFormBookHuan();
();
}
privatevoid图a书o¨|管¨1理¤¨aToolStripMenuItem_Click(objectsender,EventArgse)
{
=true;
=false;
=false;
=+"\\pic\\");
}
privatevoid退a办¨卡§ToolStripMenuItem_Click(objectsender,EventArgse)
{
=false;
=true;
=false;
=+"\\pic\\");
}
privatevoid借¨¨阅ToolStripMenuItem_Click(objectsender,EventArgse)
{
=false;
=false;
=true;
=+"\\pic\\");
}
privatevoid门禁ToolStripMenuItem_Click(objectsender,EventArgse)
{
plit(',')[0];
intheaderWidth=(headerText[i].Split(',')[1]);
=headerName;
=headerWidth;
}
DataTabledtb=for(inti=0;i
{
ObjBookInfobookInfo=newObjBookInfo[i]["RFID"].ToString());
ListViewItemitem=newListViewItem(newstring[]{,,,,});
}
ListViewItemitemCount=newListViewItem(newstring[]{"统a3计","","","","",+"本à"});
}
privatevoidtreeView1_NodeMouseClick(objectsender,TreeNodeMouseClickEventArgse)
{
if=="全部书架¨1")
{
=0;
BindListView("selectRFID,BookType_ID,Name,Author,LendStatus,BookShelffromBookInfo"));
}
if=="第一书架¨1")
{
=1;
BindListView("selectRFID,BookType_ID,Name,Author,LendStatus,BookShelffromBookInfowhereBookShelf='1'"));
}
if=="第二书架¨1")
{
=2;
BindListView("selectRFID,BookType_ID,Name,Author,LendStatus,BookShelffromBookInfowhereBookShelf='2'"));
}
if=="第三书架¨1")
{
=3;
BindListView("selectRFID,BookType_ID,Name,Author,LendStatus,BookShelffromBookInfowhereBookShelf='3'"));
}
if=="第四书架¨1")
{
=4;
BindListView("selectRFID,BookType_ID,Name,Author,LendStatus,BookShelffromBookInfowhereBookShelf='4'"));
}
}
privatevoidtoolStripComboBox1_SelectedIndexChanged(objectsender,EventArgse)
{
if==0)
{
if==0)
{
BindListView("selectRFID,BookType_ID,Name,Author,LendStatus,BookShelffromBookInfo"));
}
if==1)
{
BindListView("selectRFID,BookType_ID,Name,Author,LendStatus,BookShelffromBookInfowhereLendStatus='1'"));
}
if==2)
{
BindListView("selectRFID,BookType_ID,Name,Author,LendStatus,BookShelffromBookInfowhereLendStatus='0'"));
}
}
if>0)
{
if==0)
{
BindListView("selectRFID,BookType_ID,Name,Author,LendStatus,BookShelffromBookInfowhereBookShelf='{0}'",}
if==1)
{
BindListView("selectRFID,BookType_ID,Name,Author,LendStatus,BookShelffromBookInfowhereBookShelf='{0}'andLendStatus='1'",}
if==2)
{
BindListView("selectRFID,BookType_ID,Name,Author,LendStatus,BookShelffromBookInfowhereBookShelf='{0}'andLendStatus='0'",}
}
}
}
}
借阅卡管理
usingSystem;
using;
using;
using;
using;
usingLabrary
{
publicpartialclassFormCardList:
Form
{
publicFormCardList()
{
InitializeComponent();
SetListView();
}
privatevoidSetListView()
{
ListlistCard=();
for(inti=0;i<;i++)
{
ObjCardInfooci=listCard[i];
ListViewItemitem=newListViewItem;
=oci;
subitem1=new();
=;
subitem2=new();
=;
subitem3=new();
="yyyy年¨oMM月dd日¨");
subitem4=new();
=;
subitem5=new();
=subitem6=new();
=subitem7=new();
=}
}
privatevoidSetListView(ListlistCard)
{
for(inti=0;i<;i++)
{
ObjCardInfooci=listCard[i];
ListViewItemitem=newListViewItem;
=oci;
subitem1=new();
=;
subitem2=new();
=;
subitem3=new();
="yyyy年¨oMM月dd日¨");
subitem4=new();
=;
subitem5=new();
=subitem6=new();
=subitem7=new();
=}
}
privatevoidtsbtnExit_Click(objectsender,EventArgse)
{
();
}
privatevoidtsbtnInsert_Click(objectsender,EventArgse)
{
FormCardInfofci=newFormCardInfo(1,newObjCardInfo());
if()==
{
SetListView();
IsEnabled(false);
}
}
privatevoidIsEnabled(boolEnabled)
{
oString());
=;
subitem1=new();
=row["lendtime"].ToString();
subitem2=new();
=row["returntime"].ToString();
}
}
privatevoidtsbtnExit_Click(objectsender,EventArgse)
{
();
}
}
}
图书管理
usingSystem;
using;
using;
using;
using;
usingLabrary
{
publicpartialclassFormBookInfoList:
Form
{
publicFormBookInfoList()
{
InitializeComponent();
}
privatevoidSetCboBookType()
{
stringsql="select*frombooktype";
DataTabledt==dt;
="Name";
="ID";
}
privatevoidSetListView()
{
IsEnabled(false);
ListlistBookInfo=for(inti=0;i<;i++)
{
ObjBookInfoobi=listBookInfo[i];
ListViewItemitem=newListViewItem();
=;
=obi;
subLendStatus=new();
=;
subBookName=new();
=;
subPress=new();
=;
subPrice=new();
=;
subAddPerson=new();
=subAddTime=new();
=}
}
privatevoidtsbtnExit_Click(objectsender,EventArgse)
{
();
}
privatevoidtscboBookType_DropDown(objectsender,EventArgse)
{
SetCboBookType();
}
privatevoidtscboBookType_DropDownClosed(objectsender,EventArgse)
{
SetListView();
}
privatevoidtsbtnInsert_Click(objectsender,EventArgse)
{
FormBookAddfba=newFormBookAdd();
if()==
{
}
}
privatevoidlistView1_SelectedIndexChanged(objectsender,EventArgse)
{
if>0)
{
IsEnabled(true);
}
else
{
IsEnabled(false);
}
}
privatevoidIsEnabled(boolenabled)
{
=enabled;
=enabled;
}
privatevoidtsbtnUpdate_Click(objectsender,EventArgse)
{
if>0)
{
FormBookInfofbi=newFormBookInfo(3,asObjBookInfo);
if()==
{
SetListView();
}
}
}
privatevoidlistView1_MouseDoubleClick(objectsender,MouseEventArgse)
{
if>0)
{
FormBookInfofbi=newFormBookInfo(4,asObjBookInfo);
();
}
}
privatevoidtsbtnBookRecord_Click(objectsender,EventArgse)
{
if>0)
{
FormBookRecordfbr=newFormBookRecordasObjBookInfo);
();
}
}
}
}
图书上架
usingSystem;
using;
using;
using;
using;
usingLabrary
{
publicpartialclassFormBookAdd:
Form
{
ListlistAllRfid=newList();
ListlistBookInfo=newList();
publicFormBookAdd()
{
InitializeComponent();
=0;
}
privateboolValidControl()
{
if==0)
{
("请读取图书RFID!
ê");
returnfalse;
}
if=="")
{
("请选择图书分类");
returnfalse;
}
if=="")
{
("请填写书名");
returnfalse;
}
if=="")
{
("请填写作者");
returnfalse;
}
if=="")
{
("请填写定价");
returnfalse;
}
if=="")
{
("请填写出版社");
returnfalse;
}
if==0)
{
("请选择书架");
returnfalse;
}
returntrue;
}
privatevoidgbtnCancel_Click(objectsender,EventArgse)
{
();
}
privatevoidbtnReadRFID_Click(objectsender,EventArgse)
{
ListlistRfid=();
for(inti=0;i<;i++)
{
oString();
}
oString());
=;
subitem1=new();
=row["lendtime"].ToString();
subitem2=new();
=row["returntime"].ToString();
}
}
privatevoidtsbtnExit_Click(objectsender,EventArgse)
{
();
}
}
}