示例#1
0
        public ActionResult Delete(int id)
        {
            CategoryDao cDao = new CategoryDao();
            Category    c    = cDao.FindCatById(id);

            cDao.DeleteCategory(c);
            return(RedirectToAction("List"));
        }
示例#2
0
        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>"));
            }
        }
示例#3
0
 /// <summary>
 /// DeleteCategory - xoa thông tin category
 /// </summary>
 /// <param name="category"></param>
 /// <returns></returns>
 public bool DeleteCategory(Category category)
 {
     return(categoryDao.DeleteCategory(category));
 }
示例#4
0
        /// <summary>
        /// 根据id删除类别
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static bool DeleteCategory(int id)
        {
            int res = CategoryDao.DeleteCategory(id);

            return(res > 0);
        }