private static void AuthenticateResearcher(string username, string password) { Researcher researcher = Researcher.Authenticate(username, password); if (researcher == null) { System.Console.WriteLine("error: user could not be authenticated"); return; } System.Console.WriteLine("OK: user authenticated"); }
private void SubmitForm() { Cursor.Current = Cursors.WaitCursor; Researcher authenticatedResearcher = Researcher.Authenticate(txtUsername.Text, txtPassword.Text); IsUserAuthenticated = true; if (authenticatedResearcher == null) { MessageBox.Show("Invalid username or password.", "Login failed"); txtUsername.Focus(); return; } Close(); }