Exemplo n.º 1
0
        public IList <SelectListItem> GetProjectNames()
        {
            var projects = ProjectManagementService.GetProjects();

            return(projects.Select(e => new SelectListItem
            {
                Text = e.Title,
                Value = e.Id.ToString(CultureInfo.InvariantCulture)
            }).ToList());
        }
Exemplo n.º 2
0
        public DataTablesResult <ProjectListViewModel> GetProjects(DataTablesParam dataTableParam)
        {
            var searchString = dataTableParam.GetSearchString();
            var projects     = ProjectManagementService.GetProjects(pageInfo: dataTableParam.ToPageInfo(), searchString: searchString);

            if (User.IsInRole("lector"))
            {
                return(DataTableExtensions.GetResults(projects.Items.Select(model => FromProject(model, PartialViewToString("_ProjectsGridActions", FromProject(model)))).Where(e => e.IsAssigned), dataTableParam, projects.TotalCount));
            }

            return(DataTableExtensions.GetResults(projects.Items.Select(FromProject).Where(e => e.IsAssigned), dataTableParam, projects.TotalCount));
        }