public void AddUserToRole(int userId, int groupId)
        {
            try
            {
                m_client.Post <object>($"role/{groupId}/user/{userId}", null);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
        public int CreateExternalRepository(ExternalRepositoryDetailContract externalRepository)
        {
            try
            {
                var externalRepositoryId = m_client.Post <int>("bibliography/repository", externalRepository);
                return(externalRepositoryId);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
示例#3
0
        public long CreateFeedback(CreateFeedbackContract data)
        {
            try
            {
                var result = m_client.Post <long>("feedback", data);
                return(result);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
示例#4
0
        public int CreateCategory(CategoryContract category)
        {
            try
            {
                var resultId = m_client.Post <int>("category", category);
                return(resultId);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
        public int CreateFilteringExpressionSet(FilteringExpressionSetDetailContract filteringExpressionSet)
        {
            try
            {
                var filteringExpressionSetId = m_client.Post <int>("bibliography/filtering-expression-set", filteringExpressionSet);
                return(filteringExpressionSetId);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
示例#6
0
        public void ProcessSessionAsImport(string sessionId, NewBookImportContract request)
        {
            try
            {
                var requestTimeout = new TimeSpan(0, 10, 0); // Import is long running operation
                m_client.Post <object>($"ProjectImportSession/{sessionId}", request, requestTimeout);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
        public long CreateSnapshot(CreateSnapshotContract createSnapshotContract)
        {
            try
            {
                var snapshotId = m_client.Post <long>($"{BasePath}", createSnapshotContract);
                return(snapshotId);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
        public long CreateFavoriteLabel(FavoriteLabelContractBase data)
        {
            try
            {
                var result = m_client.Post <long>("favorite/label", data);
                return(result);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
示例#9
0
        public int CreateNewUser(CreateUserContract data)
        {
            try
            {
                //EnsureSecuredClient();
                var result = m_client.Post <int>("user", data);
                return(result);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
示例#10
0
        public long CreateProject(CreateProjectContract project)
        {
            try
            {
                var projectId = m_client.Post <long>("project", project);
                return(projectId);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
示例#11
0
        public List <PageContract> SearchPage(long projectId, SearchPageRequestContract request)
        {
            try
            {
                var result = m_client.Post <List <PageContract> >($"book/{projectId}/page/search", request);
                return(result);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }