Пример #1
0
        //
        // GET: /Forum/Delete/5
        public ActionResult Delete(int id)
        {
            IForumRepository tmpRep = new SQLForumRepository();

            var result = tmpRep.GetForumByID(id);

            return View(result);
        }
Пример #2
0
        public ActionResult Details(int id)
        {
            IForumRepository tmpRep = new SQLForumRepository();

            var result = tmpRep.GetForumByID(id);

            ViewBag.Message = "Forum detail";

            return View(result);
        }
Пример #3
0
        public ActionResult Create(Forum forum)
        {
            try
            {
                // TODO: Add insert logic here

                IForumRepository tmpRep = new SQLForumRepository();

                tmpRep.AddForum(forum);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Пример #4
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here

                IForumRepository tmpRep = new SQLForumRepository();

                var forum = tmpRep.GetForumByID(id);

                tmpRep.DeleteForum(forum);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Пример #5
0
        //
        // GET: /Forum/
        public ActionResult Index()
        {
            IForumRepository tmpRep = new SQLForumRepository();

            var result = tmpRep.GetAllForums();

            ViewBag.Message = "QA Forums list";

            return View(result);
        }
Пример #6
0
        public ActionResult Edit(int id, Forum forum)
        {
            try
            {
                // TODO: Add update logic here

                IForumRepository tmpRep = new SQLForumRepository();

                tmpRep.UpdateForum(forum);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Пример #7
0
        //
        // GET: /Thread/Edit/5
        public ActionResult Edit(int id)
        {
            IForumRepository tmpRep = new SQLForumRepository();

            var result = tmpRep.GetThreadByID(id);

            return View(result);
        }