public InvestmentCardResult(FinanceStatementCollection investments, decimal totalIncome) { decimal total = investments.Total(); double percent = investments.Percentage(totalIncome); Total = new TotalQueryResult(total, percent); Content = investments.GetFinanceStatements().Select(investment => { return(new FinanceStatementQueryResult(investment.Id, investment.Title, total, investment.AmountRecords)); }); }
public ExpenseCardResult(FinanceStatementCollection expenses, decimal totalIncome) { decimal total = expenses.Total(); double percent = expenses.Percentage(totalIncome); Total = new TotalQueryResult(total, percent); Content = expenses.GetFinanceStatements().Select(expense => { return(new FinanceStatementQueryResult(expense.Id, expense.Title, total, expense.AmountRecords)); }); }