Beispiel #1
0
        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();
        }
Beispiel #2
0
        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";
            }
        }
Beispiel #3
0
        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;
 }
Beispiel #5
0
        private void UpdateBalance()
        {
            AccountInformation account = programManager.CurrentSession.AccountInfo;

            balanceValueLbl.Text = account.FormattedAccountBalance;
        }
Beispiel #6
0
 public BankingSystem(AccountInformation account)
 {
     _account = account;
 }