예제 #1
0
        public ActionResult Edit(CategoryViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                var dto = Mapper.Map<CategoryViewModel, CategoryDto>(viewModel);
                client.Update<CategoryDto>(UrlProvider.WebApiCategory, dto);

                return RedirectToAction("Index");
            }

            return View(viewModel);
        }
예제 #2
0
        public ActionResult Delete(CategoryViewModel viewModel)
        {
            client.Delete(UrlProvider.WebApiCategory + viewModel.Id);

            return RedirectToAction("Index");
        }
예제 #3
0
        public ActionResult Create()
        {
            var viewModel = new CategoryViewModel();

            return View(viewModel);
        }