private void buttonX1_Click(object sender, EventArgs e) { ManagerInfo mi = new ManagerInfo(); mi.MName = textBoxX1.Text; mi.MPwd = textBoxX2.Text; ManagerInfoBLL bll = new ManagerInfoBLL(); if (bll.Login(mi)) { DialogResult res = MessageBox.Show("登录成功!", "提示", MessageBoxButtons.OK); if (res == DialogResult.OK) { FormMain main = new FormMain(); main.Tag = mi.MType; main.Show(); this.Visible = false; } } else { MessageBox.Show("登录失败1!"); } ; }
private void btnLogin_Click(object sender, EventArgs e) { int type = -1; string name = txtName.Text; string pwd = txtPwd.Text; if (miBll.Login(name, pwd, out type)) { frmMain frmMain = new frmMain(type); this.Hide(); frmMain.Show(); } else { MessageBox.Show("用户名或密码错误!"); } }