Exemplo n.º 1
0
        public static async Task <LG.Data.Models.Members.SortedSearchResults> GetClientMembers(
            LG.Data.Models.Members.SortedSearchRequest entityRequest)
        {
            var client = LG.Services.ClientConnection.GetMssConnection();
            var result = new LG.Data.Models.Members.SortedSearchResults();

            try
            {
                client.Open();
                var response =
                    await client.GetMembersInOneSortedPageUsingFilterAsync(
                        new GetMembersInOneSortedPageUsingFilterRequest()
                {
                    Filter = new GetMembersInOneSortedPageFilter()
                    {
                        ClientRID            = entityRequest.ClientID,
                        PageSize             = entityRequest.PageSize,
                        PageIndex            = entityRequest.PageIndex,
                        SortOrder            = entityRequest.SortOrder,
                        IsActiveMemberFilter = entityRequest.IsActiveMember
                    }
                });

                result.TotalPages       = response.TotalPageCount;
                result.Records          = response.ListOfMemberRecords;
                result.TotalMemberCount = response.TotalMembersWithFilterCount;
            }
            catch (Exception ex)
            {
                result.IsError = true;
                result.Message = ex.ToString();
                client.Abort();
            }
            finally
            {
                client.Close();
            }
            return(result);
        }
Exemplo n.º 2
0
        public static async Task<LG.Data.Models.Members.SortedSearchResults> GetClientMembers(
            LG.Data.Models.Members.SortedSearchRequest entityRequest)
        {
            var client = LG.Services.ClientConnection.GetMssConnection();
            var result = new LG.Data.Models.Members.SortedSearchResults();
            try
            {
                client.Open();
                var response =
                    await client.GetMembersInOneSortedPageUsingFilterAsync(
                        new GetMembersInOneSortedPageUsingFilterRequest()
                        {
                            Filter = new GetMembersInOneSortedPageFilter()
                            {
                                ClientRID = entityRequest.ClientID,
                                PageSize = entityRequest.PageSize,
                                PageIndex = entityRequest.PageIndex,
                                SortOrder = entityRequest.SortOrder,
                                IsActiveMemberFilter = entityRequest.IsActiveMember
                            }
                        });
                result.TotalPages = response.TotalPageCount;
                result.Records = response.ListOfMemberRecords;
                result.TotalMemberCount = response.TotalMembersWithFilterCount;
            }
            catch (Exception ex)
            {
                result.IsError = true;
                result.Message = ex.ToString();
                client.Abort();

            }
            finally
            {
                client.Close();
            }
            return result;
        }