Exemple #1
0
        public BudgetSummaryModel Create(Budget budget)
        {
            var model = new BudgetSummaryModel
            {
                Id                    = budget.Id.ToString(),
                Name                  = budget.Name,
                Amount                = budget.Amount,
                Balance               = budget.Balance(),
                TransactionCount      = budget.CurrentTransactions().Count(),
                ThresholdStatus       = budget.ThresholdStatus,
                TransactionLimit      = budget.TransactionLimit,
                Url                   = _UrlHelper.Link("GETBudget", new { id = budget.Id.ToString() }),
                NotifyAllTransactions = budget.NotifyAllTransactions
            };

            return(model);
        }