public static void AuthorizeProjectUser(int[] projectIds) { var userId = ((IBusinessIdentity)Csla.ApplicationContext.User.Identity).UserId; ProjectUserRepository.AuthorizeProjectUser(projectIds, userId); }
public static StatusInfoList StatusFetchInfoList(int projectId) { ProjectUserRepository.AuthorizeProjectUser(projectId); return(StatusInfoList.FetchStatusInfoList( new StatusDataCriteria { ProjectId = projectId })); }
public static ProjectUserInfoList ProjectUserFetchInfoList(int projectId) { ProjectUserRepository.AuthorizeProjectUser(projectId); return(ProjectUserInfoList.FetchProjectUserInfoList( new ProjectUserMemberDataCriteria { ProjectId = projectId })); }
public static SprintInfoList SprintFetchInfoList(IProject project) { ProjectUserRepository.AuthorizeProjectUser(project.ProjectId); return(SprintInfoList.FetchSprintInfoList( new SprintDataCriteria { ProjectId = new[] { project.ProjectId } })); }
public static StoryInfoList StoryFetchInfoList(ISprint sprint) { ProjectUserRepository.AuthorizeProjectUser(sprint.ProjectId); return(StoryInfoList.FetchStoryInfoList( new StoryDataCriteria { ProjectId = new[] { sprint.ProjectId }, SprintId = sprint.SprintId })); }
public static StoryInfoList StoryFetchInfoList(IProject project, bool?isArchived) { ProjectUserRepository.AuthorizeProjectUser(project.ProjectId); return(StoryInfoList.FetchStoryInfoList( new StoryDataCriteria { ProjectId = new[] { project.ProjectId }, IsArchived = isArchived })); }
public static SprintInfoList SprintFetchInfoList(IProject[] projects, bool?isArchived) { var projectIds = projects.Select(row => row.ProjectId).ToArray(); ProjectUserRepository.AuthorizeProjectUser(projectIds); return(SprintInfoList.FetchSprintInfoList( new SprintDataCriteria { ProjectId = projectIds, IsArchived = isArchived })); }
public static bool SprintDelete(Sprint sprint) { ProjectUserRepository.AuthorizeProjectUser(sprint.ProjectId); Sprint.DeleteSprint( new SprintDataCriteria { SprintId = sprint.SprintId }); FeedRepository.FeedAdd(FeedAction.Deleted, sprint); return(true); }
public static Project ProjectFetch(int projectId) { ProjectUserRepository.AuthorizeProjectUser(projectId); var result = Project.FetchProject( new ProjectDataCriteria { ProjectId = projectId }); result.Auditor = new ProjectAuditor(result.Clone()); return(result); }
public static bool StoryDelete(Story story) { ProjectUserRepository.AuthorizeProjectUser(story.ProjectId); Story.DeleteStory( new StoryDataCriteria { StoryId = story.StoryId }); FeedRepository.FeedAdd(FeedAction.Deleted, story); return(true); }
public static bool ProjectDelete(Project project) { ProjectUserRepository.AuthorizeProjectUser(project.ProjectId); Project.DeleteProject( new ProjectDataCriteria { ProjectId = project.ProjectId }); FeedRepository.FeedAdd(FeedAction.Deleted, project); return(true); }
public static Project ProjectUpdate(Project project) { if (!project.IsDirty) { return(project); } ProjectUserRepository.AuthorizeProjectUser(project.ProjectId); project = project.Save(); SourceRepository.SourceUpdate(project.ProjectId, SourceType.Project, project.Name); FeedRepository.FeedAdd(FeedAction.Edited, project); return(project); }
public static Status StatusUpdate(Status status) { if (!status.IsDirty) { return(status); } ProjectUserRepository.AuthorizeProjectUser(status.ProjectId); status = status.Save(); SourceRepository.SourceUpdate(status.StatusId, SourceType.Status, status.Name); FeedRepository.FeedAdd(FeedAction.Edited, status); return(status); }
public static bool ProjectUserDelete(ProjectUser projectUser) { ProjectUserRepository.AuthorizeProjectUser(projectUser.ProjectId); if (ProjectUserRepository.ProjectUserFetch( projectUser.ProjectId, projectUser.UserId).RoleId == (int)Role.Owner) { throw new NotSupportedException("You cannot delete the owner of a project"); } ProjectUser.DeleteProjectUser( new ProjectUserMemberDataCriteria { ProjectUserMemberId = projectUser.ProjectUserMemberId }); FeedRepository.FeedAdd(FeedAction.Deleted, projectUser); return(true); }
public static Sprint SprintSave(Sprint sprint) { if (!sprint.IsValid) { return(sprint); } ProjectUserRepository.AuthorizeProjectUser(sprint.ProjectId); Sprint result; if (sprint.IsNew) { result = SprintRepository.SprintInsert(sprint); } else { result = SprintRepository.SprintUpdate(sprint); } return(result); }
public static ProjectUser ProjectUserSave(ProjectUser projectUser) { if (!projectUser.IsValid) { return(projectUser); } ProjectUserRepository.AuthorizeProjectUser(projectUser.ProjectId); ProjectUser result; if (projectUser.IsNew) { result = ProjectUserRepository.ProjectUserInsert(projectUser); } else { result = ProjectUserRepository.ProjectUserUpdate(projectUser); } return(result); }
public static Story StorySave(Story story) { if (!story.IsValid) { return(story); } ProjectUserRepository.AuthorizeProjectUser(story.ProjectId); Story result; if (story.IsNew) { result = StoryRepository.StoryInsert(story); } else { result = StoryRepository.StoryUpdate(story); } return(result); }