public ActionResult DeleteConfirmed(int id) { Articles_Comment articlescomment = db.Articles_Comment.Find(id); db.Articles_Comment.Remove(articlescomment); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Articles_Comment articlescomment = db.Articles_Comment.Find(id); if (articlescomment == null) { return(HttpNotFound()); } return(View(articlescomment)); }
public ActionResult NC_Add(Articles_Comment articles_comment) { if (Session["user_id"] != null) { string mcmes = Request["mcmes"]; int mu_id = Convert.ToInt32(Request["mcid"]); if (ModelState.IsValid) { articles_comment.art_id = mu_id; articles_comment.user_id = Convert.ToInt32(Session["user_id"].ToString()); articles_comment.ac_mess = mcmes; articles_comment.ac_time = System.DateTime.Now; db.Articles_Comment.Add(articles_comment); db.SaveChanges(); return(Content("<script>;alert('评论成功');history.go(-1)</script>")); } return(RedirectToAction("Details", "Articles")); } else { return(Content("<script>;alert('你还没有登录哦');history.go(-1)</script>")); } }
public void InsertAC(Articles_Comment AC) { iarticles_comment.InsertAC(AC); }
public void InsertAC(Articles_Comment AC) { db.Articles_Comment.Add(AC); }