Example #1
0
        private void loginBtn_Click(object sender, EventArgs e)
        {
            //gets the username and password then calls method to check it against the database
            string username = usrnameTxtBox.Text.ToString();
            string password = passwdTxtBox.Text.ToString();

            int userID = dbWorker.checkForUserToLogin(username, password);

            //db worker will return -1 if user is not in the db
            if (userID != -1)
            {
                SelectLinkPage selectPage = new SelectLinkPage();
                selectPage.UsrID = userID;
                selectPage.Show();
                this.Hide();
                selectPage.FormClosing += selectPage_FormClosing;
                usrnameTxtBox.Clear();
                passwdTxtBox.Clear();
            }
            else
            {
                MessageBox.Show("Username or Password invalid");
            }
        }
Example #2
0
        private void loginBtn_Click(object sender, EventArgs e)
        {
            //gets the username and password then calls method to check it against the database
            string username = usrnameTxtBox.Text.ToString();
            string password = passwdTxtBox.Text.ToString();

            int userID = dbWorker.checkForUserToLogin(username, password);

            //db worker will return -1 if user is not in the db
            if (userID != -1)
            {
                SelectLinkPage selectPage = new SelectLinkPage();
                selectPage.UsrID = userID;
                selectPage.Show();
                this.Hide();
                selectPage.FormClosing += selectPage_FormClosing;
                usrnameTxtBox.Clear();
                passwdTxtBox.Clear();
            }
            else
            {
                MessageBox.Show("Username or Password invalid");
            }
        }