Esempio n. 1
0
        public PartialViewResult MainAdminNav()
        {
            var pmCount = 0;

            if (LoggedOnReadOnlyUser != null)
            {
                pmCount = _privateMessageService.NewPrivateMessageCount(LoggedOnReadOnlyUser.Id);
            }

            var moderateCount    = 0;
            var topicsToModerate = _topicService.GetPendingTopicsCount(_categoryService.GetAll());
            var postsToModerate  = _postService.GetPendingPostsCount(_categoryService.GetAll());

            if (topicsToModerate > 0 || postsToModerate > 0)
            {
                moderateCount = topicsToModerate + postsToModerate;
            }

            var viewModel = new MainDashboardNavViewModel
            {
                PrivateMessageCount = pmCount,
                ModerateCount       = moderateCount
            };

            return(PartialView(viewModel));
        }