public ActionResult Index(int?id) { string username; if (Session["username"] == null) { return(RedirectToAction("Index", "Home")); } username = Session["username"].ToString(); int projectId = id ?? default(int); if (!Authentication.VerifyIfProjectManager(username) || !Authentication.VerifyIfPartOfProject(username, projectId)) { return(RedirectToAction("Index", "Project", new { id = projectId })); } TeamManagementModel model = new TeamManagementModel(); model.CurrentProject = model.GetProject(projectId); model.ExcludedUsers = model.GetExcludedUsers(projectId); model.IncludedUsers = model.GetIncludedUsers(projectId); model.Projects = model.GetProjects(username); model.CurrentUser = model.GetUser(username); return(View(model)); }