public AnnouandP ListAnnounce(AnnouandP Annou) { Annou.AnnouItems = getAnnous(); //过滤 Annou.AnnouItems = Annou.AnnouItems .Where(m => m.Title.Contains(CNTS(Annou.STitle)) && m.FromName.Contains(CNTS(Annou.SuserName)) ).ToList(); //分页 Annou.page.TotalCount = Annou.AnnouItems.Count(); Annou.page.PageNum = (int)Math.Ceiling((double)(Annou.page.TotalCount) / Annou.page.IPageSize); Annou.AnnouItems = Annou.AnnouItems.OrderByDescending(m => m.Prop).ThenByDescending(m => m.Time).Skip(Annou.page.IPageSize * (Annou.page.CurIndex - 1)).Take(Annou.page.IPageSize).ToList(); return(Annou); }
public JsonResult AllAnnounce(AnnouandP Annou) { Annou.page.IPageSize = AnnouncePageSize; return(Json(ListAnnounce(Annou))); }
// GET: Announce public ActionResult Index(AnnouandP Annou) { Annou.page.IPageSize = (int)Annou.page.PageSize + 8; return(View(ListAnnounce(Annou))); }