Example #1
0
        public void AcceptUserOnProject(User user, Project project, String rolename)
        {
            UserProjectSignupRepository signUpRepo = new UserProjectSignupRepository();

            Role acceptedRole = new RoleRepository().GetAll().Where(p => p.RoleName == rolename).SingleOrDefault();

            UserProjectSignup request = signUpRepo.GetAll()
                .Where(p => p.UserId == user.Id && p.ProjectId == project.Id).SingleOrDefault();

            new ProjectRoleRepository().Create
                (new ProjectRole { UserId = request.UserId, ProjectId = request.ProjectId, RoleId = acceptedRole.Id });

            signUpRepo.Delete(request);
        }
Example #2
0
        public void RejectUserFromProject(User user, Project project)
        {
            UserProjectSignupRepository signUpRepo = new UserProjectSignupRepository();

            UserProjectSignup request = signUpRepo.GetAll()
                .Where(p => p.UserId == user.Id && p.ProjectId == project.Id).SingleOrDefault();

            signUpRepo.Delete(request);
        }