public void ProcessLogin() { DangNhap dn = new DangNhap(); int result; result = dn.Check_User(txtTenDangNhap.TextName, txtMatKhau.TextName); if (result == 99) { MessageBox.Show("Sai "); return; } else if (result == 100) { MessageBox.Show("Tài khoản bị khóa"); return; } this.Visible = false; // xu li luu tai khoan mat khau, khi check vao checkbox if (checkBox1.Checked) { Properties.Settings.Default.user = txtTenDangNhap.TextName; Properties.Settings.Default.pass = txtMatKhau.TextName; Properties.Settings.Default.checkbox = 1; Properties.Settings.Default.Save(); } else { Properties.Settings.Default.user = ""; Properties.Settings.Default.pass = ""; Properties.Settings.Default.checkbox = 0; Properties.Settings.Default.Save(); } // xu li truyen du lieu ma nhom qua frm main dataGridView1.DataSource = dn.kiemTraTenDangNhap(txtTenDangNhap.TextName); string manhom = dataGridView1.CurrentRow.Cells[2].Value.ToString(); frmMain frmmain = new frmMain(txtTenDangNhap.TextName, txtMatKhau.TextName, manhom); this.Hide(); frmmain.ShowDialog(); }
public void ProcessLogin() { int result; result = dn.Check_User(txtUser.Text, txtPass.Text); if (result == 1000) { MessageBox.Show("Sai " + lblUsername.Text + " or " + lblPass.Text); return; } else if (result == 2000) { MessageBox.Show("Tai khoan bi khoa !!"); return; } LuuThongTin.tendn = txtUser.Text.Trim(); frmMain frm = new frmMain(); frm.Show(); }