private void button1_Click(object sender, EventArgs e) { this.Hide(); stuinfo f8 = new stuinfo(); f8.usernamebb(bb); f8.Show(); }
private void button1_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(textBox1.Text) || String.IsNullOrEmpty(textBox2.Text)) { MessageBox.Show("用户名或者密码不能为空!"); } else { if (radioButton1.Checked == true) { Users user1 = new Users(); DataSet ds = new DataSet(); DAL dall = new DAL(); //实例化 user1.userName = textBox1.Text; user1.userPass = textBox2.Text; user1.user_power = "1"; ds = dall.login(user1); if (ds.Tables[0].Rows.Count > 0) { this.Hide(); stumanage f2 = new stumanage(); f2.Show(); } else { MessageBox.Show("管理员中不存在此用户或者用户名密码输入错误,请重新输入"); } } if (radioButton2.Checked == true) { Users user1 = new Users(); DataSet ds = new DataSet(); DAL dall = new DAL(); user1.userName = textBox1.Text; user1.userPass = textBox2.Text; user1.user_power = "0"; ds = dall.login(user1); if (ds.Tables[0].Rows.Count > 0) { this.Hide(); stuinfo f8 = new stuinfo(); f8.usernamebb(textBox1.Text); f8.Show(); } else { MessageBox.Show("学生中不存在此用户或者用户名密码输入错误,请重新输入"); } } } }