コード例 #1
0
ファイル: AdminController.cs プロジェクト: tommyspot/Clothes
        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
ファイル: AdminController.cs プロジェクト: tommyspot/Clothes
        public ActionResult CreateCategory(CategoryViewModel category)
        {
            if (ModelState.IsValid)
            {
                var categoryEntity = Mapper.Map<CategoryViewModel, Category>(category);

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