Пример #1
0
        public ActionResult ShowPopupNotifications()
        {
            var receiverId    = _intranetMemberService.GetCurrentMemberId();
            var notifications = _popupNotificationService.Get(receiverId).Map <IEnumerable <PopupNotificationViewModel> >();

            return(PartialView(PopupNotificationsViewPath, notifications));
        }
        private void ShowPopupNotification()
        {
            var currentMemberId = _intranetMemberService.GetCurrentMemberId();
            var notifications   = _popupNotificationService.Get(currentMemberId)
                                  .Map <IEnumerable <PopupNotificationViewModel> >();
            var hubContext = GlobalHost.ConnectionManager.GetHubContext <UintraHub>();

            if (notifications.Any())
            {
                Task.Run(() =>
                {
                    Thread.Sleep(5000);
                    hubContext.Clients.User(currentMemberId.ToString()).showPopup(notifications);
                });
            }
        }