コード例 #1
0
        private IEnumerable <SelectListItem> GetPeople(bool isUserProjectManager, Guid projectId)
        {
            if (!isUserProjectManager)
            {
                return(this.GetAutorizeUser());
            }

            var userId = new UserId(UserContext.Current.UserId);

            var usersInProject = _userQueryService.GetTeamForProjectManager(userId, new ProjectId(projectId));

            if (usersInProject == null)
            {
                return(this.GetAutorizeUser());
            }

            return(usersInProject.Select(x => new SelectListItem {
                Text = x.FirstName + " " + x.LastName, Value = x.UserId.ToString()
            }));
        }