最新c#图书馆系统.doc





《最新c#图书馆系统.doc》由会员分享,可在线阅读,更多相关《最新c#图书馆系统.doc(27页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精品资料c#图书馆系统. 目录2.1创建数据库41353.7管理员界面163.8注册界面183.9添加图书界面191122334.6 添加图书功能 244.7 用户信息2445.1连接数据库255.2操作数据库中的数据2571、绪论2、数据库设计2.1 数据库分析本系统利用Visual Studio 2010处理数据库的功能,实现对图书馆信息的管理。主要功能为管理有关用户、管理员、书籍和借阅的信息等。本系统的结构分为用户信息管理模块、书籍信息管理模块、借阅信息管理模块、管理者管理信息模块和查询处理模块。图书馆管理系统框图如图所示 进入图书馆管理系统借阅图书查询图书增加图书查询图书图书管理登录
2、用户 管理员失败成功 2.2创建数据库3、界面设计3.1登陆界面amespace 图书管理系统 public partial class Form1 : Form public Form1() InitializeComponent(); public static Form fm = null; private static int ErrorTimes = 0; private void button3_Click(object sender, EventArgs e) this.Close(); private void textBox1_TextChanged(object sende
3、r, EventArgs e) private void button1_Click(object sender, EventArgs e) if (textBox1.Text = | textBox2.Text = ) MessageBox.Show(提示:请输入用户名和密码!, 警告); SqlConnection conn = new SqlConnection(Server=PC_201402131602;Integrated Security=true;DataBase=图书管理系统); conn.Open(); SqlCommand cmd = new SqlCommand(sel
4、ect * from Table_1 where id= + textBox1.Text.Trim() + and us= + textBox2.Text.Trim() + , conn); SqlDataReader sdr = cmd.ExecuteReader(); sdr.Read(); if (sdr.HasRows) MessageBox.Show(登录成功!, 提示); Form2 fm = new Form2(); fm.Show(); this.Hide(); else ErrorTimes+; MessageBox.Show(用户名或密码不正确!您还有 + (3 - Err
5、orTimes) + 次输入密码的机会,请重新输入!如果超过3次,系统将自动关闭); if (ErrorTimes = 3) ErrorTimes = 0; conn.Close(); private void Form1_Load(object sender, EventArgs e) private void button4_Click(object sender, EventArgs e) if (textBox1.Text = | textBox2.Text = ) MessageBox.Show(提示:请输入用户名和密码!, 警告); SqlConnection conn = new
6、 SqlConnection(Server=PC_201402131602;Integrated Security=true;DataBase=图书管理系统); conn.Open(); SqlCommand cmd = new SqlCommand(select * from Table_2 where uid= + textBox1.Text.Trim() + and usr= + textBox2.Text.Trim() + , conn); SqlDataReader sdr = cmd.ExecuteReader(); sdr.Read(); if (sdr.HasRows) Mes
7、sageBox.Show(登录成功!, 提示); Form7 fm = new Form7(); fm.Show(); this.Hide(); else ErrorTimes+; MessageBox.Show(用户名或密码不正确!您还有 + (3 - ErrorTimes) + 次输入密码的机会,请重新输入!如果超过3次,系统将自动关闭); if (ErrorTimes = 3) ErrorTimes = 0; conn.Close(); private void button2_Click(object sender, EventArgs e) Form8 f1=new Form8();
8、 f1.Show(); private void button5_Click(object sender, EventArgs e) this.Hide(); Form10 f2 = new Form10(); f2.Show(); 3.2图书管理系统界面namespace 图书管理系统 public partial class Form2 : Form public Form2() InitializeComponent(); private void button5_Click(object sender, EventArgs e) this.Close(); private void b
9、utton3_Click(object sender, EventArgs e) Form3 f2 = new Form3(); f2.Show(); this.Close(); MessageBox.Show(您已成功进入-图书信息!); private void button2_Click(object sender, EventArgs e) Form4 f4 = new Form4(); f4.Show(); this.Close(); MessageBox.Show(您已成功进入-还书系统!); private void button1_Click(object sender, Ev
10、entArgs e) Form5 f5 = new Form5(); f5.Show(); this.Close(); MessageBox.Show(您已成功进入-借书系统!); 3.3图书信息namespace 图书管理系统 public partial class Form3 : Form public Form3() InitializeComponent(); private void Form3_Load(object sender, EventArgs e) / TODO: 这行代码将数据加载到表“图书管理系统DataSet.Table_3”中。您可以根据需要移动或删除它。 th
11、is.table_3TableAdapter.Fill(this.图书管理系统DataSet.Table_3); private void textBox1_TextChanged(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e) this.Close(); 3.4归还图书namespace 图书管理系统 public partial class Form4 : Form public Form4() InitializeComponent(); private void but
12、ton1_Click(object sender, EventArgs e) if (textBox1.Text = ) MessageBox.Show(提示:请输入所借书籍编号!, 警告); SqlConnection conn = new SqlConnection(Server=PC_201402131602;Integrated Security=true;DataBase=图书管理系统); conn.Open(); SqlCommand cmd = new SqlCommand(select * from Table_4 where sid= + textBox1.Text.Trim
13、() + , conn); SqlDataReader sdr = cmd.ExecuteReader(); sdr.Read(); if (sdr.HasRows) MessageBox.Show(该书已还, 提示); else sdr.Close(); string myinsert = insert into Table_4 (sid) values ( + textBox1.Text + ) ; SqlCommand mycom = new SqlCommand(myinsert, conn); mycom.ExecuteNonQuery(); conn.Close(); conn.D
14、ispose(); MessageBox.Show(您已还书成功!); private void Form4_Load(object sender, EventArgs e) / TODO: 这行代码将数据加载到表“图书管理系统DataSet.Table_4”中。您可以根据需要移动或删除它。 this.table_4TableAdapter.Fill(this.图书管理系统DataSet.Table_4); / TODO: 这行代码将数据加载到表“图书管理系统DataSet.Table_3”中。您可以根据需要移动或删除它。 this.table_3TableAdapter.Fill(this.
15、图书管理系统DataSet.Table_3); private void button2_Click(object sender, EventArgs e) this.Close(); Form2 f2 = new Form2(); f2.Show(); 3.5已借图书namespace 图书管理系统 public partial class Form5 : Form public Form5() InitializeComponent(); private void button1_Click(object sender, EventArgs e) this.Close(); Form2 f
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 最新 c# 图书馆 系统

限制150内