Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string username = txtUsername.Text;
            string password = txtPassword.Text;

            User user = dbController.authenticateUser(username, password);

            if (user != null && user.getUserLevel() == UserLevel.ADMIN)
            {
                selectedResult = DialogResult.OK;
            }
            else
            {
                selectedResult = DialogResult.Cancel;
            }

            Close();
        }
Example #2
0
 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
 {
     user = dbController.authenticateUser(Username, Password);
     backgroundWorker1.ReportProgress(100);
 }