private void Login() { string user = txtUserName.Text; string pass = txtPassword.Text; UsersBUS u = new UsersBUS(); if (u.Login(user, pass) == true) { //MessageBox.Show("Login Success"); this.DialogResult = MessageBox.Show("Đăng nhập thành công"); } else { //MessageBox.Show("Login Failed"); string msg = "Thông tin đăng nhập không đúng, bạn có muốn thử lại?"; DialogResult result = MessageBox.Show(msg, "Login", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); if (result == DialogResult.Retry) { txtUserName.Text = " "; txtPassword.Text = " "; txtUserName.Focus(); } else { this.DialogResult = DialogResult.Cancel; } } }
private void btnLogin_Click(object sender, EventArgs e) { string user = txtUser.Text; string pass = txtPassword.Text; UsersBUS u = new UsersBUS(); if (u.Login(user, pass) == true) { MessageBox.Show("Dang nhap thanh cong"); } else { MessageBox.Show("Dang nhap khong thanh cong"); } }
private void btnLogin_Click(object sender, EventArgs e) { string user = txtUser.Text; string pass = txtPass.Text; UsersBUS u = new UsersBUS(); if (u.Login(user, pass) == true) { MessageBox.Show("Đăng nhập thành công!"); this.DialogResult = DialogResult.OK; //this.Close(); frmMenu frmMe = new frmMenu(); frmMe.Show(); } else { DialogResult result = MessageBox.Show("Sai thông tin", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error); if (result == DialogResult.OK) { txtUser.Focus(); } } }