コード例 #1
0
        public ActionResult Update(string ArticleIDX, string No)
        {
            Articles   ar      = new Articles();
            ArticlesVO article = ar.Detail(No);

            ViewBag.ArticleIDX = ArticleIDX;//게시판 아이디
            ViewBag.Subject    = article.Title;
            ViewBag.Contents   = article.Contents;
            return(View());
        }
コード例 #2
0
        public List <ArticlesVO> findList()
        {
            DataSet           dataSet = AccessHelper.ExecuteDataSet(AccessHelper.conn, "select * from Articles");
            List <ArticlesVO> list    = new List <ArticlesVO>();

            foreach (DataRow row in dataSet.Tables[0].Rows)
            {
                ArticlesVO articlesVO = new ArticlesVO();
                articlesVO.id    = (int)row[0];
                articlesVO.title = row[1].ToString();
                list.Add(articlesVO);
            }
            return(list);
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        //게시판 글 단일 뷰
        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));
        }