public TransactionItem GetTransactionItem(int transactionItemId) { TransactionItem item = null; if (_transactionItems.ContainsKey(transactionItemId)) { item = _transactionItems[transactionItemId]; } else { throw new Exception("Item does not exist."); } return(item.Clone()); }
public int AddTransactionItem(TransactionItem item) { item.Id = _transactionItemId++; _transactionItems.Add(item.Id, item.Clone()); return(item.Id); }