Beispiel #1
0
 private void loginButton_Click_1(object sender, EventArgs e)
 {
     if (userNametxt.Text.Trim().Equals("") || passWordtxt.Text.Trim().Equals(""))
     {
         MetroFramework.MetroMessageBox.Show(this, "Please input username/password", "e-Ventory", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         if (dataLib.logInVerification(userNametxt.Text.Trim(), passWordtxt.Text.Trim(), DBConnection.connect()) == true)
         {
             insertStatements.insertLoggedAdmin(DBConnection.connect(), dataLib.getLoggedID(DBConnection.connect(), userNametxt.Text.Trim()), userNametxt.Text.Trim());
             insertStatements.insertSystemLog(DBConnection.connect(), "Log-in", dataLib.loggedAdminName(DBConnection.connect(), dataLib.getLoggedAdminID(DBConnection.connect())), dataLib.currentDateAndTime());
             mainMenu_Form mainObj = new mainMenu_Form();
             this.Hide();
             mainObj.Show();
         }
         else
         {
             MetroFramework.MetroMessageBox.Show(this, "Incorrect username/password", "e-Ventory", MessageBoxButtons.OK, MessageBoxIcon.Error);
             userNametxt.Text = "";
             passWordtxt.Text = "";
             userNametxt.Focus();
         }
     }
 }
Beispiel #2
0
        private void loginButton_Click_1(object sender, EventArgs e)
        {
            mainMenu_Form main_menuObj = new mainMenu_Form();

            this.Hide();
            main_menuObj.Show();
        }