public ActionResult Experiencias(int? Page)
 {
     CategoryModel cate = catRepository.GetByName("Experiencias");
     if (cate == null)
     {
         return RedirectToAction("Lista");
     }
     ArticulosListModel model = new ArticulosListModel();
     model.ActualPage = (Int32)((Page == null || Page == 0 || Page == 1) ? 1 : Page);
     int count = repository.GetCount(cate.Id);
     model.AmtPages = count % 10 == 0 ? count / 10 : (int)(Math.Round(Convert.ToDouble(count / 10), 0) + 1);
     model.Categories = catRepository.GetByType(CategoryType.Tag);
     model.ContentList = repository.GetAll(Page, cate.Id);
     model.FeatureList = repository.GetFeatured();
     model.RecentList = repository.GetRecent();
     ViewBag.Title = "Viajero por definición";
     TempData["Action"] = "Experiencias";
     model.ActionToGo = "Experiencias";
     TempData["Controler"] = "Articulos";
     TempData["Param"] = model.ActualPage;
     TempData["Category"] = "Experiencias";
     TempData["NombreCategoria"] = "Experiencias";
     return View("Lista", model);
 }
 public ActionResult Lista(int? Page, int? Category)
 {
     ArticulosListModel model = new ArticulosListModel();
     model.ActualPage = (Int32)((Page == null || Page == 0 || Page == 1) ? 1 : Page);
     int count = repository.GetCount(null);
     model.AmtPages = count % 10 == 0 ? count / 10 : (int)(Math.Round(Convert.ToDouble(count / 10), 0) + 1);
     model.Categories = catRepository.GetByType(EntityModels.CategoryType.Tag);
     model.ContentList = repository.GetAll(Page, Category);
     model.FeatureList = repository.GetFeatured();
     model.RecentList = repository.GetRecent();
     ViewBag.Title = "Viajero por definición";
     TempData["Action"] = "Lista";
     model.ActionToGo = "Lista";
     TempData["Controler"] = "Articulos";
     TempData["Param"] = model.ActualPage;
     TempData["Category"] = Category;
     TempData["NombreCategoria"] = Category == null ? "Bienvenido!" : catRepository.Get((int)Category).Name;
     return View(model);
 }
示例#3
0
 public ActionResult Search(int page, string searchCriteria)
 {
     ArticulosListModel model = new ArticulosListModel();
     model.ActualPage = 1;
     int count = repository.GetCountSearch(searchCriteria);
     model.AmtPages = count % 10 == 0 ? count / 10 : (int)(Math.Round(Convert.ToDouble(count / 10), 0) + 1);
     model.Categories = catRepository.GetByType(EntityModels.CategoryType.Tag);
     model.ContentList = repository.GetAllSearch(1, searchCriteria);
     model.FeatureList = repository.GetFeatured();
     model.RecentList = repository.GetRecent();
     ViewBag.Title = "Viajero por definición";
     TempData["Action"] = "Search";
     model.ActionToGo = searchCriteria;
     TempData["Controler"] = "Servicio";
     TempData["Param"] = model.ActualPage;
     TempData["SearchCrit"] = searchCriteria;
     return View(model);
 }