Пример #1
0
        public List <KeywordContract> GetKeywordAutocomplete(string query, int?count)
        {
            var countValue = PagingHelper.GetAutocompleteCount(count);
            var result     = m_catalogValueRepository.InvokeUnitOfWork(x => x.GetKeywordAutocomplete(query, countValue));

            return(m_mapper.Map <List <KeywordContract> >(result));
        }
Пример #2
0
        public List <RoleContract> GetRoleAutocomplete(string query, int?count)
        {
            if (query == null)
            {
                query = string.Empty;
            }

            var countValue = PagingHelper.GetAutocompleteCount(count);

            var client         = m_communicationProvider.GetAuthRoleApiClient();
            var authResultList = client.GetRolesAutocompleteAsync(countValue, query).GetAwaiter().GetResult();

            var dbUserGroups = new GetOrCreateUserGroupsWork <AuthRoleContractBase>(m_userRepository, authResultList).Execute();

            var resultList = new List <RoleContract>();

            foreach (var authRole in authResultList)
            {
                var resultRole = m_mapper.Map <RoleContract>(authRole);
                resultRole.Id = dbUserGroups.First(x => x.ExternalId == resultRole.ExternalId).Id;
                resultList.Add(resultRole);
            }

            return(resultList);
        }
Пример #3
0
        public List <ResponsiblePersonContract> GetResponsiblePersonAutocomplete(string query, int?count)
        {
            if (query == null)
            {
                query = string.Empty;
            }

            var countValue = PagingHelper.GetAutocompleteCount(count);

            var result = m_personRepository.InvokeUnitOfWork(x => x.GetResponsiblePersonAutocomplete(query, countValue));

            return(m_mapper.Map <List <ResponsiblePersonContract> >(result));
        }
Пример #4
0
        public List <OriginalAuthorContract> GetAuthorAutocomplete(string query, BookTypeEnumContract?bookType, int?count)
        {
            if (query == null)
            {
                query = string.Empty;
            }

            var countValue   = PagingHelper.GetAutocompleteCount(count);
            var bookTypeEnum = m_mapper.Map <BookTypeEnum?>(bookType);

            var result = m_personRepository.InvokeUnitOfWork(x => x.GetAuthorAutocomplete(query, bookTypeEnum, countValue));

            return(m_mapper.Map <List <OriginalAuthorContract> >(result));
        }
Пример #5
0
        public IList <UserGroupContract> GetSingleUserGroupAutocomplete(string query, int?count, bool includeSearchInUsers)
        {
            if (query == null)
            {
                query = string.Empty;
            }

            var countValue = PagingHelper.GetAutocompleteCount(count);

            var dbResult = m_userRepository.InvokeUnitOfWork(x => x.FindSingleUserGroups(0, countValue, query, includeSearchInUsers));
            var result   = m_mapper.Map <IList <UserGroupContract> >(dbResult);

            return(result);
        }
Пример #6
0
        public IList <UserDetailContract> GetUserAutocomplete(string query, int?count)
        {
            if (query == null)
            {
                query = string.Empty;
            }

            var countValue = PagingHelper.GetAutocompleteCount(count);

            var client = m_communicationProvider.GetAuthUserApiClient();

            var result = client.GetUserListAsync(0, countValue, query).GetAwaiter().GetResult();
            var userDetailContracts = m_mapper.Map <List <UserDetailContract> >(result.Items);

            m_userDetailManager.AddIdForExternalUsers(userDetailContracts);
            return(userDetailContracts);
        }