第一范文网 - 专业文章范例文档资料分享平台

图书馆管理系统 软件工程

来源:用户分享 时间:2025/5/23 19:36:06 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

}

private void btnLogin_Click(object sender, EventArgs e) {

if (this.Text.Trim() != \ {

if (txtPassWord.Text != \ {

SqlCommand command = CustomDataProvide.GetCommand(

\ \ SqlDataReader dr; try {

command.Connection.Open(); dr = command.ExecuteReader(); dr.Read();

if (dr.HasRows) {

Logintimes = 0;

Main main = new Main();

Main.LoginUser.UserID = dr.GetString(0);

Main.LoginUser .UserName = dr.GetString(1); Main.LoginUser .Password = dr.GetString(2); Main.LoginUser .Isadmin = dr.GetBoolean(3); Main.LoginUser.Day = (Week )dr.GetInt32(4); this.Hide(); main.Show(); dr.Close();

command.Connection.Close(); command.Dispose(); }

else

{ Logintimes++; if (Logintimes == 3)

{ MessageBox.Show(\对不起,你登录的次数 已经超过三次!\警告!\

Application.Exit(); }

if (BookInfoM.ClassCodes.DataValidate.IDExist(\

3/29/2013

UserID from UserInfo where UserID='\ + \

{ MessageBox.Show(\密码不正确\警告!\ txtPassWord.Text = \ } else

{ MessageBox.Show(\此用户ID不存在,请查 证后登录\提示\

combUserID.Text = \ txtPassWord.Text = \ } } }

catch (Exception ex)

{

MessageBox.Show(ex.Message, \提示\MessageBoxIcon.Information); } } else

{ MessageBox.Show(\密码不能为空\提示\ } } else

{ MessageBox.Show(\用户ID不能为空\提示\ } } private void btnExit_Click(object sender, EventArgs e)

{

if (MessageBox.Show(\你确认要退出该程序吗?\

\提示\ == DialogResult.Yes) Application.Exit(); } } }

5.2主界面代码(Main)

namespace BookInfoM {

public partial class Main : Form

{

public Main() {

InitializeComponent(); }

private void 退出ToolStripMenuItem_Click(object sender, EventArgs e) {

Application.Exit(); }

3/29/2013

private void 查询管理员ToolStripMenuItem_Click(object sender, Event Args e)

{ UserManag.ViewAdmin view = new BookInfoM.UserManag. ViewAdmin();

view.Show(); }

private void 注销ToolStripMenuItem_Click(object sender, EventArgs e) {

Login flogin = new Login(); flogin.Show(); this.Close(); }

private void 添加管理员ToolStripMenuItem_Click(object sender, EventArgs e)

{ AddAdmin addadmin = new AddAdmin(); addadmin.Show(); }

private void 修改管理员ToolStripMenuItem_Click(object sender,EventArgs e)

{ ModAdmin modadmin = new ModAdmin(); modadmin.Show(); }

private void 图书查询ToolStripMenuItem_Click(object sender, EventArgs e)

{ SearchBook SeachB = new SearchBook(); SeachB.Show(); }

private void 图书借阅ToolStripMenuItem_Click(object sender, EventArgs e)

{ LendBook LendB = new LendBook(); LendB.Show(); }

private void 图书送还ToolStripMenuItem_Click(object sender, EventArgs e)

{ ReturnBook ReturnB = new ReturnBook();

ReturnB.Show(); }

private void 删除管理员ToolStripMenuItem_Click(object sender,EventArgs e)

{ ModAdmin modadmin = new ModAdmin(); modadmin.Show(); }

private void 库存查询ToolStripMenuItem_Click(object sender,

3/29/2013

EventArgs e)

{ SearchBook SeachB = new SearchBook(); SeachB.Show(); }

private void 新书入库ToolStripMenuItem_Click(object sender, EventArgs e)

{ BookWarehousing BookW = new BookWarehousing(); BookW.Show(); }

private void 帮助ToolStripMenuItem_Click(object sender, EventArgs e)

{ HalpWord HalpW = new HalpWord(); HalpW.Show(); } }

}

5.3图书查询代码(ViewAdmin)

namespace BookInfoM.UserManag {

public partial class ViewAdmin : Form {

public ViewAdmin()

{

InitializeComponent(); }

private void ViewAdmin_Load(object sender, EventArgs e) { txtUserID.Text = BookInfoM.Main.LoginUser.UserID; txtUserName.Text = Main.LoginUser.UserName; txtPassword.Text = \

txtAdmin.Text = Main.LoginUser.Admin;

txtWorkday.Text = Main.LoginUser.Day.ToString(); }

private void btnExit_Click(object sender, EventArgs e) {

this.Close(); }

private void button1_Click(object sender, EventArgs e) {

ModAdmin modadmin = new ModAdmin(); modadmin.Show();

3/29/2013

搜索更多关于: 图书馆管理系统 软件工程 的文档
图书馆管理系统 软件工程.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c5uimr4yluw2xzhu2l5hb_5.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top