private void AddClient_FormClosed(object sender, FormClosedEventArgs e) { //we've done this enough times i think you know what it is this.Hide(); AdminControls f = new AdminControls(this.client); f.Show(); }
private void addAccount_FormClosed(object sender, FormClosedEventArgs e) { //shows AdminControls form when current is closed this.Hide(); AdminControls f = new AdminControls(this.client); f.Show(); }
private void btnConfirm_Click(object sender, EventArgs e) { //storing TextBox values string adminUser = tbUser.Text; string adminPass = tbPass.Text; string adminUserCheck = "Admin"; string adminPassCheck = "Adminpass"; bool checkAdmin = ((adminUser == adminUserCheck) && (adminPass == adminPassCheck)) ? true : false; if ((checkAdmin) && (count < 3)) { //shows that you logged in via message box //hides current form and loads AdminControls MessageBox.Show("Logged in as ADMIN"); this.Hide(); AdminControls form2 = new AdminControls(this.client); form2.ShowDialog(); } else { //resets the text boxes count++; MessageBox.Show("Error with credentials"); tbUser.Text = String.Empty; tbPass.Text = String.Empty; if (count == 3) { MessageBox.Show("You have run out of login attemps. Please try again later."); Application.Exit(); } } }