예제 #1
0
        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!");
                    }
                }
            }
        }
예제 #2
0
        private void userManagementToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form UserManagement = new UsersForm();

            if (UserManagement.ShowDialog() == DialogResult.OK)
            {
                LoadCombos();
            }
        }
예제 #3
0
        private void пользователиToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UsersForm myUserForm = new UsersForm();

            myUserForm.ShowDialog();
        }
예제 #4
0
 private void btnUser_Click(object sender, EventArgs e)
 {
     UsersForm frm = new UsersForm();
     frm.ShowDialog();
 }
예제 #5
0
        private void UsersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UsersForm usersForm = new UsersForm();

            usersForm.ShowDialog();
        }
예제 #6
0
        private void tbUserManagement_Click(object sender, EventArgs e)
        {
            Form form = new UsersForm(_controller.Db);

            form.ShowDialog(this);
        }