public void addAcc(int index) { if (index != -1) { Customer c = Customers[index]; Account a = new Account(0, 0, "account nr: " + c.Accounts.Count.ToString()); c.Accounts.Add(a); lbAccounts.Items.Clear(); for (int i = 0; i < c.Accounts.Count; i++) { lbAccounts.Items.Add(c.Accounts[i].Name + " " + c.Accounts[i].Money + "$ " + c.Accounts[i].IRate + "%"); } } else { MessageBox.Show("Must select a customer first"); } }
public void DelAccount(Customer c, Account a) { c.Accounts.Remove(a); }
public void AddAccount(Customer c,Account a) { c.Accounts.Add(a); }