public ActionResult Delete(int id, FormCollection collection) { LOGGER.Info("CategoryController::Delete POST"); try { Category category = new Category { Id = Convert.ToInt32(collection["Id"]), Name = collection["Name"] }; categoryDao.DeleteCategory(category); TempData["msg"] = "Category deleted"; TempData["css"] = "success"; return(RedirectToAction("Index")); } catch (Exception e) { LOGGER.Error($"Error deleting category: {e}"); return(View()); } }
public void DeleteCategory(string name) { categoryDao.DeleteCategory(name); }
public void DeleteCategory(int index) { categoryDao.DeleteCategory(index); }
public bool DeleteCategory(int categoryId) { return(categoryDao.DeleteCategory(categoryId)); }
public void DeleteCategory(Category deleteRole) { _categoryDao.DeleteCategory(deleteRole); }