// Enter button private void Button1_Click(object sender, EventArgs e) { string accountNumInput = txtAccountNumber.Text; string pinInput = txtPIN.Text; bool successfulLogin = false; foreach (var account in Business_Layer.Bank.listOfAccounts) { if (accountNumInput == account.AccountNb && pinInput == account.Pin) { Bank.SearchForAccount(account.AccountNb); // Sets the correct account for to be used by the ATM after login successfulLogin = true; this.Hide(); Presentation_Layer.MainMenu mm = new Presentation_Layer.MainMenu(); mm.Visible = true; } } if (successfulLogin == false) { MessageBox.Show("Incorrect PIN!"); txtAccountNumber.Clear(); txtPIN.Clear(); txtAccountNumber.Focus(); } }
private void BtnMainMenu_Click(object sender, EventArgs e) { this.Hide(); MainMenu mm = new MainMenu(); mm.Visible = true; }