コード例 #1
0
        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));
        }
コード例 #2
0
ファイル: TicketController.cs プロジェクト: emc255/BugTracker
        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());
        }
コード例 #3
0
ファイル: TicketController.cs プロジェクト: emc255/BugTracker
        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());
        }