Esempio n. 1
0
        // GET: NoticeBoard
        public ActionResult Index()
        {
            var noticeVMList = new List <NoticeBoardViewModel>();
            var notices      = _noticeBoardManager.GetApprovedNotices();

            foreach (var n in notices)
            {
                var totalComnts = _noticeBoardManager.GetComments(n.Id).Count();
                noticeVMList.Add(new NoticeBoardViewModel
                {
                    Notice        = n,
                    TotalComments = totalComnts,
                    NoticeImage   = _noticeBoardManager.GetNoticeImage(n.Id, "Notice")
                });
            }

            return(View(noticeVMList.OrderByDescending(y => y.Notice.SubmitDate).OrderByDescending(x => x.Notice.PinUp).ToList()));
        }