资源预览内容
第1页 / 共59页
第2页 / 共59页
第3页 / 共59页
第4页 / 共59页
第5页 / 共59页
第6页 / 共59页
第7页 / 共59页
第8页 / 共59页
第9页 / 共59页
第10页 / 共59页
亲,该文档总共59页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
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 = druname.ToString(); usex = drusex.ToString(); upart = drupart.ToString(); uright = druright.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.权限设置主要代码: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) 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 string11; for (int i = 0; i arr.Count; i+) if (arri.ToString().Trim() = 1) ai = yes; else ai = 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.txtda
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号