/// <summary>
        /// Attempts to log the user in, using the dbManager class to conduct operations against the database
        /// </summary>
        /// <param name="db"></param>
        /// <returns></returns>
        public bool attemptLogin(dbManager db)
        {
            DataRow pullrow;
            DataRow lockrow;

            if (parser.Match(uname).Success || parser.Match(pass).Success)
            {
                MessageBox.Show("Username and Password must only contain alphanumerics and underscores!");
                return(false);
            }
            else
            {
                lockrow = db.checkLock(uname);
                if (lockrow != null)
                {
                    if (!bool.Parse(lockrow[0].ToString()))
                    {
                        pullrow = db.getLogin(uname);
                        if (pullrow != null)
                        {
                            if (hs.Comapre(pass, pullrow[0].ToString(), pullrow[1].ToString()))
                            {
                                logged = true;
                                MessageBox.Show("Successfully Logged In!");
                                db.logAttempt(uname, 1);
                                return(true);
                            }
                            else
                            {
                                db.logAttempt(uname, 0);
                                db.increaseLockout(uname);
                                MessageBox.Show("Unable to log in - incorrect password.");
                                return(false);
                            }
                        }
                        else
                        {
                            MessageBox.Show("Unable to log in - database error!");
                            return(false);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Unable to log in - " + uname + " is locked out! Please contact your administrator!");
                        db.logAttempt(uname, 0);
                        return(false);
                    }
                }
                else
                {
                    MessageBox.Show("Unable to log in - incorrect username!");
                    return(false);
                }
            }
        }
 public Main()
 {
     InitializeComponent();
     log = null;
     db  = new MIS677_Team4_LoginScreen_V2.dbManager();
 }