예제 #1
0
        public int AddCategory(NewCategoryVm model)
        {
            var category = _mapper.Map <Category>(model);

            _categoryRepo.AddCategory(category);
            return(category.Id);
        }
        public int AddCategory(NewCategoryVm newCategory)
        {
            var cat = _mapper.Map <Category>(newCategory);
            int id  = _categoryAndQuestionRepo.AddCategory(cat);

            return(id);
        }
예제 #3
0
        public IActionResult AddNewCategory(NewCategoryVm newCategoryModel)
        {
            var id = _categoryAndQuestionService.AddCategory(newCategoryModel);

            return(Redirect("/Home/ShowMenuForUser"));
        }
예제 #4
0
        public void UpdateCategory(NewCategoryVm model)
        {
            var category = _mapper.Map <Category>(model);

            _categoryRepo.UpdateCategory(category);
        }
예제 #5
0
 public IActionResult EditCategory(NewCategoryVm model)
 {
     _categoryService.UpdateCategory(model);
     return(RedirectToAction("Index"));
 }
예제 #6
0
        public IActionResult AddCategory(NewCategoryVm model)
        {
            var id = _categoryService.AddCategory(model);

            return(RedirectToAction("Index"));
        }