// GET: /Thread/Details/{id} public ActionResult Details(int id) { //var service = CreateThreadService(); var service = new ThreadService(); var model = service.GetThreadByID(id); return(View(model)); }
public ActionResult Create(int threadID) { var newService = new ThreadService(); var parent = newService.GetThreadByID(threadID); var threadTitle = parent.ThreadTitle; ViewData["threadTitle"] = threadTitle; ViewData["threadID"] = threadID; return(View()); }
//public ActionResult MyRepliesIndex() //{ // var userID = Guid.Parse(User.Identity.GetUserId()); // var service = new PostReplyService(userID); // service.GetReplies(); // return RedirectToAction("MyRepliesIndex", "PostReply"); //} //GET: /Post/ThreadPostsIndex public ActionResult ThreadPostsIndex(int threadID) { var service = new PostService(); var model = service.GetPostsByThreadID(threadID); var newService = new ThreadService(); var parent = newService.GetThreadByID(threadID); var threadTitle = parent.ThreadTitle; ViewData["threadTitle"] = threadTitle; ViewData["threadID"] = threadID; return(View(model)); }
// GET: /Thread/Details/{id} public ActionResult Details(int threadID) { var service = new ThreadService(); var model = service.GetThreadByID(threadID); Guid userID; if (User.Identity.IsAuthenticated) { userID = Guid.Parse(User.Identity.GetUserId()); } else { userID = Guid.Parse("00000000-0000-0000-0000-000000000000"); } ViewData["userID"] = userID; return(View(model)); }