private void LoadParams() { authorID = WebUtils.ParseInt32FromQueryString("id", authorID); if (authorID > -1) { author = new KLAuthor(authorID); } pagenum = WebUtils.ParseInt32FromQueryString("page", pagenum); news = KLNews.GetPageByAuthor(pagenum, pageSize, out totalPage, author.AuthorID, "", false, true, false).ToList(); }
private void PopulateControls() { List <KLNews> lst = KLNews.GetPageByAuthor(1, 10000, out totalpage, author.AuthorID, "", false, true, false); foreach (var item in lst) { News temp = new News(siteSettings.SiteId, item.NewsID); item.Title = temp.Title; item.Datepost = temp.StartDate; } ddlnew.DataSource = lst; ddlnew.DataBind(); ddlnew.SelectedValue = news.ToString(); }
private void grid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { grid.PagerStyle.EnableSEOPaging = false; bool isApplied = gridPersister.IsAppliedSortFilterOrGroup; int iCount = KLNews.GetCount(); int startRowIndex = isApplied ? 1 : grid.CurrentPageIndex + 1; int maximumRows = isApplied ? iCount : grid.PageSize; grid.VirtualItemCount = iCount; grid.AllowCustomPaging = !isApplied; List <KLNews> lst = KLNews.GetPageByAuthor(startRowIndex, maximumRows, out iCount, author.AuthorID, "", isdraft, isapproved, all); foreach (var item in lst) { News temp = new News(siteSettings.SiteId, item.NewsID); item.Title = temp.Title; item.Datepost = temp.StartDate; } grid.DataSource = lst; }