示例#1
0
        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));
            });
        }
示例#2
0
        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));
            });
        }