public static int sysLogin(Admin m) { string str = "adminValid"; SqlParameter[] sqlParameter = { new SqlParameter("adminUser",m.AdminUser), new SqlParameter("adminPwd",m.AdminPwd) }; DAL d = new DAL(); return Int32.Parse(d.ExecuteScalar(str, sqlParameter)); }
private void button1_Click(object sender, EventArgs e) { Admin u = new Admin(); u.AdminUser = this.textBox1.Text.ToString(); u.AdminPwd = this.textBox2.Text.ToString(); if(BLL.sysLogin(u) > 0) { this.label3.Text = "登录成功!马上进入管理平台..."; } else { this.label3.Text = "用户或密码错误,请重新输入!"; } }