示例#1
0
        //
        // GET: /Thread/Delete/5
        public ActionResult Delete(int id)
        {
            IForumRepository tmpRep = new SQLForumRepository();

            var result = tmpRep.GetThreadByID(id);

            return View(result);
        }
示例#2
0
        //
        // 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);
        }
示例#3
0
        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();
            }
        }