Example #1
0
 public ActionResult Index(CatalogueViewTypeEnum viewType, Guid? genreId, string searchQuery,
                           int lastRowIndex = 0)
 {
     CatalogueModel model = GetDataModel(viewType, genreId, searchQuery, lastRowIndex);
     if (!string.IsNullOrEmpty(searchQuery) && model.FrontViewTotalCount == 0 && model.BackViewTotalCount > 0)
     {
         return RedirectToAction("Index", "Catalogue", new { viewType = viewType == CatalogueViewTypeEnum.Books ? CatalogueViewTypeEnum.Authors.ToString().ToLower() : CatalogueViewTypeEnum.Books.ToString().ToLower(), genreId, searchQuery });
     }
     return View(model);
 }
Example #2
0
 private CatalogueModel GetDataModel(CatalogueViewTypeEnum viewType, Guid? genreId, string searchQuery,
                                     int lastRowIndex = 0)
 {
     if (string.IsNullOrEmpty(searchQuery))
         return DataService.GetCatalogueModel(viewType, genreId, lastRowIndex);
     return DataService.GetCatalogueModel(viewType, searchQuery, lastRowIndex);
 }
Example #3
0
 public PartialViewResult CatalogueItems(CatalogueViewTypeEnum viewType, Guid? genreId, string searchQuery,
                                         int lastRowIndex = 0)
 {
     CatalogueModel model = GetDataModel(viewType, genreId, searchQuery, lastRowIndex);
     return PartialView(model);
 }