// // GET: /Post/Delete/5 public ActionResult Delete(int id) { IForumRepository tmpRep = new SQLForumRepository(); var result = tmpRep.GetPostByID(id); return View(result); }
// // GET: /Post/Details/5 public ActionResult Details(int id) { IForumRepository tmpRep = new SQLForumRepository(); var result = tmpRep.GetPostByID(id); ViewBag.Message = "Post detail"; return View(result); }
public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here IForumRepository tmpRep = new SQLForumRepository(); var post = tmpRep.GetPostByID(id); tmpRep.DeletePost(post); return RedirectToAction("Index"); } catch { return View(); } }