/// <summary> /// Get List of LocationViews. /// </summary> /// <param name="pageNumber">Page Number.</param> /// <param name="pageSize">Items count per page.</param> /// <param name="loadParents">Enable or Disable loading the Parents objects.</param> /// <param name="loadChilds">Enable or Disable loading the Childs objects.</param> /// <param name="searchFor">Search text as per the 'Title' field.</param> /// <returns>Get List of LocationViews.</returns> public APILocationViewResponseModels.GetLocationViewsList GetLocationViewsList(string searchFor, bool loadLocations, int pageNumber, int pageSize) { APILocationViewResponseModels.GetLocationViewsList result = new APILocationViewResponseModels.GetLocationViewsList(); IPagedList <LocationView> locationViewsPL = uof_Repositories.repoLocationViews.GetPagedList(searchFor, pageNumber, pageSize); List <LocationView> locationViews = locationViewsPL.ToList(); List <APILocationView> listAPILocationViews = new List <APILocationView>(); foreach (LocationView locationView in locationViews) { APILocationView apiLocationView = TypesMapper.APILocationViewAdapter.fromLocationView(locationView, loadLocations); listAPILocationViews.Add(apiLocationView); } result.Views = listAPILocationViews; PagingInfoResponseModel pagingInfo = new PagingInfoResponseModel(); pagingInfo.CurrentPage = locationViewsPL.PageNumber; pagingInfo.ItemsPerPage = locationViewsPL.PageSize; pagingInfo.ItemsCount = locationViewsPL.TotalItemCount; pagingInfo.PagesCount = locationViewsPL.PageCount; result.PagingInfo = pagingInfo; return(result); }
public async Task <APILocationViewResponseModels.GetLocationViewsList> GetLocationViewsWithWarningsListAsync(APILocationViewRequestModels.GetLocationViewsList rm) { string strResult = await HttpPost("/api/LocationViews/GetLocationViewsWithWarningsList", JsonConvert.SerializeObject(rm)); APILocationViewResponseModels.GetLocationViewsList result = (APILocationViewResponseModels.GetLocationViewsList)JsonConvert.DeserializeObject(strResult, typeof(APILocationViewResponseModels.GetLocationViewsList)); return(result); }
private async void btnGetLocationViews_Click(object sender, EventArgs e) { Initialize(); APILocationViewRequestModels.GetLocationViewsList model = new APILocationViewRequestModels.GetLocationViewsList(); model.LoadLocations = true; model.PageNumber = 1; model.PageSize = 1; model.Token = Guid.Parse(txtToken.Text); APILocationViewResponseModels.GetLocationViewsList views = await uow.LocationViewsService.GetListAsync(model); gv1.DataSource = views.Views; }