public ActionResult RemoveUsers(int id)
        {
            var helper = new UserRolesHelper(db);
            var managers = helper.UsersInRole("ProjectManager").ToList();
            var developers = helper.UsersInRole("Developer").ToList();
            var currentproject = db.Projects.Single(p => p.Id == id);

            var project = new ProjectUsersViewModel
            {
                ProjectId = currentproject.Id,
                Name = currentproject.Name,
                Description = currentproject.Description,
                ProjectDevelopers = currentproject.Developers.ToList(),
                ProjectManager = currentproject.Manager,
                CurrentDevelopers = currentproject.Developers.Select(d => d.Id).ToArray(),
                AvailableDevelopers = new SelectList(developers, "Id", "Name"),
            };

            return View(project);
        }
 public ActionResult RemoveUsers(ProjectUsersViewModel project)
 {
     var helper = new ProjectUsersHelper();
     foreach (var id in project.CurrentDevelopers)
     {
         helper.RemoveUserFromProject(id, project.ProjectId);
     }
     return RedirectToAction("Details", "Projects", new { id = project.ProjectId});
 }
 public ActionResult ProjectUsers(ProjectUsersViewModel project)
 {
     var helper = new ProjectUsersHelper();
     foreach (var id in project.CurrentDevelopers)
     {
         helper.AddUserToProject(id, project.ProjectId);
     }                
     helper.AddUserToProject(project.CurrentManager, project.ProjectId);
     return RedirectToAction("Details", "Projects", new { id = project.ProjectId });
 }