コード例 #1
0
        public async Task <IEnumerable <ProjectItem> > GetProjects(GetProjectsCommand getProjectsCommand)
        {
            //используется пакет X.PagedList.Mvc.Core
            var pagedList = await _context.ProjectItems.ToPagedListAsync(getProjectsCommand.Page, getProjectsCommand.PageSize);

            return(await pagedList.ToListAsync());
        }
コード例 #2
0
        private void RaiseProjectChanged(Project project)
        {
            Int64 startTicks = Log.EVENT_HANDLER("Enter", Common.LOG_CATEGORY);

            GetProjectsCommand.RaiseCanExecuteChanged();

            GetDashboardsCommand.RaiseCanExecuteChanged();
            GetWidgetsCommand.RaiseCanExecuteChanged();

            // Build

            GetAuthorizedResourcesCommand.RaiseCanExecuteChanged();
            GetBuildsCommand.RaiseCanExecuteChanged();
            GetDefinitionsCommand.RaiseCanExecuteChanged();
            GetGeneralSettingsCommand.RaiseCanExecuteChanged();
            GetOptionsCommand.RaiseCanExecuteChanged();
            GetResourcesCommand.RaiseCanExecuteChanged();
            GetSettingsCommand.RaiseCanExecuteChanged();
            GetBuildTagsCommand.RaiseCanExecuteChanged();

            // Git

            GetProjectRepositoriesCommand.RaiseCanExecuteChanged();
            GetPullRequestsCommand.RaiseCanExecuteChanged();

            GetBlobsCommand.RaiseCanExecuteChanged();
            GetCommitsCommand.RaiseCanExecuteChanged();
            GetImportRequestsCommand.RaiseCanExecuteChanged();
            GetItemsCommand.RaiseCanExecuteChanged();
            GetMergesCommand.RaiseCanExecuteChanged();
            GetPushesCommand.RaiseCanExecuteChanged();
            GetRefsCommand.RaiseCanExecuteChanged();
            GetStatsCommand.RaiseCanExecuteChanged();

            // Test

            GetTestPlansCommand.RaiseCanExecuteChanged();

            // Work Item Tracking

            GetClassificationNodesCommand.RaiseCanExecuteChanged();
            GetProjectFieldsWITCommand.RaiseCanExecuteChanged();
            GetQueriesCommand.RaiseCanExecuteChanged();
            GetTagsCommand.RaiseCanExecuteChanged();
            GetTemplatesCommand.RaiseCanExecuteChanged();
            GetWorkItemRelationTypesCommand.RaiseCanExecuteChanged();
            GetWorkItemTypeCategoriesCommand.RaiseCanExecuteChanged();
            GetStatesWITCommand.RaiseCanExecuteChanged();
            GetWorkItemTypesWITCommand.RaiseCanExecuteChanged();
            GetWorkItemTypesFieldsCommand.RaiseCanExecuteChanged();

            GetWorkItemCommand.RaiseCanExecuteChanged();

            Log.EVENT_HANDLER("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #3
0
        public async Task <ActionResult <IEnumerable <ProjectItem> > > ReadItems(
            [FromQuery(Name = "page")][Range(MIN_PAGE, MAX_PAGE)] int page = DEFAULT_PAGE,
            [FromQuery(Name = "pagesize")][Range(MIN_PAGE_SIZE, MAX_PAGE_SIZE)] int pageSize = DEFAULT_PAGE_SIZE)
        {
            try
            {
                var readTasksCommand = new GetProjectsCommand
                {
                    Page     = page,
                    PageSize = pageSize
                };

                var item = await _projectRepository.GetProjects(readTasksCommand);

                return(Ok(item));
            }
            catch (Exception e)
            {
                //Logger.Log(e);
                return(BadRequest());
            }
        }
コード例 #4
0
        // NOTE(crhodes)
        // RaiseCanExecuteChanged for any Command that is dependent on Context.
        // N.B. Need to add to each Context Item for button to be enabled.

        //++ Add Commands that only depend on Organization Context here

        private void RaiseCollectionChanged(SelectedCollectionChangedEventArgs args)
        {
            Int64 startTicks = Log.EVENT_HANDLER($"Enter: ({args.GetType()}) {args.Collection.Name}", Common.LOG_CATEGORY);

            GetCoreProcessesCommand.RaiseCanExecuteChanged();
            GetProjectsCommand.RaiseCanExecuteChanged();
            GetTeamsCommand.RaiseCanExecuteChanged();

            // Accounts

            GetAccountsCommand.RaiseCanExecuteChanged();

            // Approvals and Checks

            // Artifacts

            // Artifacts Package Types

            // Audit

            // Build

            GetControllersCommand.RaiseCanExecuteChanged();

            // Cloud Load Test

            // Dashboard

            GetDashboardsCommand.RaiseCanExecuteChanged();
            GetWidgetsCommand.RaiseCanExecuteChanged();

            // TODO(crhodes)
            // Move these under appropriate Category

            GetWidgetsCommand.RaiseCanExecuteChanged();

            GetSystemControlsCommand.RaiseCanExecuteChanged();
            GetRulesCommand.RaiseCanExecuteChanged();

            // Git

            GetRepositoriesCommand.RaiseCanExecuteChanged();

            // Graph

            GetGroupsCommand.RaiseCanExecuteChanged();
            GetUsersCommand.RaiseCanExecuteChanged();

            // Work Item Tracking (WIT)

            GetArtifactLinkTypesCommand.RaiseCanExecuteChanged();
            GetOrganizationFieldsWITCommand.RaiseCanExecuteChanged();
            GetWorkItemIconsCommand.RaiseCanExecuteChanged();
            GetWorkItemRelationTypesCommand.RaiseCanExecuteChanged();

            // Work Item Tracking Process (WITP)

            // TODO(crhodes)
            // Decide if want to have a naming convention
            // VERBAreaResource
            // e.g. GetWITPBehaviorsCommand
            // GetWITPListsCommand
            // Get WITPProcessesCommand

            GetBehaviorsWITPCommand.RaiseCanExecuteChanged();
            GetListsCommand.RaiseCanExecuteChanged();
            GetProcessesWITPCommand.RaiseCanExecuteChanged();

            Log.EVENT_HANDLER("Exit", Common.LOG_CATEGORY, startTicks);
        }