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

            cDao.DeleteCategory(c);
            return(RedirectToAction("List"));
        }
Beispiel #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>"));
            }
        }
Beispiel #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));
 }
Beispiel #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);
        }