public void Save(AccountInformation account) { string filename = StorageFilePath(account.Key); StreamWriter file = new StreamWriter(filename); file.WriteLine(account.Key); file.WriteLine(account.AccountBalance.ToString("N3")); file.Close(); }
private void ShowAccountInfo(bool show) { if (show) { if (programManager.SessionAlive) { Session session = programManager.CurrentSession; User user = session.User; AccountInformation account = session.AccountInfo; welcomeLbl.Text = "Welcome " + user.Fullname + " !!"; balanceValueLbl.Text = account.FormattedAccountBalance; } } else { welcomeLbl.Text = "Welcome guest!"; balanceValueLbl.Text = "N/A"; } }
private AccountInformation LoadFromFile(string filename) { AccountInformation account = new AccountInformation(); if (File.Exists(filename)) { StreamReader file = new StreamReader(filename); account.SetID(file.ReadLine()); account.SetBalance(file.ReadLine()); account.Activate(); file.Close(); Console.WriteLine($"Loaded account details for {account.Key}"); } else { Console.WriteLine("File not found: " + filename); } return(account); }
public AccountInformationLoggable(AccountInformation accountInfo) { this.accountInfo = accountInfo; }
private void UpdateBalance() { AccountInformation account = programManager.CurrentSession.AccountInfo; balanceValueLbl.Text = account.FormattedAccountBalance; }
public BankingSystem(AccountInformation account) { _account = account; }