Пример #1
0
        public ActionResult Categories()
        {
            var model = new CategoriesViewModel();
            model.CurrentCategories =
                Service.Categories.GetAll(true).ToList();

            return View(model);
        }
Пример #2
0
        public ActionResult Categories(CategoriesViewModel model)
        {
            Service.Categories.Upsert(new Category() {
                Name = model.Name,
                HouseholdId = GetHouseholdIdForCurrentUser(),
                Excluded = model.Excluded
            });

            model.CurrentCategories =
                Service.Categories.GetAll(true);
            return PartialView("CategoryListPartial", new CategoriesListViewModel(model.CurrentCategories));
        }