public bool Update(Transaction transaction)
        {
            if (transaction == null) return false;

            var oldTransaction = MainData.Transactions.First(trans => trans.TransactionId == transaction.TransactionId);
            oldTransaction.Action = transaction.Action;
            oldTransaction.Amount = transaction.Amount;
            oldTransaction.Date = transaction.Date;
            oldTransaction.ActionDate = transaction.ActionDate;
            oldTransaction.Note = transaction.Note;

            return true;
        }
 public bool Insert(Transaction transaction)
 {
     if (transaction == null) return false;
     MainData.Transactions.Add(transaction);
     return true;
 }