Exemple #1
0
        public HttpResponseMessage GetReminders(int userId, string moduleIds, bool todayNotifications)
        {
            int[] moduleIDs = null;
            if (!string.IsNullOrEmpty(moduleIds))
            {
                moduleIDs = JsonConvert.DeserializeObject <int[]>(moduleIds);
            }
            GetUserNotificationsResponse response = userService.GetReminderNotifications(
                new GetUserNotificationsRequest()
            {
                UserIds = new List <int>()
                {
                    userId
                }, ModuleIds = moduleIDs, TodayNotifications = todayNotifications
            });

            return(Request.BuildResponse(response));
        }
Exemple #2
0
        private void loadNotifications(object state)
        {
            var userIds = _connections.Keys.Select(s =>
            {
                int userId = 0;
                int.TryParse(s, out userId);
                return(userId);
            });

            GetUserNotificationsResponse response = userService.GetImpendingReminderNotifications(
                new GetUserNotificationsRequest()
            {
                UserIds = userIds
            });

            if (response.Notifications.IsAny())
            {
                this.LoadReminders(response.Notifications);
            }
        }