Beispiel #1
0
 private FieldNavigationModel GetNavigation(FieldNavigationPage page, Project project)
 {
     return(new FieldNavigationModel
     {
         Page = page,
         ProjectId = project.ProjectId,
         CanEditFields = project.HasMasterAccess(CurrentUser.UserId, pa => pa.CanChangeFields) &&
                         project.Active,
     });
 }
Beispiel #2
0
        private async Task <GameFieldListViewModel> GetFieldsImpl(
            FieldNavigationPage page,
            Func <ProjectField, bool> predicate)
        {
            var project = await ProjectRepository.GetProjectWithFieldsAsync(CurrentProject.ProjectId);

            if (project == null)
            {
                return(null);
            }
            var fields = project.GetOrderedFields().Where(predicate).ToViewModels(CurrentUser.UserId);
            FieldNavigationModel navigation = GetNavigation(page, project);

            return(new GameFieldListViewModel(navigation, fields));
        }