Exemplo n.º 1
0
        public ActionResult Create()
        {
            var model = new ManageCategoryEditViewModel
            {
                SuperCategories = GetSuperCategoryListItems(_dataContext.SuperCategories.ToList())
            };

            return View(model);
        }
Exemplo n.º 2
0
        public ActionResult Edit(int id)
        {
            var model = new ManageCategoryEditViewModel
                            {
                                Category = _dataContext.Categories.Single(m => m.Id == id),
                                SuperCategories = GetSuperCategoryListItems(_dataContext.SuperCategories.ToList())
                            };

            return View(model);
        }
Exemplo n.º 3
0
        private ManageCategoryEditViewModel GetManageCategoryViewModel(Category category)
        {
            var model = new ManageCategoryEditViewModel
                            {
                                Category = category,
                                SuperCategories = GetSuperCategoryListItems(_dataContext.SuperCategories.ToList())
                            };

            return model;
        }