private void btnCreate_Click(object sender, EventArgs e) { try { AccountBankManagement.Bank newBank = new AccountBankManagement.Bank(txtBankName.Text, (int)upDownMaxNoAccount.Value); BankControl OpenBank = new BankControl(newBank); OpenBank.ShowDialog(); this.Close(); } catch (Exception CreateBankProb) { MessageBox.Show(CreateBankProb.Message, "Error: Creating Bank", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnLoadBank_Click(object sender, EventArgs e) { try { AccountBankManagement.Bank newBank = AccountBankManagement.Bank.Load(txtBankFilePath.Text); BankControl OpenBank = new BankControl(newBank); OpenBank.ShowDialog(); this.Close(); } catch (Exception FileOpenProblem) { MessageBox.Show(FileOpenProblem.Message, "Error: Loading Bank From File", MessageBoxButtons.OK, MessageBoxIcon.Error); } }