public void GetAllUserDescriptions(Action<PageResultDto<UserDescriptionDTO>, Exception> action, int pageSize, int pageIndex, Dictionary<string, string> sortBy, UserCriteria criteria) { var url = baseAddressUsers + "?PageSize=" + pageSize + "&PageIndex=" + pageIndex + getFilterUser(criteria); if (sortBy.Count > 0) url += "&SortBy=" + QueryConditionHelper.GetSortByQueryString(sortBy); WebClientHelper.Get(new Uri(url, UriKind.Absolute), action, MITD.Presentation.WebClientHelper.MessageFormat.Json, ApiConfig.CreateHeaderDic(userProvider.Token)); }
private string getFilterUser(UserCriteria userCriteria) { if (userCriteria == null) return string.Empty; var qs = string.Empty; if (!string.IsNullOrEmpty(userCriteria.Fname)) qs += "FirstName:" + userCriteria.Fname + ";"; if (!string.IsNullOrEmpty(userCriteria.Lname)) qs += "LastName:" + userCriteria.Lname + ";"; if (!string.IsNullOrEmpty(userCriteria.PartyName)) qs += "PartyName:" + userCriteria.PartyName + ";"; if (string.IsNullOrEmpty(qs)) return string.Empty; return "&Filter=" + qs; }