Exemplo n.º 1
0
        public ActionResult AllUsersForProjects(int?id)
        {
            if (!id.HasValue)
            {
                return(RedirectToAction(nameof(ProjectsController.AllProjects), "Projects"));
            }
            else
            {
                AssignProjectMembersViewModel model = new AssignProjectMembersViewModel
                {
                    Id    = id,
                    Users = DbContext.Users.ToList()
                };

                return(View(model));
            }
        }
Exemplo n.º 2
0
        public ActionResult AllUsersForTickets(int?id)
        {
            if (!id.HasValue)
            {
                return(RedirectToAction(nameof(TicketsController.AllTickets), "Tickets"));
            }
            else
            {
                IdentityRole role = DbContext.Roles.FirstOrDefault(p => p.Name == Developer);

                AssignProjectMembersViewModel model = new AssignProjectMembersViewModel
                {
                    Id    = id,
                    Users = DbContext.Users.Where(p => p.Roles.Any(q => q.RoleId == role.Id)).ToList()
                };

                return(View(model));
            }
        }