public ActionResult DeleteConfirmed(int id) { News_comments news_comments = db.News_comments.Find(id); db.News_comments.Remove(news_comments); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Comment_id,Comment_name,Comment_email,Comment_date,News_id")] News_comments news_comments) { if (ModelState.IsValid) { db.Entry(news_comments).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.News_id = new SelectList(db.News, "News_id", "News_title", news_comments.News_id); return(View(news_comments)); }
// GET: News_comments/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } News_comments news_comments = db.News_comments.Find(id); if (news_comments == null) { return(HttpNotFound()); } return(View(news_comments)); }
// GET: News_comments/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } News_comments news_comments = db.News_comments.Find(id); if (news_comments == null) { return(HttpNotFound()); } ViewBag.News_id = new SelectList(db.News, "News_id", "News_title", news_comments.News_id); return(View(news_comments)); }