コード例 #1
0
        public bool RequestContribute(int projectid)
        {
            var userId = UserContext.CurrentUserId;

            LightSpeedRepository repository =
                new LightSpeedRepository(ObjectFactory.GetInstance <ApplicationSettings>());

            var organisation = repository.GetOrgByUser(userId);

            if (!repository.IsContributePending(projectid, userId))
            {
                repository.SetPendingApprovedInProject(projectid, userId, organisation?.Id ?? 0);
            }

            return(repository.IsContributePending(projectid, userId));
        }
コード例 #2
0
        public bool RequestWatch(int projectid)
        {
            var userId = UserContext.CurrentUserId;
            LightSpeedRepository repository =
                new LightSpeedRepository(ObjectFactory.GetInstance <ApplicationSettings>());

            var organisation = repository.GetOrgByUser(userId);

            if (repository.IsWatched(projectid, userId))
            {
                repository.UnWatchProject(projectid, userId);
            }
            else
            {
                repository.WatchProject(projectid, userId, organisation?.Id ?? 0);
            }

            return(repository.IsWatched(projectid, userId));
        }