public byte[] GenerateUserExcelBySearchCriteria(UserSearchCriteriaDTO searchCriteria, PagingInformation pageInfo)
        {
            //For excel export, we need to export all records.
            //So set the pageindex and pagesize to -1
            pageInfo.StartIndex = -1;
            pageInfo.PageSize   = -1;

            var list = getUserBySearchCriteria(searchCriteria, pageInfo);

            //Get excel export list
            var excelList = mapper.Map <IList <UserExportExcelModel> >(list);

            return(excelList.ToExcelContent());
        }
Exemple #2
0
        /// <summary>
        /// This call searches in user with search and select DTO system. This method is deprecated. Use api/v3/UserSearches
        /// </summary>
        /// <exception cref="ACUtils.AXRepository.ArxivarNext.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="body"></param>
        /// <returns>Task of ApiResponse (List&lt;RowSearchResult&gt;)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <List <RowSearchResult> > > UserSearchPostSearchAsyncWithHttpInfo(UserSearchCriteriaDTO body)
        {
            // verify the required parameter 'body' is set
            if (body == null)
            {
                throw new ApiException(400, "Missing required parameter 'body' when calling UserSearchApi->UserSearchPostSearch");
            }

            var    localVarPath         = "/api/UserSearches";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new List <KeyValuePair <String, String> >();
            var    localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json",
                "text/json",
                "application/xml",
                "text/xml",
                "application/x-www-form-urlencoded"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json",
                "text/json",
                "application/xml",
                "text/xml"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (body != null && body.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
            }
            else
            {
                localVarPostBody = body; // byte array
            }
            // authentication (Authorization) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization")))
            {
                localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization");
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                            Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("UserSearchPostSearch", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <List <RowSearchResult> >(localVarStatusCode,
                                                             localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
                                                             (List <RowSearchResult>) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List <RowSearchResult>))));
        }
Exemple #3
0
        /// <summary>
        /// This call searches in user with search and select DTO system. This method is deprecated. Use api/v3/UserSearches
        /// </summary>
        /// <exception cref="ACUtils.AXRepository.ArxivarNext.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="body"></param>
        /// <returns>Task of List&lt;RowSearchResult&gt;</returns>
        public async System.Threading.Tasks.Task <List <RowSearchResult> > UserSearchPostSearchAsync(UserSearchCriteriaDTO body)
        {
            ApiResponse <List <RowSearchResult> > localVarResponse = await UserSearchPostSearchAsyncWithHttpInfo(body);

            return(localVarResponse.Data);
        }
Exemple #4
0
        /// <summary>
        /// This call searches in user with search and select DTO system. This method is deprecated. Use api/v3/UserSearches
        /// </summary>
        /// <exception cref="ACUtils.AXRepository.ArxivarNext.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="body"></param>
        /// <returns>List&lt;RowSearchResult&gt;</returns>
        public List <RowSearchResult> UserSearchPostSearch(UserSearchCriteriaDTO body)
        {
            ApiResponse <List <RowSearchResult> > localVarResponse = UserSearchPostSearchWithHttpInfo(body);

            return(localVarResponse.Data);
        }
        public IList <UserSearchResultDTO> getUserBySearchCriteria(UserSearchCriteriaDTO searchCriteria, PagingInformation pageInfo)
        {
            var query = from cl in conciergeLoginRepo.GetAll()
                        join h in hotelRepo.GetAll() on cl.HOTEL_CODE equals h.Hotel_Code
                        //select new { cl };
                        select new UserSearchResultDTO()
            {
                id          = cl.ID,
                HotelCode   = cl.HOTEL_CODE,
                ConciergeID = cl.ConciergeID,
                FName       = cl.FName,
                LName       = cl.LName,
                Phone       = cl.Phone,
                IsActive    = cl.Active,
                AccessLevel = cl.AccessLevel,
                DateFormat  = h.DateFormat,
            };

            //Hotel Name
            if (!string.IsNullOrWhiteSpace(searchCriteria.HotelName))
            {
                //query = query.Where(p => p.cl.HOTEL_CODE == searchCriteria.HotelName);
                query = query.Where(p => p.HotelCode == searchCriteria.HotelName);
            }

            pageInfo.RecordsTotal = query.Count();

            //Setup Order, the order that passed in like "columnname asc, columnname desc"
            if (!string.IsNullOrWhiteSpace(pageInfo.OrderColumn))
            {
                var orderString = TransformOrder(pageInfo.OrderColumn.TrimEnd(','));
                query = query.OrderBy(orderString);
            }
            else
            {
                //query = query.OrderByDescending(p => p.cl.ID);
                query = query.OrderByDescending(p => p.id);
            }

            //Setup paging
            if (pageInfo.PageSize == -1 && pageInfo.StartIndex == -1)
            {
            }
            else
            {
                query = query.Skip(pageInfo.StartIndex).Take(pageInfo.PageSize);
            }
            //Get column that we need
            //var list = query.Select(x => new UserSearchResultDTO()
            //{
            //    id = x.cl.ID,
            //    HotelCode = x.cl.HOTEL_CODE,
            //    ConciergeID = x.cl.ConciergeID,
            //    FName = x.cl.FName,
            //    LName = x.cl.LName,
            //    Phone = x.cl.Phone,
            //    IsActive = x.cl.Active,
            //    AccessLevel = x.cl.AccessLevel

            //}).ToList();



            //return list;
            return(query.ToList());
        }
Exemple #6
0
        /// <summary>
        /// This call searches in user with search and select DTO system.  This call could not be compatible with some programming language, in this case use the call api/UserSearches
        /// </summary>
        /// <exception cref="ACUtils.AXRepository.ArxivarNext.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="body"></param>
        /// <returns>Task of Object</returns>
        public async System.Threading.Tasks.Task <Object> UserSearchV3PostSearchAsync(UserSearchCriteriaDTO body)
        {
            ApiResponse <Object> localVarResponse = await UserSearchV3PostSearchAsyncWithHttpInfo(body);

            return(localVarResponse.Data);
        }
Exemple #7
0
        /// <summary>
        /// This call searches in user with search and select DTO system.  This call could not be compatible with some programming language, in this case use the call api/UserSearches
        /// </summary>
        /// <exception cref="ACUtils.AXRepository.ArxivarNext.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="body"></param>
        /// <returns>Object</returns>
        public Object UserSearchV3PostSearch(UserSearchCriteriaDTO body)
        {
            ApiResponse <Object> localVarResponse = UserSearchV3PostSearchWithHttpInfo(body);

            return(localVarResponse.Data);
        }