Example #1
0
        private void ParseLine(string line)
        {
            TransactionStrings data = new TransactionStrings(splitCsv(line));

            AddAnyNewAccounts(data.GetSender(), data.GetRecipient());
            AddNewTransaction(data, lineCounter);
        }
Example #2
0
        protected void AddNewTransaction(TransactionStrings data, int entry)
        {
            try
            {
                Date    date      = new Date(data.GetDate());
                Account sender    = accounts.GetAccount(data.GetSender());
                Account recipient = accounts.GetAccount(data.GetRecipient());
                Money   amount    = new Money(data.GetAmount());

                Transaction transaction = new Transaction(date, sender, recipient, data.GetNarrative(), amount);
                transactions.AddTransaction(transaction);
            }
            catch (ArgumentException ae)
            {
                WriteErrorToConsoleFirstTime();
                LogBadFormatTransaction(entry, ae.Message);
            }
        }
Example #3
0
 private void ParseEntry(TransactionStrings data, int entryNumber)
 {
     AddAnyNewAccounts(data.GetSender(), data.GetRecipient());
     AddNewTransaction(data, entryNumber);
 }