public ActionResult _ListActivities(string spaceKey, int?pageIndex, int?applicationId, MediaType?mediaType, bool?isOriginal, long?userId)
        {
            long        groupId = GroupIdToGroupKeyDictionary.GetGroupId(spaceKey);
            GroupEntity group   = groupService.Get(groupId);

            if (group == null)
            {
                return(new EmptyResult());
            }
            IUser currentUser = UserContext.CurrentUser;

            if (currentUser == null)
            {
                return(new EmptyResult());
            }
            PagingDataSet <Activity> activities = activityService.GetOwnerActivities(ActivityOwnerTypes.Instance().Group(), groupId, applicationId, mediaType, isOriginal, null, pageIndex ?? 1, userId);

            if (activities.FirstOrDefault() != null)
            {
                ViewData["lastActivityId"] = activities.FirstOrDefault().ActivityId;
            }
            bool isDynamic = groupService.IsDynamic(group.GroupId);
            bool isMember  = groupService.IsMember(group.GroupId, currentUser.UserId);

            ViewData["pageIndex"]     = pageIndex;
            ViewData["applicationId"] = applicationId;
            ViewData["mediaType"]     = mediaType;
            ViewData["isOriginal"]    = isOriginal;
            ViewData["userId"]        = userId;
            ViewData["isMember"]      = isMember;
            ViewData["isDynamic"]     = isDynamic;
            return(View(activities));
        }
Exemple #2
0
        public ActionResult _ListActivities(string spaceKey, int?pageIndex, int?applicationId, MediaType?mediaType, bool?isOriginal, long?userId)
        {
            long groupId = GroupIdToGroupKeyDictionary.GetGroupId(spaceKey);
            PagingDataSet <Activity> activities = activityService.GetOwnerActivities(ActivityOwnerTypes.Instance().Group(), groupId, applicationId, mediaType, isOriginal, null, pageIndex ?? 1, userId);

            if (activities.FirstOrDefault() != null)
            {
                ViewData["lastActivityId"] = activities.FirstOrDefault().ActivityId;
            }
            ViewData["pageIndex"]     = pageIndex;
            ViewData["applicationId"] = applicationId;
            ViewData["mediaType"]     = mediaType;
            ViewData["isOriginal"]    = isOriginal;
            ViewData["userId"]        = userId;
            return(View(activities));
        }
Exemple #3
0
        public ActionResult _NewGroupActivities(string spaceKey)
        {
            long groupId = GroupIdToGroupKeyDictionary.GetGroupId(spaceKey);
            PagingDataSet <Activity> activities = activityService.GetOwnerActivities(ActivityOwnerTypes.Instance().Group(), groupId, 1001, null, null, null, 1, null);

            if (activities != null)
            {
                return(View(activities.FirstOrDefault()));
            }
            return(View());
        }