Exemple #1
0
        public void CreateGroupUser(GroupUser groupUser, IGroupInvitationService groupInvitationService)
        {
            var oldUser = groupUserRepository.GetMany(g => g.UserId == groupUser.UserId && g.GroupId == groupUser.GroupId);

            if (oldUser.Count() == 0)
            {
                groupUserRepository.Add(groupUser);
                SaveGroupUser();
            }
            groupInvitationService.AcceptInvitation(groupUser.GroupId, groupUser.UserId);
        }
Exemple #2
0
        public ActionResult AcceptRequest(int groupId, string userId)
        {
            var newGroupUser = new GroupUser()
            {
                Admin   = false,
                UserId  = userId,
                GroupId = groupId
            };

            groupUserService.CreateGroupUserFromRequest(newGroupUser, groupRequestService);
            if (groupInvitationService.IsUserInvited(groupId, userId))
            {
                groupInvitationService.AcceptInvitation(groupId, userId);
            }
            return(RedirectToAction("ShowAllRequests", new { id = groupId }));
        }
 public void CreateGroupUser(GroupUser groupUser, IGroupInvitationService groupInvitationService)
 {
     var oldUser = groupUserRepository.GetMany(g => g.UserId == groupUser.UserId && g.GroupId == groupUser.GroupId);
     if (oldUser.Count() == 0)
     {
         groupUserRepository.Add(groupUser);
         SaveGroupUser();
     }
     groupInvitationService.AcceptInvitation(groupUser.GroupId, groupUser.UserId);
 }