public static Account Register(string name, string email, string pass, typeOfAcc type, decimal bal) { //initialize customer and account to null Customer cus = null; Account acc = null; //create Customer cus = new Customer(name, email, pass); //create Account acc = new Account(cus.Id, type, bal); //update Customer and account lists; Bank.allCustomers.Add(cus); Bank.allAccounts.Add(acc); //create transaction var tr = new Transaction(acc.number, bal, "Opening balance", type.ToString(), DateTime.Now); //update transaction list; Bank.allTransactions.Add(tr); //Begin session new utility().createSession(cus.Id, cus.Name, cus.Email, acc.number); status = true; return(acc); }
public Account(string ownerID, typeOfAcc accType, decimal startUp) { seed += _numberOfAccounts(); number = seed.ToString(); OwnerID = ownerID; this.AccType = accType; Transactions = new List <Transaction>(); date = DateTime.Now; }