![点击分享此内容可以赚币 分享](/master/images/share_but.png)
RFID图书管理系统程序源代码.doc
《RFID图书管理系统程序源代码.doc》由会员分享,可在线阅读,更多相关《RFID图书管理系统程序源代码.doc(47页珍藏版)》请在咨信网上搜索。
精品文档 登陆界面 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Labrary { public partial class FormLogin : Form { public FormLogin() { InitializeComponent(); } /// <summary> /// 验¨¦证¡è控?件t /// </summary> /// <returns></returns> private bool ValidControl() { if (this.tbID.Text == "") { MessageBox.Show("请填写用户名!ê?"); this.tbID.Focus(); return false; } if (this.tbID.Text != "admin") { if (!UserManage.ObjUser.IsHasID(All.dbo, this.tbID.Text)) { MessageBox.Show("不存在此用户!ê?"); this.tbID.Text = ""; this.tbID.Focus(); return false; } } if (this.tbID.Text != "admin") { UserManage.ObjUser user= new UserManage.ObjUser(this.tbID.Text, All.dbo); if (user.PWD != this.tbPWD.Text) { MessageBox.Show("密码错误!ê?"); this.tbPWD.Text = ""; this.tbPWD.Focus(); return false; } } else { if (this.tbPWD.Text != "123456") { MessageBox.Show("密码错误! "); this.tbPWD.Text = ""; this.tbPWD.Focus(); return false; } } return true; } private void gbtnCancel_Click(object sender, EventArgs e) { this.Close(); } private void gbtnOK_Click(object sender, EventArgs e) { //如¨?果?验¨¦证¡è控?件t通ª¡§过y if (ValidControl()) { if (this.tbID.Text != "admin") { All.userLogin = new UserManage.ObjUser(this.tbID.Text, All.dbo); } else { All.userLogin = new UserManage.ObjUser(All.dbo); All.userLogin.ID = "admin"; All.userLogin.Name = "管理员"; } this.DialogResult = DialogResult.OK; this.Close(); } } } } 主界面 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Labrary { public partial class FormMain : Form { public const int WM_USER = 0x0400; public const int WM_GETBUFFER_LOOP = WM_USER + 2; private RFID_dll.Reader rdr; private RFID_dll.RFID rfid; List<string> rfids = new List<string>(); int directionFlag = 0;//1进;出? FormInAndOut fiao = new FormInAndOut(); public FormMain() { InitializeComponent(); this.rdr = new RFID_dll.Reader(); //this.rfid = new RFID_dll.RFID(rdr); } private void FormMain_Load(object sender, EventArgs e) { Init(); } /// <summary> /// 初始化 /// </summary> private void Init() { fiao.StartPosition = FormStartPosition.Manual; //多窗体在不同时间显示 Screen[] screens = Screen.AllScreens; if (screens.Length == 2) { List<Screen> listScreen = new List<Screen>(); foreach (Screen screen in Screen.AllScreens) { if (screen.Primary == false) { listScreen.Add(screen); } } fiao.Location = listScreen[0].WorkingArea.Location; } SetMenJin("PicIn"); fiao.Show(); //toolStripStatusLabel2显示登陆用户名? toolStripStatusLabel2.Text = All.userLogin.Name; this.panel1.BackgroundImage = null; //菜单栏全部显示º? this.用®?户¡ì管¨¹理¤¨ªToolStripMenuItem.Visible = true; this.系¦Ì统ª3初?始º?化¡¥CToolStripMenuItem.Visible = true; this.应®|用®?模¡ê式º?ToolStripMenuItem.Visible = true; this.图ª?书º¨¦管¨¹理¤¨ªToolStripMenuItem.Visible = true; this.退ª?办㨬卡¡§ToolStripMenuItem.Visible = true; this.借¨¨阅?ToolStripMenuItem.Visible = true; this.门?禁?ToolStripMenuItem.Visible = true; SetPurview(); this.toolStrip1.Visible = false; this.toolStrip2.Visible = false; this.toolStrip3.Visible = false; //rfid.OpenSerial(); ////是º?否¤?找¨°到Ì?门?禁?设¦¨¨备À? //if (rfid.ChangeWorkModel(2)) //{ // rfid.StartInventory(this.Handle.ToInt32(),2); //} } /// <summary> /// 权限设置 /// </summary> private void SetPurview() { if (All.userLogin.ID == "admin") { this.应®|用®?模¡ê式º?ToolStripMenuItem.Visible = false; } else { this.用户管理¨ªToolStripMenuItem.Visible = false; this.系统初始化¡¥CToolStripMenuItem.Visible = false; this.读书管理¨ªToolStripMenuItem.Visible = false; this.退办卡¡§ToolStripMenuItem.Visible = false; this.借阅ToolStripMenuItem.Visible = false; this.门禁?ToolStripMenuItem.Visible = false; for (int i = 0; i < All.userLogin.Purview.Count; i++) { string purview = All.userLogin.Purview[i]; if (purview == "1") { this.图书管理¨ªToolStripMenuItem.Visible = true; } else if (purview == "2") { this.办退卡¡§ToolStripMenuItem.Visible = true; } else if (purview == "3") { this.借阅?ToolStripMenuItem.Visible = true; } else if (purview == "4") { this.门禁ToolStripMenuItem.Visible = true; } } } } private void 用户管理¨ªToolStripMenuItem_Click(object sender, EventArgs e) { UserManage.FormUserList ful = new UserManage.FormUserList(All.conn); ful.ShowDialog(); } private void 修改密码?ToolStripMenuItem_Click(object sender, EventArgs e) { UserManage.FormUserPwd fup = new UserManage.FormUserPwd(All.conn, All.userLogin); fup.ShowDialog(); } private void tsbtnBookType_Click(object sender, EventArgs e) { FormBookTypeList fbtl = new FormBookTypeList(); fbtl.ShowDialog(); } private void tsbtnBookAdd_Click(object sender, EventArgs e) { FormBookAdd fba = new FormBookAdd(); fba.ShowDialog(); } private void tsbtnBookManage_Click(object sender, EventArgs e) { FormBookInfoList fbil = new FormBookInfoList(); fbil.ShowDialog(); } private void tsbtnBookStatistics_Click(object sender, EventArgs e) { FormBookStatistics fbs = new FormBookStatistics(); fbs.ShowDialog(); } private void 退ª?出?XToolStripMenuItem_Click(object sender, EventArgs e) { this.Close(); } private void tsbtnCardAdd_Click(object sender, EventArgs e) { FormCardInfo fci = new FormCardInfo(1, new ObjCardInfo()); fci.ShowDialog(); } private void tsbtnCardManage_Click(object sender, EventArgs e) { FormCardList fcl = new FormCardList(); fcl.ShowDialog(); } private void tsbtnAddTime_Click(object sender, EventArgs e) { string rfid = RfidOperate.GetCard(); if (rfid == "") { MessageBox.Show("请把借阅卡放到桌面读写器上!"); } else { if (ObjCardInfo.IsHas(rfid)) { ObjCardInfo oci = new ObjCardInfo(rfid); FormCardInfo fci = new FormCardInfo(5, oci); fci.ShowDialog(); } else { MessageBox.Show("没有此借阅卡信息"); } } } private void tsbtnCardDelete_Click(object sender, EventArgs e) { string rfid = RfidOperate.GetCard(); if (rfid == "") { MessageBox.Show("请把借阅卡到读写器上?"); } else { if (ObjCardInfo.IsHas(rfid)) { ObjCardInfo oci = new ObjCardInfo(rfid); int count = oci.NotReturnCount(); if (count == 0) { if (MessageBox.Show("是否决定退卡!ê?", "", MessageBoxButtons.YesNo) == DialogResult.Yes) { oci.Delete(); MessageBox.Show("退卡成功|!ê?"); } } else { MessageBox.Show(oci.Name + "还有一本 " + count.ToString() + " 本书未归还不能退卡?"); } } else { MessageBox.Show("没有此借阅信息?"); } } } private void tsbtnJie_Click(object sender, EventArgs e) { FormBookJie fbj = new FormBookJie(1); fbj.ShowDialog(); } private void tsbtnHuan_Click(object sender, EventArgs e) { FormBookHuan fbh = new FormBookHuan(); fbh.ShowDialog(); } private void 图ª?书º¨¦管¨¹理¤¨ªToolStripMenuItem_Click(object sender, EventArgs e) { this.toolStrip1.Visible = true; this.toolStrip2.Visible = false; this.toolStrip3.Visible = false; this.panel1.BackgroundImage = Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + "\\pic\\1.jpg"); } private void 退ª?办㨬卡¡§ToolStripMenuItem_Click(object sender, EventArgs e) { this.toolStrip1.Visible = false; this.toolStrip2.Visible = true; this.toolStrip3.Visible = false; this.panel1.BackgroundImage = Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + "\\pic\\2.jpg"); } private void 借¨¨阅?ToolStripMenuItem_Click(object sender, EventArgs e) { this.toolStrip1.Visible = false; this.toolStrip2.Visible = false; this.toolStrip3.Visible = true; this.panel1.BackgroundImage = Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + "\\pic\\3.jpg"); } private void 门?禁?ToolStripMenuItem_Click(object sender, EventArgs e) { //MenJinInit(); //this.toolStrip1.Visible = false; //this.toolStrip2.Visible = false; //this.toolStrip3.Visible = false; //this.panel1.BackgroundImage = null; //rfid.OpenSerial(); ////是否找到门禁设备? //if (rfid.IsOpen) //{ // rfid.StartInventory(this.Handle.ToInt32()); //} } private void 注销²ToolStripMenuItem_Click(object sender, EventArgs e) { All.userLogin = null; FormLogin fl = new FormLogin(); if (fl.ShowDialog() != DialogResult.OK) { this.Close(); } else { Init(); } } private void 帮助¨²ToolStripMenuItem1_Click(object sender, EventArgs e) { } private void 系统初始化¡¥CToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("是否初始化数据库?", "", MessageBoxButtons.YesNo) == DialogResult.Yes) { All.dbo.excuteSql("delete from lendtable"); All.dbo.excuteSql("delete from bookinfo"); All.dbo.excuteSql("delete from booktype"); All.dbo.excuteSql("delete from librarycard"); All.dbo.excuteSql("delete from usertable"); MessageBox.Show("初始化完成?"); } } private void 关于ToolStripMenuItem_Click(object sender, EventArgs e) { FormAbout fa = new FormAbout(); fa.ShowDialog(); } protected override void DefWndProc(ref System.Windows.Forms.Message m) { if (m.Msg == WM_GETBUFFER_LOOP) { //启动 if (this.timer1.Tag.ToString() == "0") { this.timer1.Start(); this.timer1.Tag = "1"; } string uid = ""; string direction = ""; bool personWithMultCard = false; rdr.GetLoopGetBufferData(m, ref uid, ref direction, ref personWithMultCard); if (uid != "0000000000000000") { //进 if (direction == "In") { this.directionFlag = 1; this.rfids.Add(uid); } //出 if (direction == "Out") { this.directionFlag = 2; this.rfids.Add(uid); } if (uid == "FFFFFFFFFFFFFFFF") { } } } base.DefWndProc(ref m); } private void timer1_Tick(object sender, EventArgs e) { if (this.directionFlag == 1) { for (int i = 0; i < this.rfids.Count; i++) { if (ObjCardInfo.IsHas(this.rfids[i])) {- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- RFID 图书 管理 系统 程序 源代码
![提示](https://www.zixin.com.cn/images/bang_tan.gif)
1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前自行私信或留言给上传者【胜****】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时私信或留言给本站上传会员【胜****】,需本站解决可联系【 微信客服】、【 QQ客服】,若有其他问题请点击或扫码反馈【 服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【 版权申诉】”(推荐),意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4008-655-100;投诉/维权电话:4009-655-100。
关于本文