protected void Page_Load(object sender, EventArgs e) { LoadSettings(); //totalPages = News.GetCountBySearch(siteSettings.SiteId, zoneId.ToString(), config.NewsType, -1, null, -1, -1, -1, null, null, null, null, null, string.Empty); int totalRow = News.GetCount(siteSettings.SiteId, -1, -1, -1, -1); lstNewsTop5 = News.GetPageBySearch(siteSettings.SiteId, null, 0, 1, null, -1, -1, -1, null, null, null, null, null, -1, -1, string.Empty, 1, totalRow).OrderByDescending(n => n.Viewed).Take(5).ToList(); lstNewsMostOfWeek = GetNewsMostOfWeek(); lstAuthorMostArticle = KLAuthor.GetAll().Where(a => a.IsActive == true).OrderByDescending(n => n.ArticleCount).Take(10).ToList(); if (like > 0) { KLNews news = KLNews.GetAll().Where(n => n.NewsID == like).SingleOrDefault(); news.LikeCount += 1; news.Save(); } }
private int GetAuthor(int userId) { var author = KLAuthor.GetAll().Where(a => a.UserID == userId).SingleOrDefault(); return(author.AuthorID); }
private void GetAllAuthor() { ddlAuthor.Items.Insert(0, new ListItem(ResourceHelper.GetResourceString("Resource", "All"), "0")); ddlAuthor.DataSource = KLAuthor.GetAll().Where(a => a.IsActive == true).ToList(); ddlAuthor.DataBind(); }