private void loginButton_Click(object sender, EventArgs e) { //get login details int accountNumber; string accountName; try { accountNumber = int.Parse(accNumField.Text.Trim()); } catch { return; } accountName = accNameField.Text.Trim(); //check login details correct (slow linear search) for (int j = 0; j < test.BankingCustomers.Count; j++) { currentUserLogin = (AccountHolder) test.BankingCustomers[j]; if (currentUserLogin.getName()==accountName && currentUserLogin.getNumber()==(accountNumber)) { Select_Account selectAccount = new Select_Account(this, currentUserLogin.getName()); //create next form with this form as parent. selectAccount.Show(); //clear input feilds for when reloading accNumField.Text = ""; accNameField.Text = ""; this.Hide(); //re-show when we close last form. break;//next form is loaded with this form having saved current customer logged in, stop search. } } }
public Transaction(Select_Account parent, string formNm, string balance, string at) { InitializeComponent(); this.SelectAccParentForm = parent; this.formName = formNm; this.balancedisplayed = balance; this.accountType = at; }
public TransactionHistory(Select_Account parent, string formNm) { InitializeComponent(); this.parentForm = parent; this.formName = formNm; }