private static void displayTransactionLog(Dictionary <string, string> args) { Account account; long accountNumber = Convert.ToInt64(args["accountNumber"]); string cacheKey; if (AccountManager.AccountExists(accountNumber)) { account = AccountManager.GetAccount(accountNumber); cacheKey = account.UserName + "/" + account.Password; if (Cache.Exists(cacheKey)) { Cache.Set(cacheKey, account, 30); displayTransactions(account); return; } else { Console.WriteLine("Account is not logged in."); } } else { Console.WriteLine("Account does not exist."); } return; }
public static double?Balance(Dictionary <string, string> args) { Account account; long accountNumber = Convert.ToInt64(args["accountNumber"]); string cacheKey; if (AccountManager.AccountExists(accountNumber)) { account = AccountManager.GetAccount(accountNumber); cacheKey = account.UserName + "/" + account.Password; if (Cache.Exists(cacheKey)) { Cache.Set(cacheKey, account, 30); return(account.Balance); } else { Console.WriteLine("Account is not logged in."); } } else { Console.WriteLine("Account does not exist."); } return(null); }