public void Add(CCustomer oCustomer) { _mCustomers.Add(oCustomer); }
// 'loads' sample data, hardcoded private void Populate() { // CCust1 DateTime Date = new DateTime(1980, 5, 6); CCustomer oCustomer = new CCustomer("1", "555-66-7788", "Bob", "Smith", Date); // CCust1 transactions CTransaction oTrans = new CTransaction(Guid.NewGuid(), 100, DateTime.Today, TransactionType.Deposit); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 567, DateTime.Today, TransactionType.Deposit); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 345, DateTime.Today, TransactionType.Deposit); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 546, DateTime.Today, TransactionType.Withdrawal); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 765, DateTime.Today, TransactionType.Withdrawal); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 1234, DateTime.Today, TransactionType.Withdrawal); oCustomer.AddTransaction(oTrans); oTrans = null; // add CCust1 Add(oCustomer); oCustomer = null; // CCust2 Date = new DateTime(1990, 6, 20); oCustomer = new CCustomer("2", "222-33-4455", "Stan", "Cleveland", Date); // CCust2 transactions oTrans = new CTransaction(Guid.NewGuid(), 765, DateTime.Today, TransactionType.Deposit); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 654, DateTime.Today, TransactionType.Deposit); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 432, DateTime.Today, TransactionType.Deposit); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 765, DateTime.Today, TransactionType.Withdrawal); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 234, DateTime.Today, TransactionType.Withdrawal); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 845, DateTime.Today, TransactionType.Withdrawal); oCustomer.AddTransaction(oTrans); oTrans = null; // add CCust2 Add(oCustomer); oCustomer = null; // CCust3 Date = new DateTime(2000, 10, 30); oCustomer = new CCustomer("3", "555-66-2233", "Sam", "Banks", Date); // CCust3 transactions oTrans = new CTransaction(Guid.NewGuid(), 987, DateTime.Today, TransactionType.Deposit); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 654, DateTime.Today, TransactionType.Deposit); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 234, DateTime.Today, TransactionType.Deposit); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 435, DateTime.Today, TransactionType.Withdrawal); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 231, DateTime.Today, TransactionType.Withdrawal); oCustomer.AddTransaction(oTrans); oTrans = null; oTrans = new CTransaction(Guid.NewGuid(), 154, DateTime.Today, TransactionType.Withdrawal); oCustomer.AddTransaction(oTrans); oTrans = null; // add CCust3 Add(oCustomer); oCustomer = null; }