コード例 #1
0
        public ActionResult AddUserToProject(int projId, string UserId)
        {
            if (ModelState.IsValid)
            {
                //var user = db.Users.Find(userId);
                ProjectHelper.AssignUserToProject(UserId, projId);
                return(RedirectToAction("Index", "Manage"));
            }

            ViewBag.UserId = new SelectList(UserHelper.AllUsersInRole("Manager"), "Id", "Email");
            return(View());
        }
コード例 #2
0
 public ActionResult AssignUsers(AssignProjectUsersViewModel model)
 {
     if (ModelState.IsValid)
     {
         if (model.SelectedUsers != null)
         {
             foreach (string userId in model.SelectedUsers)
             {
                 helper.AssignUserToProject(userId, model.ProjectId);
             }
         }
         return(RedirectToAction("DevAssignations", "ProjectUsers", new { id = model.ProjectId }));
     }
     return(View(model));
 }
コード例 #3
0
 public ActionResult AssignProjectManager(AssignProjectManagersViewModel model)
 {
     if (ModelState.IsValid)
     {
         if (model.SelectedUsers != null)
         {
             var user = helper.GetProjectManager(model.ProjectId);
             if (user != null)
             {
                 helper.RemoveUserFromProject(user.Id, model.ProjectId);
             }
             helper.AssignUserToProject(model.SelectedUsers[0], model.ProjectId);
         }
         return(RedirectToAction("PMAssignations", "ProjectManagers", new { id = model.ProjectId }));
     }
     return(View(model));
 }