ImageVerifierCode 换一换
格式:DOCX , 页数:59 ,大小:29.43KB ,
资源ID:25119185      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/25119185.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(图书管理系统源码C#版.docx)为本站会员(b****7)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

图书管理系统源码C#版.docx

1、图书管理系统源码C#版登录界面:using System;using System。Collections.Generic;using System。ComponentModel;using System。Data;using System.Drawing;using System。Text;using System。Windows.Forms;using System。Data.SqlClient;namespace book public partial class login : Form public string password; /用来存储密码 public login() In

2、itializeComponent(); private void button2_Click(object sender, EventArgs e) Application。Exit(); private bool yanzhengshuru() password = textBox3.Text; if (Typename。Text。Trim() = ”) MessageBox。Show(”请选择登录类型”, 登录提示, MessageBoxButtons。OK, MessageBoxIcon。Information); Typename。Focus(); return false; els

3、e if (loginid.Text。Trim() = ”) MessageBox.Show(”请输入用户名”, ”登录提示”, MessageBoxButtons.OK, MessageBoxIcon.Information); loginid。Focus(); return false; else if (password = ”) MessageBox。Show(”请输入密码”, ”登录提示”, MessageBoxButtons。OK, MessageBoxIcon。Information); textBox3。Focus(); return false; else return tr

4、ue; private void button1_Click(object sender, EventArgs e) userhelper.adminid= loginid。Text; /用户账号 password = textBox3.Text;/用户密码 if (yanzhengshuru()) if (Typename.Text。Trim() = ”管理员”) string sql = string。Format(”Select count(*) from admin where adminId=0 and adminpass=1, loginid.Text, password); tr

5、y SqlCommand command = new SqlCommand(sql, Dbhelper.connection); Dbhelper.connection。Open(); int count = (int)command。ExecuteScalar(); if (count 1) MessageBox。Show(”用户或密码不存在!”); /result = false; else admin admin = new admin(); admin.Show(); catch (Exception ex) MessageBox。Show(操作数据库出错!”); Console。Wr

6、iteLine(ex.Message); finally Dbhelper.connection.Close(); if (Typename.Text。Trim() = ”借阅者”) userhelper.readerid =Convert 。ToString (loginid。Text); string sql = string。Format(”Select count() from reader where readerId=0 and readerpass=1”, userhelper。readerid,textBox3。Text); try / 创建 Command 对象 SqlCom

7、mand command = new SqlCommand(sql, Dbhelper.connection); / 打开数据库连接 Dbhelper.connection.Open(); / 验证是否为合法用户 int count = (int)command。ExecuteScalar(); if (count 1) MessageBox.Show(用户或密码不存在!); /result = false; else reader reader = new reader(); reader。Show(); catch (Exception ex) MessageBox。Show(”操作数据库

8、出错!”); Console.WriteLine(ex.Message); /result = false; finally / 关闭数据库连接 Dbhelper。connection.Close(); private void login_Load(object sender, EventArgs e) 读者界面;using System;using System。Collections.Generic;using System.ComponentModel;using System。Data;using System.Drawing;using System.Text;using Syst

9、em。Windows.Forms;using System.Data。Sql;using System。Data.SqlClient;namespace book public partial class reader : Form public reader() InitializeComponent(); private void button3_Click(object sender, EventArgs e) string id =Convert。ToString (textBox1.Text); if (id!=userhelper。readerid) MessageBox.Show

10、(”输入账号与登陆账号不相同,请重新输入”,提示,MessageBoxButtons.OK,MessageBoxIcon.Warning); textBox1。Text = ”; textBox1.Focus(); else try string sql = string.Format(”update reader set islost=0where readerid=1, 是,id); Dbhelper.connection。Open(); SqlCommand command = new SqlCommand(sql,Dbhelper.connection); int result = c

11、ommand。ExecuteNonQuery(); if (result 1) MessageBox.Show(修改失败); else MessageBox.Show(”挂失成功); catch MessageBox.Show(error); finally Dbhelper。connection。Close(); private void toolStripButton3_Click(object sender, EventArgs e) groupBox1.Visible = false; groupBox2。Visible = true; private void toolStripBu

12、tton4_Click(object sender, EventArgs e) groupBox1.Visible = true; groupBox2。Visible = false; private void button5_Click(object sender, EventArgs e) textBox2.Text = ; textBox4。Text = ; textBox5.Text = ; private void Form1_Load(object sender, EventArgs e) toolStrip1。Text = string.Format(”学生:0,userhelp

13、er。readerid); private void button4_Click(object sender, EventArgs e) string id =Convert。ToString (textBox2。Text); if (id!=userhelper。readerid) MessageBox.Show(输入账号与登陆账号不相同,请重新输入”,”提示,MessageBoxButtons.OK,MessageBoxIcon.Warning); textBox1。Text = ; textBox1。Focus(); else if (textBox4。Text!=textBox5.Te

14、xt) MessageBox。Show (”两次密码输入不同); else try string sql = string。Format(”update reader set readerpass=0 where readerid=1”, textBox4。Text,id); Dbhelper.connection.Open(); SqlCommand command = new SqlCommand(sql,Dbhelper.connection); int result = command。ExecuteNonQuery(); if (result 1) MessageBox。Show(”

15、修改失败”); else MessageBox.Show(”修改成功); catch MessageBox.Show(error); finally Dbhelper。connection.Close(); private void toolStripButton6_Click(object sender, EventArgs e) addreader addreader = new addreader(); addreader = new addreader(); private void toolStripButton1_Click(object sender, EventArgs e)

16、readsearchbook searchbook = new readsearchbook(); searchbook.Show(); private void toolStripButton2_Click(object sender, EventArgs e) borrow a = new borrow(); a。Show(); private void toolStripButton5_Click(object sender, EventArgs e) readerseacherinfo a = new readerseacherinfo(); a.Show(); private voi

17、d 图书查询ToolStripMenuItem1_Click(object sender, EventArgs e) readsearchbook a = new readsearchbook(); a。Show(); this.Close(); private void 结束查询ToolStripMenuItem_Click(object sender, EventArgs e) borrow a = new borrow(); a。Show(); this。Close(); private void 修改密码ToolStripMenuItem_Click(object sender, Ev

18、entArgs e) groupBox1.Visible = false; groupBox2.Visible = true; private void 挂失ToolStripMenuItem_Click(object sender, EventArgs e) groupBox1.Visible = true; groupBox2.Visible = false; private void 退出ToolStripMenuItem_Click(object sender, EventArgs e) this。Close(); private void button2_Click(object s

19、ender, EventArgs e) Application。Exit(); 管理员界面;using System;using System.Collections.Generic;using System。ComponentModel;using System。Data;using System.Drawing;using System。Text;using System.Windows.Forms;namespace book public partial class admin : Form public admin() InitializeComponent(); private v

20、oid 退出ToolStripMenuItem_Click(object sender, EventArgs e) this.Close(); private void admin_Load(object sender, EventArgs e) toolStrip1.Text=string.Format (”管理员:登录”,userhelper。adminid); private void toolStripButton4_Click(object sender, EventArgs e)/录入学生信息 addreader addreader = new addreader(); addre

21、ader。Show(); this.Close(); private void 借书信息ToolStripMenuItem_Click(object sender, EventArgs e) adminborrow a = new adminborrow(); a.Show(); private void 还书信息ToolStripMenuItem_Click(object sender, EventArgs e) adminborrow a = new adminborrow(); a。Show(); private void 添加图书ToolStripMenuItem_Click(obje

22、ct sender, EventArgs e) addbook a = new addbook(); a.Show(); private void 删除图书ToolStripMenuItem_Click(object sender, EventArgs e) adminearchbook a = new adminearchbook(); a。Show(); private void 查询图书ToolStripMenuItem_Click(object sender, EventArgs e) adminearchbook a = new adminearchbook(); a.Show();

23、 private void 查询出版社信息ToolStripMenuItem_Click(object sender, EventArgs e) publisher a = new publisher(); a。Show(); this。Close(); private void 修改出版社信息ToolStripMenuItem_Click(object sender, EventArgs e) publisher a = new publisher(); a。Show(); this。Close(); private void 查询学生借阅信息ToolStripMenuItem_Click(

24、object sender, EventArgs e) adminborrow a = new adminborrow(); a.Show(); private void toolStripButton6_Click_1(object sender, EventArgs e)/借书信息 booksborrow a = new booksborrow(); a.Show(); private void 添加ToolStripMenuItem_Click(object sender, EventArgs e) readerinfo a = new readerinfo(); a.Show(); p

25、rivate void 删除ToolStripMenuItem_Click(object sender, EventArgs e) deletereader a = new deletereader(); a.Show(); 添加图书信息界面:using System;using System.Collections.Generic;using System。ComponentModel;using System。Data;using System。Drawing;using System.Text;using System。Windows.Forms;using System.Data.Sq

26、lClient;namespace book public partial class addbook : Form public addbook() InitializeComponent(); private void addbook_Load(object sender, EventArgs e) try string sql1 = select booktypename from booktype; SqlCommand command = new SqlCommand(sql1, Dbhelper。connection); Dbhelper.connection。Open(); Sq

27、lDataReader datareader = command。ExecuteReader(); string typename = ; while (datareader。Read() typename = (string)datareader0; comboBox2。Items.Add(typename); datareader.Close(); string sql2 = select publishername from publisher”; SqlCommand command1 = new SqlCommand(sql2, Dbhelper.connection); /Dbhe

28、lper。connection。Open(); SqlDataReader datareader1 = command1。ExecuteReader(); string publishername = ; while (datareader1.Read() publishername = (string)datareader10; /MessageBox。Show(publishername); comboBox1。Items.Add(publishername); datareader1.Close(); catch MessageBox。Show(error”); finally Dbhelper.connection.Close(); private void button2_Click(object sender, EventArgs e) textBox1。Text = null; textBox2。Text = null; textBox4.Text = null; comboBox2.Text = null; comboBox1。Text = null; private string typdid(string a) string id = ”; string sqltypeid = string。Format(”select book

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1