private void CheckAuthentication(string username, string password) { if (!authenticated && attempts < 3) { var account = CheckCredentials(username, password); var isValid = account != null; if (isValid) { authenticated = true; program.session.CreateSession(account); var homeForm = new UsersForm(program); Visible = false; homeForm.ShowDialog(); this.Close(); } else { attempts++; if (attempts >= 3) { MessageBox.Show("You've reached 3 login attempts!\nExiting now..."); Application.Exit(); } else { MessageBox.Show("Incorrect username or password. Please try again!"); } } } }
private void userManagementToolStripMenuItem_Click(object sender, EventArgs e) { Form UserManagement = new UsersForm(); if (UserManagement.ShowDialog() == DialogResult.OK) { LoadCombos(); } }
private void пользователиToolStripMenuItem_Click(object sender, EventArgs e) { UsersForm myUserForm = new UsersForm(); myUserForm.ShowDialog(); }
private void btnUser_Click(object sender, EventArgs e) { UsersForm frm = new UsersForm(); frm.ShowDialog(); }
private void UsersToolStripMenuItem_Click(object sender, EventArgs e) { UsersForm usersForm = new UsersForm(); usersForm.ShowDialog(); }
private void tbUserManagement_Click(object sender, EventArgs e) { Form form = new UsersForm(_controller.Db); form.ShowDialog(this); }