public void OnGet() { Start = _paginatedMetaService.GetMetaData(100, 2, 4); Full = _paginatedMetaService.GetMetaData(100, 5, 4); End = _paginatedMetaService.GetMetaData(100, 25, 4); Partial = _paginatedMetaService.GetMetaData(3, 2, 1); Zero = _paginatedMetaService.GetMetaData(0, 0, 1); }
public IActionResult ImagePanel(int Id = 1) { var Images = ImageRepository.GetAll().Skip((Id - 1) * 10).Take(10).ToList(); var totalNumberInCollection = 5; var itemsPerPage = 2; ViewBag.PaginatedMeta = _paginatedMetaService.GetMetaData(totalNumberInCollection, Id, itemsPerPage); return(View("DrowPictures", Images)); }
public IActionResult Index() { ViewBag.Start = _paginatedMetaService.GetMetaData(100, 2, 4); ViewBag.Full = _paginatedMetaService.GetMetaData(100, 5, 4); ViewBag.End = _paginatedMetaService.GetMetaData(100, 24, 4); ViewBag.Partial = _paginatedMetaService.GetMetaData(3, 2, 1); ViewBag.Zero = _paginatedMetaService.GetMetaData(0, 0, 1); return(View()); }
public IActionResult Index() { return(View(new HomeViewModel { Start = _paginatedMetaService.GetMetaData(100, 2, 4), Full = _paginatedMetaService.GetMetaData(100, 5, 4), End = _paginatedMetaService.GetMetaData(100, 25, 4), Subset = _paginatedMetaService.GetMetaData(3, 2, 1), Zero = _paginatedMetaService.GetMetaData(0, 0, 1) })); }
// GET: Blog public ActionResult Index(int page = 1) { var post = _postService.GetAllPaged(4, page).ToList(); ViewBag.PaginatedMeta = _paginatedMetaService.GetMetaData(_postService.GetTotalNumberOfPosts(), page, 4); ViewBag.Description = "Trang " + page + ". "; ViewBag.Header = "Tin tức"; ViewBag.Title = "Tin tức"; ViewBag.Pager = "Tin tức"; ViewBag.Selected = "blog"; ViewBag.Categories = _categoryService.GetAll(); ViewBag.Tags = _tagService.GetAll(); ViewBag.PopularPosts = _postService.GetPopularPosts(); ViewBag.NewPosts = _postService.GetAll(true, false, false, 4).ToList(); return(View("~/Views/ArchivePost/Index.cshtml", post)); }
public IActionResult GetPostCollection(int page = 1, SortType sotr = SortType.DateDEC) { var collection = _postLogic.GetPostCollection(new List <SortFiltr> { new SortFiltr { Name = "SortFiltr", SortType = sotr, Type = FilterType.SortFiltr } }, page: page); ViewBag.PaginatedMeta = _paginatedMetaService.GetMetaData(collection.Item1, page, _itemsPerPage); return(View("PostCollection", collection.Item2)); }
// GET: Blog public ActionResult Index(int page = 1) { var post = _postService.GetAllPaged(4, page).ToList(); ViewBag.PaginatedMeta = _paginatedMetaService.GetMetaData(_postService.GetTotalNumberOfPosts(), page, 4); ViewBag.Description = $"Pioneer Code blog archives page {page}. Chad Ramos talks about .NET, C#, The Web, Open Source, Programming and more."; ViewBag.Header = "Blog"; ViewBag.Title = "Blog"; ViewBag.Pager = "blog"; ViewBag.Selected = "blog"; ViewBag.Categories = _categoryService.GetAll(); ViewBag.Tags = _tagService.GetAll(); ViewBag.PopularPosts = _postService.GetPopularPosts(); ViewBag.NewPosts = _postService.GetAll(true, false, false, 4).ToList(); return(View("~/Views/ArchivePost/Index.cshtml", post)); }
public ActionResult Index(SearchRequest request) { var searchResults = _searchService.SearchPosts(request.Query, 5, request.Page); ViewBag.PaginatedMeta = _paginatedMetaService.GetMetaData(searchResults.TotalMatchingPosts, request.Page, 5); ViewBag.Description = "Tìm kiếm"; ViewBag.Header = "Search"; ViewBag.Title = "Tìm kiếm"; ViewBag.Selected = "search"; ViewBag.Query = request.Query; ViewBag.TotalQueryMatches = searchResults.TotalMatchingPosts; ViewBag.Categories = _categoryService.GetAll(); ViewBag.Tags = _tagService.GetAll(); ViewBag.PopularPosts = _postService.GetPopularPosts(); ViewBag.NewPosts = _postService.GetAll(true, false, false, 4).ToList(); return(View("~/Views/Search/Index.cshtml", searchResults.Posts)); }
public ActionResult Index(SearchRequest request) { var searchResults = _searchService.SearchPosts(request.Query, 5, request.Page); ViewBag.PaginatedMeta = _paginatedMetaService.GetMetaData(searchResults.TotalMatchingPosts, request.Page, 5); ViewBag.Description = "Pioneer Code search results for \"" + request.Query + "\", page " + request.Page + ". " + "Chad Ramos talks about .NET, C#, The Web, Open Source, Programming and more."; ViewBag.Header = "Search"; ViewBag.Title = "Search"; ViewBag.Selected = "search"; ViewBag.Query = request.Query; ViewBag.TotalQueryMatches = searchResults.TotalMatchingPosts; ViewBag.Categories = _categoryService.GetAll(); ViewBag.Tags = _tagService.GetAll(); ViewBag.PopularPosts = _postService.GetPopularPosts(); ViewBag.NewPosts = _postService.GetAll(true, false, false, 4).ToList(); return(View("~/Views/Search/Index.cshtml", searchResults.Posts)); }
public async Task <IActionResult> FindExhibition(int page = 1) { var Date = await FExhibitionServices.GetAllExhibitionAsync(); var Obj = new WebEvento.ViewModel.InformationViewModel(); Obj.ExhibitionList = Date.ToList(); var totalNumberInCollection = Obj.ExhibitionList.Count; var itemsPerPage = 5; ViewBag.PaginatedMeta = _paginatedMetaService.GetMetaData(totalNumberInCollection, page, itemsPerPage); return(View(Obj)); }
/// <summary> /// Method: GetPGRowsAsync /// Description: It is used to get postgres sync data by page wise. /// </summary> /// <param name="id"></param> /// <param name="page"></param> /// <param name="isRowsRead"></param> /// <param name="connectorConfig"></param> /// <returns></returns> private async Task <IList <IDictionary <string, object> > > GetPGRowsAsync(int id, int?page, bool isRowsRead, ConnectorConfig connectorConfig, string ctid) { IEnumerable <dynamic> etDataRows = null; IList <IDictionary <string, object> > pgRows = new List <IDictionary <string, object> >(); try { var ccid = HttpContext.GetClaimValue(ClaimTypes.NameIdentifier); if (!string.IsNullOrEmpty(ccid) && id > 0) { //Get ConnectorConfig if (connectorConfig == null) { connectorConfig = _connectorRepository.Get <ConnectorConfig>(ccid, id, IsSetConfig: true); } //Get the current page int currentPage = page.HasValue ? (int)page : 1; int totalRecords = 0; int marked_for_delete_count = 0; if (connectorConfig != null) { ViewBag.connectorConfig = connectorConfig; //Get total record //totalRecords = SyncRepository.GetPGRecordCountByName(connectorConfig); totalRecords = _syncRepository.GetCTIndexTableCount(ccid, id); //marked_for_delete_count = _syncRepository.GetMarkedForDeleteCount(ccid, id); ViewBag.marked_for_delete_count = marked_for_delete_count; ViewData["count_" + id.ToString()] = totalRecords; //Read sync data if isRowsRead flag is true if (String.IsNullOrEmpty(ctid)) { if (isRowsRead && totalRecords > 0) { //Get page settings ViewData[id.ToString()] = _paginatedMetaService.GetMetaData(totalRecords, currentPage, PAGESIZE); //Get sync data by pageNo, ccid, connectorId and limit //etDataRows = SyncRepository.FindPGRowsByPageNo(connectorConfig, currentPage, PAGESIZE); pgRows = await _syncRepository.GetParentRecordsPageByPageForReviewAndDelete(connectorConfig.ccid, id, currentPage, PAGESIZE); //pgRows = result.Cast<IDictionary<string, object>>().ToList(); //pgRows = SyncRepository.GetParentRecordsPageByPageForReviewAndDelete(connectorConfig, currentPage, PAGESIZE); } } else { pgRows = await _syncRepository.GetChildRecordsByParentForReviewAndDelete(connectorConfig.ccid, id, ctid); } } } } catch (Exception ex) { if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == Environments.Development) { _logger.LogError(ex.Message, ex); } else { Console.WriteLine("ERROR: {0}", ex.Message); } } return(pgRows); }