public ContentResult NewPMCount()
        {
            var user = this.CurrentUser();

            if (user == null)
            {
                return(Content(String.Empty));
            }
            var count = _privateMessageService.GetUnreadCount(user);

            return(Content(count.ToString()));
        }
예제 #2
0
        public ContentResult NewPMCount()
        {
            var user = _userRetrievalShim.GetUser(HttpContext);

            if (user == null)
            {
                return(Content(String.Empty));
            }
            var count = _privateMessageService.GetUnreadCount(user);

            return(Content(count.ToString()));
        }
        public async Task <ContentResult> NewPMCount()
        {
            var user = _userRetrievalShim.GetUser();

            if (user == null)
            {
                return(Content(String.Empty));
            }
            var count = await _privateMessageService.GetUnreadCount(user);

            return(Content(count.ToString()));
        }
예제 #4
0
        public IViewComponentResult Invoke()
        {
            var container = new UserNavigationContainer();

            container.User = _userRetrievalShim.GetUser(HttpContext);
            if (container.User != null)
            {
                var count = _privateMessageService.GetUnreadCount(container.User);
                if (count > 0)
                {
                    container.PMCount = String.Format("<span class=\"badge\">{0}</span>", count);
                }
            }
            return(View(container));
        }
예제 #5
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var container = new UserNavigationContainer();

            container.User = _userRetrievalShim.GetUser();
            if (container.User != null)
            {
                var count = await _privateMessageService.GetUnreadCount(container.User);

                if (count > 0)
                {
                    container.PMCount = $"<span class=\"badge\">{count}</span>";
                }
            }
            return(View(container));
        }