public ActionResult DeleteConfirmed(int id) { Commenttbl commenttbl = db.comments.Find(id); db.comments.Remove(commenttbl); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Comment_id,Pro_id,Task_id,comment")] Commenttbl commenttbl) { if (ModelState.IsValid) { db.Entry(commenttbl).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Pro_id = new SelectList(db.projects, "Pro_id", "Project_Name", commenttbl.Pro_id); ViewBag.Task_id = new SelectList(db.task_tables, "Task_id", "Task_Name", commenttbl.Task_id); return(View(commenttbl)); }
// GET: Commenttbls/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Commenttbl commenttbl = db.comments.Find(id); if (commenttbl == null) { return(HttpNotFound()); } return(View(commenttbl)); }
// GET: Commenttbls/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Commenttbl commenttbl = db.comments.Find(id); if (commenttbl == null) { return(HttpNotFound()); } ViewBag.Pro_id = new SelectList(db.projects, "Pro_id", "Project_Name", commenttbl.Pro_id); ViewBag.Task_id = new SelectList(db.task_tables, "Task_id", "Task_Name", commenttbl.Task_id); return(View(commenttbl)); }