public JsonResult Create(CategoryModel model)
        {
            if (ModelState.IsValid)
            {
                var category = Mapper.Map<CategoryModel, Category>(model);

                _categoryService.CreateCategory(category);
                _categoryService.SaveCategory();
                HttpContext.Application.Remove("categories");

                return Json(new { url = Url.Action("Index", "Category") });
            }
            return Json(new { Success = false });
        }
        public ActionResult DeleteSingle(CategoryModel model)
        {
            _categoryService.DeleteCategory(model.CategoryId);
            _categoryService.SaveCategory();
            HttpContext.Application.Remove("categories");

            return RedirectToAction("Index");
        }
        public JsonResult UpdateCategory(CategoryModel model)
        {
            var category = Mapper.Map<CategoryModel, Category>(model);
            _categoryService.EditCategory(category);
            _categoryService.SaveCategory();
            HttpContext.Application.Remove("categories");

            return Json(new { url = Url.Action("Index", "Category") });
        }
 public ActionResult DeleteError(CategoryModel model)
 {
     return RedirectToAction("DeleteError", model);
 }