public bool Add(Transaction transaction)
 {
     if (transaction != null && _transactionList.IndexOf(transaction) == -1)
     {
         _transactionList.Add(transaction);
         return true;
     }
     return false;
 }
Exemple #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;
        }
 public void addTransaction(Transaction transaction)
 {
     _transactionList.Add(transaction);
 }