public ActionResult Delete(int id) { CategoryDao cDao = new CategoryDao(); Category c = cDao.FindCatById(id); cDao.DeleteCategory(c); return(RedirectToAction("List")); }
public ActionResult Delete(Guid id) { dao = new CategoryDao(); bool check = dao.DeleteCategory(id); if (check) { return(RedirectToAction("CategoryManager", "HomeAd")); } else { return(JavaScript("<script>alert('Xóa không thành công')</script>")); } }
/// <summary> /// DeleteCategory - xoa thông tin category /// </summary> /// <param name="category"></param> /// <returns></returns> public bool DeleteCategory(Category category) { return(categoryDao.DeleteCategory(category)); }
/// <summary> /// 根据id删除类别 /// </summary> /// <param name="id"></param> /// <returns></returns> public static bool DeleteCategory(int id) { int res = CategoryDao.DeleteCategory(id); return(res > 0); }