1、LoginForm()lnitializeComponent();private void loginbtn_Click( object sender, EventArgs e)if ( this .useracctxt.Text.Trim() = & this .pswtxt.Text = )MessageBoxShow(”请输入您的用户名和密码! ,提示! ”);return ;trystring sql;and upsw=sql = select * from tb_user where uacc= + this .useracctxt.Text + this .pswtxt.Text
2、+ ;OleDbDataReader dr = DBHelpOleReader(sql);dr.Read();if (dr.HasRows)uacc =upsw = uname = drthis .useracctxt.Text;this .pswtxt.Text;uname.ToString();upart = dr upart .ToString();uright = dr urightMainForm af = new MainForm( this );this .Hide();this .useracctxt.Clear();this .pswtxt.Clear();af.Show()
3、;elseMessageBoxShow(”账号或密码错误!this .useracctxt.Focus();catch ( Exception )MessageBoxShow(”数据库无法连接!,警告!);private void cancelbtn_Click( object sender, EventArgs e)Application .Exit();private void LoginForm_Closing( object sender, FormClosingEventArgs e)2.主界面(图较小,自己可以拉大点)田社管理系统主要代码就不写了,很简单3.权限设置主要代码:pub
4、lic partial class RightSet : Formpublic RightSet()private void RightSet_Load( object sender, EventArgs e) this .rightbox.Selectedlndex = 0;this.treeright.ExpandAII();Fill();private void okbtn_Click( object sender, EventArgs e)if ( this .txtnum.Text = string .Empty)MessageBoxShow(”请输入最大借阅图书数量!,”提示! ”
5、);if ( this .txtday.Text = string .Empty)MessageBoxShow(”请输入最大借阅图书时间!if ( this .txtcost.Text = string .Empty)MessageBoxShow(”请输入借书押金金额!if ( this .txtfine.Text = string .Empty)MessageBoxShow(”请输入超期罚款金额!if ( this .txttim.Text = string .Empty)MessageBoxShow(”请输入图书遗失罚款倍数!ArrayList arr = new ArrayList ()
6、;foreach ( TreeNode nodes in this .treeright.Nodes)if (nodes.Checked)arr.Add( 1);0foreach (TreeNode node in nodes.Nodes)if (node.Checked)arr.Add(string a= new string 11;for ( int i = 0; i where uright=+ this .rightbox.Textsqll = insert intotb_right(uright,maxbook,maxdate,rcost,fine,rtim,rbm,rum,rrm,
7、rborm,ris,rbis,ruis,rboris,rblp,rbl,rlp)DataTable dt1 = DBHelp.ExeOleCommand(sql1);private void Fill()select rid as ID号,uright as 用户身份,maxbook as 最大借书数量,maxdate as 最大借阅时间,rcost as 押金,rfine as 超期罚率,rtim as 遗失赔率,rbm as 图书管理,rum as 用户管理,rrm as 权限管理,rborm as 借阅管理,ris as 信息查询,rbis as 图书信息查询,ruis as 用户信息查
8、询,rboris as借阅历史查询,rblp as图书挂失处理,rbl as图书挂失,rlp as挂失处理from tb_rightthis .dataGridView1.DataSource = dt;private void cell_click( object sender, DataGridViewCellEventArgs e)this .dataGridView1.CurrentCell.Rowlndex.Value.ToString().Trim();this .txtnum.Text = this .dataGridView12,this .txtday.Text = this .dataGridView13,this .txtcost.Text = this .dataGridView14,this .txtfine.Text = this .dataGridView15,this .txttim.Text = this .dataGridView16,this .dataGridView1.CurrentCell.Rowlndex.Value.T
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1