ExcelTransactionExtended GetNewGroupedTransaction(ExcelTransactionExtended currentTransaction, DateTime endDate) { return(new ExcelTransactionExtended() { AccountingDate = endDate, Sum = currentTransaction.Sum, Currency = currentTransaction.Currency, GroupId = currentTransaction.GroupId, TagNames = currentTransaction.TagNames, TagGroupId = currentTransaction.TagGroupId }); }
public void StoreCurrentGroupedTransaction(ExcelTransactionExtended currentTransaction, string groupId) { var endDate = this.GetEndDayDate(currentTransaction.AccountingDate); if (this.GroupDict.ContainsKey(groupId)) // GroupId already exists { this.GroupDict[groupId].Sum += currentTransaction.Sum; } else // GroupId is new { var newGroupedTransaction = this.GetNewGroupedTransaction(currentTransaction, endDate); this.GroupDict.Add(groupId, newGroupedTransaction); } }