Exemplo n.º 1
0
        public ActionResult List()
        {
            LogWriter.Instance().LogWrite("/Board/List 접속");
            if (!SessionCheck(Define.Session.SESSION_CHECK))
            {
                LogWriter.Instance().LogWrite("/Board/List 에서 세션 만료로 에러가 발생합니다.");
                return(ErrorPage("/Home/Error"));
            }
            if (!CheckAuth())
            {
                LogWriter.Instance().LogWrite(UserSession.UserId, "/Board/List 인증 에러");
                return(base.Logout());
            }

            int           count = Convert.ToInt32(Math.Ceiling((Double)((Double)boardDao.GetBoardCount() / (Double)PAGELIMIT)));
            IList <Board> list  = boardDao.SelectBoard(PAGELIMIT, 1);

            ViewBag.listcount = count;
            list.AsParallel().ForAll((board) =>
            {
                board.Title += " (" + commentDao.GetCommentCount(board.Idx).ToString() + ")";
            });
            ViewBag.list = list;

            Session[Define.Session.CONTROLLER] = "Board";
            Session[Define.Session.ACTION]     = "List";
            return(View("~/Views/Board/Web/List.cshtml", Define.MASTER_VIEW));
        }