Beispiel #1
0
        public void DeleteComment(int Id_comment)
        {
            Comment entity = commentDao.SelectOne(Id_comment);

            if (entity != null)
            {
                commentDao.Delete(entity);
            }
        }
 public ActionResult DeleteComment(int?id)
 {
     if (functions.CookieID() == null)
     {
         return(Redirect("/Users/Login"));
     }
     else if (id == null)
     {
         return(new HttpNotFoundResult());
     }
     else if (ModelState.IsValid)
     {
         commentDao.Delete(id);
         return(Json(true, JsonRequestBehavior.AllowGet));
     }
     return(Json(false, JsonRequestBehavior.AllowGet));
 }