没有合适的资源?快使用搜索试试~ 我知道了~
c#图书管理系统源代码(20211219235349).pdf
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 110 浏览量
2021-12-20
09:17:52
上传
评论
收藏 636KB PDF 举报
温馨提示
试读
50页
c#图书管理系统源代码(20211219235349).pdf
资源推荐
资源详情
资源评论
更多实例访问成功网 www.020chenggong.com
1.登陆界面
主要代码:
public partial class LoginForm : Form{
public static string uacc;
public static string upsw;
public static string uname;
public static string usex;
public static string upart;
public static string uright;
public LoginForm()
{
InitializeComponent();
}
private void loginbtn_Click( object sender, EventArgs e)
{
if ( this .useracctxt.Text.Trim() == "" && this .pswtxt.Text == "" )
{
MessageBox.Show( "请输入您的用户名和密码! " , "提示! " );
return ;
}
try
{
string sql;
sql = "select * from tb_user where uacc='" + this .useracctxt.Text + "' and upsw='"
+ this .pswtxt.Text + "'" ;
OleDbDataReader dr = DBHelp.OleReader(sql);
dr.Read();
if (dr.HasRows)
{
uacc = this .useracctxt.Text;
upsw = this .pswtxt.Text;
uname = dr[ "uname"].ToString();
更多实例访问成功网 www.020chenggong.com
usex = dr[ "usex" ].ToString();
upart = dr[ "upart" ].ToString();
uright = dr[ "uright" ].ToString();
MainForm af = new MainForm( this );
this .Hide();
this .useracctxt.Clear();
this .pswtxt.Clear();
af.Show();
}
else
{
MessageBox.Show( "账号或密码错误! " , " 提示! " );
this .useracctxt.Clear();
this .pswtxt.Clear();
this .useracctxt.Focus();
}
}
catch ( Exception )
{
MessageBox.Show( "数据库无法连接! " , "警告! " );
}
}
private void cancelbtn_Click( object sender, EventArgs e)
{
Application .Exit();
}
private void LoginForm_Closing( object sender, FormClosingEventArgs e)
{
Application .Exit();
}
}
2. 主界面(图较小,自己可以拉大点)
主要代码就不写了,很简单。
3. 权限设置
更多实例访问成功网 www.020chenggong.com
主要代码:
public partial class RightSet : Form
{
public RightSet()
{
InitializeComponent();
}
private void RightSet_Load( object sender, EventArgs e)
{
this .rightbox.SelectedIndex = 0;
//this.treeright.ExpandAll();
Fill();
}
private void okbtn_Click( object sender, EventArgs e)
{
if ( this .txtnum.Text == string .Empty)
{
MessageBox.Show( "请输入最大借阅图书数量! " , "提示! " );
return ;
}
if ( this .txtday.Text == string .Empty)
{
MessageBox.Show( "请输入最大借阅图书时间! " , "提示! " );
return ;
}
if ( this .txtcost.Text == string .Empty)
{
更多实例访问成功网 www.020chenggong.com
MessageBox.Show( "请输入借书押金金额! " , " 提示! " );
return ;
}
if ( this .txtfine.Text == string .Empty)
{
MessageBox.Show( "请输入超期罚款金额! " , " 提示! " );
return ;
}
if ( this .txttim.Text == string .Empty)
{
MessageBox.Show( "请输入图书遗失罚款倍数! " , "提示! " );
return ;
}
ArrayList arr = new ArrayList ();
foreach ( TreeNode nodes in this .treeright.Nodes)
{
if (nodes.Checked)
{
arr.Add( "1" );
}
else
{
arr.Add( "0" );
}
foreach ( TreeNode node in nodes.Nodes)
{
if (node.Checked)
{
arr.Add( "1" );
}
else
{
arr.Add( "0" );
}
}
}
string [] a= new string [11];
for ( int i = 0; i < arr.Count; i++)
{
if (arr[i].ToString().Trim() == "1" )
{
a[i] = "yes" ;
更多实例访问成功网 www.020chenggong.com
}
else
{
a[i] = "no" ;
}
}
string sql = string .Empty;
sql += "select * from tb_right where uright='" + this .rightbox.Text + "'" ;
DataTable dt = DBHelp.ExeOleCommand(sql);
bool b = false ;
while (dt.Rows.Count != 0)
{
b = true ;
break ;
}
string sql1;
if (b)
{
sql1 = "update tb_right set " ;
sql1 += "maxbook='" + this .txtnum.Text + "'," ;
sql1 += "maxdate='" + this .txtday.Text + "'," ;
sql1 += "rcost='" + this .txtcost.Text + "'," ;
sql1 += "rfine='" + this .txtfine.Text + "'," ;
sql1 += "rtim='" + this .txttim.Text + "'," ;
sql1 += "rbm='" + a[0] + "'," ;
sql1 += "rum='" + a[1] + "'," ;
sql1 += "rrm='" + a[2] + "'," ;
sql1 += "rborm='" + a[3] + "'," ;
sql1 += "ris='" + a[4] + "'," ;
sql1 += "rbis='" + a[5] + "'," ;
sql1 += "ruis='" + a[6] + "'," ;
sql1 += "rboris='" + a[7] + "'," ;
sql1 += "rblp='" + a[8] + "'," ;
sql1 += "rbl='" + a[9] + "'," ;
sql1 += "rlp='" + a[10] + "' " ;
sql1 += "where uright='" + this .rightbox.Text + "'" ;
}
else
{
剩余49页未读,继续阅读
资源评论
屈子1
- 粉丝: 15
- 资源: 7万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 【后端开发框架】基于PHP的产品报价系统的设计与开发
- 基于C#开发的OPCServer与PLC连接程序+源码
- 三个后端开发项目-基于springboot-内容管理和秒杀系统.zip
- redis-win-2.8.9,redis-win-2.8.9
- 基于django+front+mysql的用户信息管理系统
- Servlet和JDBC实现三层架构
- Appium-Inspector-2024.6.1-win
- Screenshot_2024-06-14-21-22-39-202_net.csdn.csdnplus.jpg
- Appium-Server-GUI-windows-1.22.3-4
- 基于C语言+python实现的永磁同步电机矢量控制算法仿真+源码(毕业设计&课程设计&项目开发)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功