Ejemplo n.º 1
0
        private string GetFilterString(PersonApplicationLinkSearchModel searchModel)
        {
            var filterString = string.Empty;

            if (searchModel != null)
            {
                if (!string.IsNullOrWhiteSpace(searchModel.FilterText))
                {
                    if (string.IsNullOrWhiteSpace(filterString))
                    {
                        filterString = ODataFilterConstant.Filter + $"contains(Forename,'{searchModel.FilterText}') eq true";
                    }
                    else
                    {
                        filterString += $" or contains(Forename,'{searchModel.FilterText}') eq true";
                    }
                    filterString += $" or contains(Surname,'{searchModel.FilterText}') eq true";
                }
                AddPageSizeNumberAndSortingInFilterString(searchModel, ref filterString);
            }
            return(filterString);
        }
Ejemplo n.º 2
0
 public async Task <PersonApplicationLinkSearchModel> GetPersonApplicationLinks(PersonApplicationLinkSearchModel model)
 {
     return(await _personApplicationLinkApiClient.GetPersonApplicationLinks(model));
 }
Ejemplo n.º 3
0
        public async Task <PersonApplicationLinkSearchModel> GetPersonApplicationLinks(PersonApplicationLinkSearchModel model)
        {
            var url    = ODataApiUri + "/PersonApplicationLink?" + GetFilterString(model);
            var result = await GetOdataResultFromApi(url);

            var searchResultCount = 0;

            if (result.Count != null)
            {
                int.TryParse(result.Count.ToString(), out searchResultCount);
            }
            model.TotalRows = searchResultCount;
            model.PersonApplicationLinkSearchResult.Clear();
            model.PersonApplicationLinkSearchResult.AddRange(result.Items.Select(item => JsonConvert.DeserializeObject <PersonApplicationLinkDto>(item.ToString())));
            return(model);
        }