private void KeyEnterLogin() { User u = new User(); //u.isAdmin(); //u.isAdministrator(); u.getCashierIDfromDB(); try { if (u.isAuth(txtBoxCashierUser.Text, txtBoxPass.Text)) { this.Hide(); frmMain fm = new frmMain(); fm.Show(); } else result = MessageBox.Show("Username and Password Incorrect or Not Completed", "Login Error", btn, MessageBoxIcon.Error); //clearText(); } catch (Exception) { result = MessageBox.Show(loginpop, caption, btn, icon); } }
private void KeyEnterLogin() { User u = new User(txtBoxCashierUser.Text); //try // { if (u.isAuth(txtBoxCashierUser.Text.Trim(), txtBoxPass.Text.Trim())) { currentUser = u; this.Hide(); frmMain fm = new frmMain(); if (u.isAdmin()) { fm.isnotAdmin(); } fm.Show(); } else result = MessageBox.Show("Username and Password Incorrect or Not Completed", "Login Error", btn, MessageBoxIcon.Error); //} //catch (Exception) //{ // result = MessageBox.Show(loginpop, caption, btn, icon); // } }