コード例 #1
0
ファイル: WorkflowService.cs プロジェクト: rammybt/microwf
        public async Task <IEnumerable <WorkflowVariableViewModel> > GetVariablesAsync(int id)
        {
            var list = await this.repository.ListAsync(new WorkflowVariablesForWorkflow(id));

            var workflow = list.FirstOrDefault();

            if (workflow == null)
            {
                throw new KeyNotFoundException(nameof(id));
            }

            var viewModels = workflow.WorkflowVariables.OrderBy(v => v.Type);

            return(ViewModelMapper.ToWorkflowVariableViewModelList(viewModels));
        }
コード例 #2
0
ファイル: WorkflowService.cs プロジェクト: rammybt/microwf
        public async Task <IEnumerable <WorkflowHistoryViewModel> > GetHistoryAsync(int id)
        {
            var list = await this.repository.ListAsync(new WorkflowHistoryForWorkflow(id));

            var workflow = list.FirstOrDefault();

            if (workflow == null)
            {
                throw new KeyNotFoundException(nameof(id));
            }

            var viewModels = workflow.WorkflowHistories.OrderByDescending(h => h.Created);

            return(ViewModelMapper.ToWorkflowHistoryViewModelList(viewModels));
        }
コード例 #3
0
ファイル: WorkItemService.cs プロジェクト: rammybt/microwf
        public async Task <PaginatedList <WorkItemViewModel> > GetFailedAsync(
            PagingParameters pagingParameters
            )
        {
            var count = await this.repository
                        .CountAsync(new WorkItemRetryLimitHitCount(WorkItem.WORKITEM_RETRIES));

            var items = await this.repository
                        .ListAsync(new WorkItemRetryLimitHitCountOrderedPaginated(
                                       WorkItem.WORKITEM_RETRIES,
                                       pagingParameters.SkipCount,
                                       pagingParameters.PageSize
                                       ));

            return(new PaginatedList <WorkItemViewModel>(
                       ViewModelMapper.ToWorkItemViewModelList(items),
                       count,
                       pagingParameters.PageIndex,
                       pagingParameters.PageSize
                       ));
        }
コード例 #4
0
ファイル: WorkItemService.cs プロジェクト: rammybt/microwf
        public async Task <PaginatedList <WorkItemViewModel> > GetUpCommingsAsync(
            PagingParameters pagingParameters
            )
        {
            var now = SystemTime.Now();

            var count = await this.repository
                        .CountAsync(new WorkItemDueDateGreaterThanNowCount(now));

            var items = await this.repository
                        .ListAsync(new WorkItemDueDateGreaterThanNowOrderedPaginated(
                                       now,
                                       pagingParameters.SkipCount,
                                       pagingParameters.PageSize
                                       ));

            return(new PaginatedList <WorkItemViewModel>(
                       ViewModelMapper.ToWorkItemViewModelList(items),
                       count,
                       pagingParameters.PageIndex,
                       pagingParameters.PageSize
                       ));
        }
コード例 #5
0
 public IEnumerable <WorkItemViewModel> GetSnapshot()
 {
     return(ViewModelMapper.ToWorkItemViewModelList(this.Items.ToArray()));
 }