示例#1
0
        public ActionResult UpdateCategory(CategoryViewModel model)
        {
            if (ModelState.IsValid)
            {
                var categoryEntity = Mapper.Map<CategoryViewModel, Category>(model);

                _clothesService.UpdateCategory(categoryEntity);
                return RedirectToAction("CreateCategory");
            }
            return PartialView("EditCategory", model);
        }
示例#2
0
        public ActionResult CreateCategory(CategoryViewModel category)
        {
            if (ModelState.IsValid)
            {
                var categoryEntity = Mapper.Map<CategoryViewModel, Category>(category);

                _clothesService.AddCategory(categoryEntity);
                return RedirectToAction("CreateCategory");
            }
            return View();
        }