// GET: Decor public ActionResult Show(int?page, int?month, int?year, string group = "TRUNGBAY", string branch = "", string agency = "") { ViewBag.GroupDecor = db.DecorGroups.ToList(); int pageSize = 30; int pageNumber = (page ?? 1); if (month == null) { month = DateTime.Now.Month; } if (year == null) { year = DateTime.Now.Year; } ViewBag.GroupChoose = group; ViewBag.Month = month; ViewBag.Branch = branch; ViewBag.Year = year; ViewBag.Agency = agency; branch = "%" + branch + "%"; agency = "%" + agency + "%"; var data = db.get_decor_info(branch, agency, group, month, year).ToList(); return(View(data.OrderByDescending(p => p.DDay).ToPagedList(pageNumber, pageSize))); }