public async Task <MasterPageViewModel> TotalGetAllPaging(GetMemberPagingRequest request) { var sessions = Core.Token; _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", sessions); var response = await _client.GetAsync($"/api/members/TotalGetAllPaging?pageIndex=" + $"{request.PageIndex}&pageSize={request.PageSize}&IpiNumber={request.IpiNumber}" + $"&InternalNo={request.IpEnglishName}&ISWC_NO={request.IpEnglishName}" + $"&Society={request.Society}&NameType={request.NameType}" ); var body = await response.Content.ReadAsStringAsync(); var dataReturn = JsonConvert.DeserializeObject <MasterPageViewModel>(body); if (dataReturn != null) { return(dataReturn); } else { MasterPageViewModel data = new MasterPageViewModel { TotalRecordes = 0 }; return(data); } }
public object Any(GetMemberPagingRequest request) { var repo = new MemberRepository().GetMemberPaging(request.PageSize, request.PageNumber, request.ApiKey); AutoMapper.Mapper.CreateMap<MemberModel, MemberDetailModel>(); AutoMapper.Mapper.CreateMap<MemberListResponseModel, MemberListResponse>() .ForMember(x => x.Members, a => a.MapFrom(m => m.Members)); return AutoMapper.Mapper.Map<MemberListResponse>(repo); }
public async Task <ApiResult <PagedResult <MemberViewModel> > > GetAllPaging(GetMemberPagingRequest request) { var sessions = Core.Token; _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", sessions); var response = await _client.GetAsync($"/api/members/GetAllPaging?pageIndex=" + $"{request.PageIndex}&pageSize={request.PageSize}&IpiNumber={request.IpiNumber}" + $"&InternalNo={request.IpEnglishName}&ISWC_NO={request.IpEnglishName}" + $"&Society={request.Society}&NameType={request.NameType}" ); var body = await response.Content.ReadAsStringAsync(); var dataReturn = JsonConvert.DeserializeObject <PagedResult <MemberViewModel> >(body); if (dataReturn != null) { ApiSuccessResult <PagedResult <MemberViewModel> > data = new ApiSuccessResult <PagedResult <MemberViewModel> > { IsSuccessed = true, Message = "search work is successful", ResultObj = dataReturn }; return(data); } else { ApiSuccessResult <PagedResult <MemberViewModel> > data = new ApiSuccessResult <PagedResult <MemberViewModel> > { IsSuccessed = false, Message = "search work is failure", ResultObj = null }; return(data); } }
public async Task <MasterPageViewModel> TotalGetAllPaging(GetMemberPagingRequest request) { var data = await _apiClient.TotalGetAllPaging(request); return(data); }
public async Task <ApiResult <PagedResult <MemberViewModel> > > GetAllPaging(GetMemberPagingRequest request) { var data = await _apiClient.GetAllPaging(request); return(data); }