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