private void btnlogin_Click(object sender, EventArgs e) { if (this.txtName.Text.Trim()==string.Empty||this.txtPwd.Text.Trim()==string.Empty) { MessageBox.Show("用户名或密码不能为空!"); return; } if (this.radioButton1.Checked) { //校长助理登陆 viser.AdminName = this.txtName.Text.Trim(); viser.AdminPwd = this.txtPwd.Text.Trim(); bool ret= Vim.login_admin(viser);//调用数据库 if (ret) { MessageBox.Show("登陆成功!"); this.Dispose(); return; } else { MessageBox.Show("登陆失败!"); return; } } //财务人员登陆 if (this.radioButton2.Checked) { mon.Moneyname= this.txtName.Text.Trim(); mon.MoneyPwd = this.txtPwd.Text.Trim(); bool ret = monM.login_money(mon); if (ret) { MessageBox.Show("登陆成功!"); moneyForm monf = new moneyForm(); monf.ShowDialog(); monf.Dispose(); return; } else { MessageBox.Show("登陆失败!"); return; } } //家长 if (this.radioButton3.Checked) { par.Name = this.txtName.Text.Trim(); par.Pwd = this.txtPwd.Text.Trim(); bool ret = parm.loinpar(par); if (ret) { MessageBox.Show("登陆成功!"); studentcheck monf = new studentcheck(); monf.ShowDialog(); monf.Dispose(); return; } else { MessageBox.Show("登陆失败!"); return; } } }
private void btnlogin_Click(object sender, EventArgs e) { if (this.txtName.Text.Trim() == string.Empty || this.txtPwd.Text.Trim() == string.Empty) { MessageBox.Show("用户名或密码不能为空!"); return; } if (this.radioButton1.Checked) { //校长助理登陆 viser.AdminName = this.txtName.Text.Trim(); viser.AdminPwd = this.txtPwd.Text.Trim(); bool ret = Vim.login_admin(viser);//调用数据库 if (ret) { MessageBox.Show("登陆成功!"); this.Dispose(); return; } else { MessageBox.Show("登陆失败!"); return; } } //财务人员登陆 if (this.radioButton2.Checked) { mon.Moneyname = this.txtName.Text.Trim(); mon.MoneyPwd = this.txtPwd.Text.Trim(); bool ret = monM.login_money(mon); if (ret) { MessageBox.Show("登陆成功!"); moneyForm monf = new moneyForm(); monf.ShowDialog(); monf.Dispose(); return; } else { MessageBox.Show("登陆失败!"); return; } } //家长 if (this.radioButton3.Checked) { par.Name = this.txtName.Text.Trim(); par.Pwd = this.txtPwd.Text.Trim(); bool ret = parm.loinpar(par); if (ret) { MessageBox.Show("登陆成功!"); studentcheck monf = new studentcheck(); monf.ShowDialog(); monf.Dispose(); return; } else { MessageBox.Show("登陆失败!"); return; } } }