public ActionResult Categories(int id=-1, string category="All",int page =1)
{
ViewBag.category = category;
ViewBag.id = id;
var model = from m in db.Books
select m;
if (!category.ToLower().Equals("all"))
model = model.Where(q => q.CategoryID == id);
model = model.OrderByDescending(p => p.Date);
int CountPage = ((model.Count() - 1) / CountInPage) + 1;
ViewBag.CountPage = CountPage;
ViewBag.CurrPage = page;
model = model.Skip((page - 1) * CountInPage).Take(CountInPage);
return View(model);
}