Esempio n. 1
0
 public bool Add(Transaction transaction)
 {
     if (transaction != null && _transactionList.IndexOf(transaction) == -1)
     {
         _transactionList.Add(transaction);
         return true;
     }
     return false;
 }
Esempio n. 2
0
        private bool IsShortTerm(Transaction transaction)
        {
            DateTime sellDate;
            DateTime buyDate;
            if (this.Date.CompareTo(transaction.Date) > 0)
            {
                sellDate = Date;
                buyDate = transaction.Date;
            }
            else
            {
                buyDate = Date;
                sellDate = transaction.Date;
            }

            return sellDate.Subtract(buyDate).Days < NUMBER_OF_DAYS_IN_YEAR;
        }
Esempio n. 3
0
 public void addTransaction(Transaction transaction)
 {
     _transactionList.Add(transaction);
 }