public ActionResult SearchDetail(string KeyWord, string No, int pN, int start) { Articles ar = new Articles(); ArticlesVO article = ar.SearchDetail(KeyWord, No); List <ArticlesVO> list = ar.SearchList(1, KeyWord); ViewBag.Max = list.First().Total; System.Diagnostics.Debug.WriteLine("SearchDetail.Max : " + list.First().Total); ViewBag.Contents = article.Contents; ViewBag.Subject = article.Title; ViewBag.ViewCount = article.ViewCount; ViewBag.RegistMemberID = article.RegistMemberID; ViewBag.RegistDate = article.RegistDate; ViewBag.No = article.No; ViewBag.ArticleIDX = article.ArticleIDX; ViewBag.sessionID = Session["ID"]; ViewBag.KeyWord = KeyWord; //댓글 ArticleComments ac = new ArticleComments(); List <ArticleCommentsVO> CommentList = ac.CommentList(article.ArticleIDX, pN); if (CommentList.Count == 0) { ViewBag.Total = 0; } else { ViewBag.Total = CommentList.First().Total; } ViewBag.ArticleIDX = article.ArticleIDX; ViewBag.pN = pN; ViewBag.start = start; ViewBag.end = start + 9; return(View(CommentList)); }
//게시판 글 단일 뷰 public ActionResult Detail(string No, int pN, int start) { Articles ar = new Articles(); ArticlesVO article = ar.Detail(No); List <ArticlesVO> list = ar.ArticleList(1); ViewBag.Max = list.First().Total; ViewBag.Contents = article.Contents; ViewBag.Subject = article.Title; ViewBag.ViewCount = article.ViewCount; ViewBag.RegistMemberID = article.RegistMemberID; ViewBag.RegistDate = article.RegistDate; ViewBag.No = article.No; ViewBag.ArticleIDX = article.ArticleIDX; ViewBag.sessionID = Session["ID"]; //댓글 ArticleComments ac = new ArticleComments(); List <ArticleCommentsVO> CommentList = ac.CommentList(article.ArticleIDX, pN); if (CommentList.Count == 0) { ViewBag.Total = 0; } else { ViewBag.Total = CommentList.First().Total; } ViewBag.ArticleIDX = article.ArticleIDX; ViewBag.pN = pN; ViewBag.start = start; ViewBag.end = start + 9; return(View(CommentList)); }