예제 #1
0
 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());
     }
 }
예제 #2
0
 public void DeleteCategory(string name)
 {
     categoryDao.DeleteCategory(name);
 }
예제 #3
0
 public void DeleteCategory(int index)
 {
     categoryDao.DeleteCategory(index);
 }
예제 #4
0
 public bool DeleteCategory(int categoryId)
 {
     return(categoryDao.DeleteCategory(categoryId));
 }
예제 #5
0
 public void DeleteCategory(Category deleteRole)
 {
     _categoryDao.DeleteCategory(deleteRole);
 }