コード例 #1
0
        private void SetInAppNotifications()
        {
            var notifications      = NotificationServices.GetNotificationsByRecipient(CurrentCedUser.CurrentUser.Email, 5);
            var notificationsModel = _inAppNotificationHelper.GetNotificationViewModelItems(notifications);

            ViewBag.Notifications = notificationsModel;
        }
コード例 #2
0
        public JsonResult _GetNotifications()
        {
            var latestNotificationEntities = NotificationServices.GetNotificationsByRecipient(CurrentCedUser.CurrentUser.Email, 5);

            var latestNotificationsModel = _inAppNotificationHelper.GetNotificationViewModelItems(latestNotificationEntities);

            var unreadNotifCount = NotificationServices.GetNotificationCount(CurrentCedUser.CurrentUser.Email, false);

            var model = new LatestNotificationsModel
            {
                Notifications = latestNotificationsModel,
                Count         = unreadNotifCount
            };

            var viewString = ViewEngineResultFunc.Invoke(model);

            return(Json(new { data = viewString, count = unreadNotifCount }));
        }