Exemple #1
0
        public ActionResult ViewContributions()
        {
            ActionResult view = View("Error");

            int userId = RetrieveUserId();

            IEnumerable <NeedContribution> collection = new UserNeedsManager(userId).RetrieveAllContributions();

            if (null != collection)
            {
                ContributionsDetailViewModel model = new ContributionsDetailViewModel();

                model.PendingContributions
                    = collection.Where(n => !n.Contributed.HasValue);
                collection
                    = collection.Where(n => n.Contributed.HasValue);
                model.ApprovedContributions
                    = collection.Where(n => n.Contributed.Value);
                model.DeclinedContributions
                    = collection.Where(n => !n.Contributed.Value);

                view = View(model);
            }

            return(view);
        }