I am using C#, Visual Studio 2015.
How do I add these two accounts (same person) from the form load?
Example Data to add:
Bob Smith 1/1/1970 (account):123456 (balance):$5000 and (account):222222 and (balance):$3000?
Here is part of the BankAccount class:
public int AccountNumber { get; private set; }
public double Balance { get; private set; }
public BankAccount()
{
this.AccountNumber = generateAccountNumber();
this.Balance = 0;
}
public BankAccount(Wallet accounts)
{
this.AccountNumber = generateAccountNumber();
this.Balance = 0;
this.AccountNumber = Convert.ToInt16(accounts.AccountList);
}
public BankAccount(double beginningBalance)
{
Balance = beginningBalance;
}
private int generateAccountNumber()
{
Random numGenerator = new Random();
//Requirement: 6 digit account number, cannot start with zero
return numGenerator.Next(100000, 999999);
}
and this is some of the Wallet class:
private string firstName;
private string lastName;
private DateTime birthDate;
private List<BankAccount> accountList = new List<BankAccount>();
public Wallet(string firstName, string lastName, DateTime birth, List<BankAccount> Account)
{
this.firstName = firstName;
this.lastName = lastName;
this.birthDate = birth;
this.accountList = Account;
}
public List<BankAccount> AccountList
{
get { return accountList; }
set { accountList = value; }
}
QUESTION: How do I create two accounts (from same person) to already be there?
this.AccountNumber = Convert.ToInt16(accounts.AccountList);