RFID图书管理系统程序源代码
更新时间:2023-10-08 07:13:01 阅读量: 综合文库 文档下载
登陆界面
using System;
using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text;
using System.Windows.Forms;
namespace Labrary {
publicpartialclassFormLogin : Form {
public FormLogin() {
InitializeComponent(); }
///
///
if (this.tbID.Text == \) {
MessageBox.Show(\请填写用户名!ê?\); this.tbID.Focus(); returnfalse; }
if (this.tbID.Text != \) {
if (!UserManage.ObjUser.IsHasID(All.dbo, this.tbID.Text)) {
MessageBox.Show(\不存在此用户!ê?\); this.tbID.Text = \; this.tbID.Focus(); returnfalse; } }
if (this.tbID.Text != \)
{
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(); returnfalse; } } else
{
if (this.tbPWD.Text != \) {
MessageBox.Show(\密码错误! \); this.tbPWD.Text = \; this.tbPWD.Focus(); returnfalse; } }
returntrue; }
privatevoid gbtnCancel_Click(object sender, EventArgs e) { this.Close(); }
privatevoid gbtnOK_Click(object sender, EventArgs e) {
//如¨?果?验¨|证?è控?件t通a?§过y if (ValidControl()) {
if (this.tbID.Text != \) {
All.userLogin = new UserManage.ObjUser(this.tbID.Text, All.dbo); } else
{
All.userLogin = new UserManage.ObjUser(All.dbo); All.userLogin.ID = \;
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 {
publicpartialclassFormMain : Form {
publicconstint WM_USER = 0x0400;
publicconstint WM_GETBUFFER_LOOP = WM_USER + 2; private RFID_dll.Reader rdr; private RFID_dll.RFID rfid;
List
FormInAndOut fiao = newFormInAndOut();
public FormMain() {
InitializeComponent();
this.rdr = new RFID_dll.Reader(); //this.rfid = new RFID_dll.RFID(rdr); }
privatevoid FormMain_Load(object sender, EventArgs e) {
Init(); }
///
fiao.StartPosition = FormStartPosition.Manual;
//多窗体在不同时间显示
Screen[] screens = Screen.AllScreens; if (screens.Length == 2) {
List
if (screen.Primary == false) {
listScreen.Add(screen); } }
fiao.Location = listScreen[0].WorkingArea.Location;
}
SetMenJin(\); fiao.Show();
//toolStripStatusLabel2显示登陆用户名?
toolStripStatusLabel2.Text = All.userLogin.Name;
this.panel1.BackgroundImage = null;
//菜单栏全部显示o?
this.用??户?ì管¨1理¤¨aToolStripMenuItem.Visible = true; this.系|ì统a3初?始o?化?¥CToolStripMenuItem.Visible = true;
this.应?|用??模?ê式o?ToolStripMenuItem.Visible = true;
this.图a?书o¨|管¨1理¤¨aToolStripMenuItem.Visible = true; this.退a?办?¨?卡?§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();
////是o?否¤?找¨?到ì?门?禁?设|¨¨备à? //if (rfid.ChangeWorkModel(2)) //{
// rfid.StartInventory(this.Handle.ToInt32(),2); //} }
///
privatevoid SetPurview() {
if (All.userLogin.ID == \) {
this.应?|用??模?ê式o?ToolStripMenuItem.Visible = false; } else
{
this.用户管理¨aToolStripMenuItem.Visible = false; this.系统初始化?¥CToolStripMenuItem.Visible = false; this.读书管理¨aToolStripMenuItem.Visible = false; this.退办卡?§ToolStripMenuItem.Visible = false; this.借阅ToolStripMenuItem.Visible = false; this.门禁?ToolStripMenuItem.Visible = false;
for (int i = 0; i
string purview = All.userLogin.Purview[i]; if (purview == \) {
this.图书管理¨aToolStripMenuItem.Visible = true; } elseif (purview == \) {
this.办退卡?§ToolStripMenuItem.Visible = true; }
protectedoverridevoid DefWndProc(ref System.Windows.Forms.Message m) {
if (m.Msg == WM_GETBUFFER_LOOP) { //启动
if (this.timer1.Tag.ToString() == \) { this.timer1.Start(); this.timer1.Tag = \; }
string uid = \; string direction = \;
bool personWithMultCard = false;
rdr.GetLoopGetBufferData(m, ref uid, ref direction, ref personWithMultCard);
if (uid != \) { //进
if (direction == \) { this.directionFlag = 1; this.rfids.Add(uid); } //出
if (direction == \) { this.directionFlag = 2; this.rfids.Add(uid); }
if (uid == \) {
} }
}
base.DefWndProc(ref m);
}
privatevoid timer1_Tick(object sender, EventArgs e) {
if (this.directionFlag == 1) {
for (int i = 0; i if (ObjCardInfo.IsHas(this.rfids[i])) { ObjCardInfo oci = newObjCardInfo(this.rfids[i]); if (oci.IsOverTime()) { SetMenJin(\); MenJinInit(); return; } else { SetMenJin(\); MenJinInit(); return; } } } SetMenJin(\); MenJinInit(); } elseif (this.directionFlag == 2) { for (int i = 0; i if (ObjBookInfo.IsHas(this.rfids[i])) { ObjBookInfo obi = newObjBookInfo(this.rfids[i]); if (obi.LendStatus == \为借出?\) { this.rdr.WarningOutput(false, false, true, false, false); SetMenJin(\); MenJinInit(); return; } } } MenJinInit(); } } /// privatevoid MenJinInit() { this.rfids.Clear(); this.directionFlag = 0; this.timer1.Tag = \; this.timer1.Stop(); } privatevoid SetMenJin(string message) { this.fiao.Controls.Clear(); UserControlMenJin ucmj = newUserControlMenJin(message); ucmj.Dock = DockStyle.Fill; this.fiao.Controls.Add(ucmj); } privatevoid FormMain_FormClosing(object sender, FormClosingEventArgs e) { //this.rfid.StopInventory(); //this.rfid.CloseSerial(); } } } 图书统计 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Labrary { publicpartialclassFormBookStatistics : Form { privateint boolShelf; public FormBookStatistics() { InitializeComponent(); BindTreeView(); this.boolShelf = 0; BindListView(\BookInfo\); this.cboBookLendStatus.SelectedIndex = 0; } privatevoid BindTreeView() { this.treeView1.Nodes.Clear(); TreeNode nodeRoot = newTreeNode(); nodeRoot.Text = \全部书架1\; this.treeView1.Nodes.Add(nodeRoot); for (int i = 0; i < 4; i++) { TreeNode nodeChild = newTreeNode(); if (i == 0) { nodeChild.Text = \第一书架1\; } if (i == 1) { nodeChild.Text = \第二书架¨1\; } if (i == 2) { nodeChild.Text = \第三书架¨1\; } if (i == 3) { nodeChild.Text = \第四书架¨1\; } nodeRoot.Nodes.Add(nodeChild); } nodeRoot.Expand(); } privatevoid BindListView(string sql) { this.listView1.Items.Clear(); this.listView1.Columns.Clear(); string[] headerText = newstring[] { \标签,100\, \所属分类¤¨¤,100\, \书名,150\, \作者,80\, \借阅状态,80\, \所在书架,80\ }; for (int i = 0; i < headerText.Length; i++) { ColumnHeader header = newColumnHeader(); string headerName = headerText[i].Split(',')[0]; int headerWidth = Convert.ToInt32(headerText[i].Split(',')[1]); header.Text = headerName; header.Width = headerWidth; this.listView1.Columns.Add(header); } DataTable dtb = All.dbo.getDataTable(sql); for (int i = 0; i < dtb.Rows.Count; i++) { ObjBookInfo bookInfo = newObjBookInfo(dtb.Rows[i][\].ToString()); ListViewItem item = newListViewItem(newstring[] { bookInfo.RFID, bookInfo.BookType.Name, bookInfo.Name, bookInfo.Author, bookInfo.LendStatus, bookInfo.BookShelf }); this.listView1.Items.Add(item);
正在阅读:
RFID图书管理系统程序源代码10-08
小蝌蚪的自述作文500字06-26
2019年全面主题教育个人检视问题剖析材料1930字范文01-03
缓冲区分析与地图叠置03-30
北电学生拉片作业 - 图文09-26
《胡玉吕传 黄宗羲》阅读答案附翻译12-11
及时雨作文600字07-15
如何应对拆迁的好文章11-07
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 源代码
- 管理系统
- 程序
- 图书
- RFID
- 外研版英语四年级下册教案(一年级起点)
- 服务业组织标准化工作指南解读篇
- 上海体育学院2016-2017年硕士研究生入学考试(运动人体科学)试题
- 农村义务教育政策落实的现状-毕业论文
- 2015-2020年中国工业气体行业监测及投资方向研究报告 - 图文
- 基于ubuntu12.04LTS搭建Qt&QtE开发环境
- 技能(市场预测2) - 图文
- 当代中国社会民工学校生存问题之我见
- 青岛海关对保税仓库及所存货物的管理
- 2009第六套试题客观题答案
- 2017年6月社会心理学超星考试答案
- 用友T3企管通11.3考试准确答案
- 计算机科学概论参考题
- 基于逆向工程技术的爬行士兵玩具外壳模具设计 - 图文
- 婚礼祝酒词集锦
- 开门红启动大会主持词
- 禽星数术
- S7-300常用操作说明 - 图文
- 河北省滦县第三中学七年级数学上册 5.1 一元一次方程导学案1(无答案)(新版)冀教版
- 万科城 - 7.2.7.2.1第七章-第二节-简单的轴对称图形(1)