private void button2_Click(object sender, EventArgs e) { bool IsCorrect = true; if (textBox1.Text.Length == 0) { MessageBox.Show("账号不可为空", "", MessageBoxButtons.OK); IsCorrect = false; } else if (textBox2.Text.Length == 0) { MessageBox.Show("密码不可为空", "", MessageBoxButtons.OK); IsCorrect = false; } if (IsCorrect == true) { admin=new BLL_Administrator(this.textBox1.Text,this.textBox2.Text); if (admin.ReturnIfLogged()==1) { this.Hide(); ManLogged mlogged = new ManLogged(); mlogged.Show(); } else { MessageBox.Show("用户名或密码错误"); this.textBox1.Clear(); this.textBox2.Clear(); } } }
private void button2_Click(object sender, EventArgs e) { bool IsCorrect = true; if (textBox1.Text.Length == 0) { MessageBox.Show("账号不可为空", "", MessageBoxButtons.OK); IsCorrect = false; } else if (textBox2.Text.Length == 0) { MessageBox.Show("密码不可为空", "", MessageBoxButtons.OK); IsCorrect = false; } if (IsCorrect == true) { admin = new BLL_Administrator(this.textBox1.Text, this.textBox2.Text); if (admin.ReturnIfLogged() == 1) { this.Hide(); ManLogged mlogged = new ManLogged(); mlogged.Show(); } else { MessageBox.Show("用户名或密码错误"); this.textBox1.Clear(); this.textBox2.Clear(); } } }