Example #1
0
        public ActionResult Categories(BudgetCategoryViewModel model)
        {
            var map = new BudgetCategoryMap();
            map.BudgetId = model.BudgetId;
            map.CategoryId = model.CategoryId;
            Service.BudgetCategoryMaps.Upsert(map);

            var categories = Service.Categories.GetAllForBudget(model.BudgetId);
            return PartialView("BudgetCategoryListPartial", new BudgetCategoryListViewModel(categories));
        }
Example #2
0
 public ActionResult Categories(Guid id)
 {
     var categories = Service.Categories.GetAllForBudget(id);
     var allCategories = Service.Categories.GetAllForHousehold();
     var model = new BudgetCategoryViewModel();
     model.CurrentBudgetCategorys = categories;
     model.BudgetId = id;
     model.Categories = new SelectList(allCategories, "Id", "Name");
     return View(model);
 }