public ActionResult AssignUsersToProject(int projectId) { ViewBag.projectId = projectId; var userId = User.Identity.GetUserId(); var AssignedUsersToProject = projectLogic.getAllAssignedusersToProject(projectId); List <ApplicationUser> users = new List <ApplicationUser>(); if (AdminLogic.CheckIfUserIsInRole(userId, "Admin")) { users = AdminLogic.GetAllDevelopersAndManagers(); return(View(users)); } else if (AdminLogic.CheckIfUserIsInRole(userId, "Manager")) { users = AdminLogic.GetAllDevelopers(); } return(View(users)); }
public ActionResult AssignTicket(AssignTicketViewModel model) { if (ModelState.IsValid) { ticketLogic.assignTicket(model); return(RedirectToAction("Index")); } var userId = User.Identity.GetUserId(); var users = new List <ApplicationUser>(); if (AdminLogic.CheckIfUserIsInRole(userId, "Admin")) { users = ticketLogic.getAllManagerAndDeveloperUser(userId); } else { users = ticketLogic.getAllDeveloperUser(userId); } ViewBag.DeveloperId = new SelectList(users, "Id", "UserName"); return(View()); }
public ActionResult AssignTicket(int ticketId) { var ticket = ticketLogic.getTicketById(ticketId); if (ticket == null) { return(RedirectToAction("Error")); } var userId = User.Identity.GetUserId(); var users = new List <ApplicationUser>(); if (AdminLogic.CheckIfUserIsInRole(userId, "Admin")) { users = ticketLogic.getAllManagerAndDeveloperUser(userId); } else { users = ticketLogic.getAllDeveloperUser(userId); } ViewBag.Ticket = ticket; ViewBag.DeveloperId = new SelectList(users, "Id", "UserName"); return(View()); }