public IActionResult Index() { var model = new PhotoGalleryViewModel(); model.PhotoGalleryImages = _photoGalleryImageData.GetAll(); return(View(model)); }
// GET: /<controller>/ public async Task <IActionResult> Index(int pageNumber = 1, int pageSize = 9) { try { var galleryItems = await this.galleryRetriever.GetGalleryItemsPagedAsync(pageNumber, pageSize); var viewModel = new PhotoGalleryViewModel(galleryItems); return(View(viewModel)); } catch (Exception ex) { if (base.log.IsErrorEnabled) { base.log.Error(ex); } return(base.NotFound()); } }
// GET: Shop public ActionResult Index(string sreachProduct, int?MinimumPrice, int?MaximumPrice, int?compID, int?CataId, int?SortBy, int?pageNo) { CategoriesHandler categoriesHandler = new CategoriesHandler(); ProductHandler productHandler = new ProductHandler(); CompaniesHandler companiesHandler = new CompaniesHandler(); var pageSize = 9; PhotoGalleryViewModel model = new PhotoGalleryViewModel(); model.FeaturedCatagories = categoriesHandler.GetAllCategoriesForShop(); model.FeaturedCompanieses = companiesHandler.GetAllCompanieses(); model.searchITem = sreachProduct; if (SortBy.HasValue) { model.SortBy = SortBy.Value; } if (CataId.HasValue) { model.categoryId = CataId.Value; } if (compID.HasValue) { model.companyId = compID.Value; } // model.MaximumPrice = ProductsService.Instance.GetMaximumPrice(); pageNo = pageNo.HasValue ? pageNo.Value > 1 ? pageNo.Value : 1 : 1; model.ProductList = productHandler.GetShowAllProducts(sreachProduct, MinimumPrice, MaximumPrice, CataId, SortBy, pageNo.Value, pageSize, compID); int TotalItemCount = productHandler.GetAllProductsCount(sreachProduct, MinimumPrice, MaximumPrice, CataId, SortBy, compID); model.pager = new Pager(TotalItemCount, pageNo, pageSize); return(View(model)); }
/// <summary> /// Gets photos for gallery /// </summary> /// <returns></returns> public ActionResult _ImageGallery() { var vm = new PhotoGalleryViewModel { Photos = new List <DisplayPhotosViewModel>() }; var photos = db.Photos.Where(x => x.InLandingPageCarousel == true); foreach (var i in photos) { var photoToAdd = new DisplayPhotosViewModel() { Id = i.PhotoID, Data = i.PhotoData, Description = i.PhotoDesc, Title = i.PhotoTitle, Credit = i.Credit }; vm.Photos.Add(photoToAdd); } return(View(vm)); }
public ActionResult Index(int page = 1) { int pageSize = 15; PhotoGalleryViewModel vm = new PhotoGalleryViewModel { Galleries = _gRepo.GalAll() .OrderByDescending(x => x.ID) .ToList() .Skip((page - 1) * pageSize) .Take(pageSize), PagingInfo = new PagingInfo { TotalItems = _gRepo.Galleries.Count(), ItemsPerPage = pageSize, CurrentPage = page }, Images = _gRepo.Images.ToList() }; return(View(vm)); }
public PhotoGallary() { InitializeComponent(); BindingContext = photoGalleryViewModel = new PhotoGalleryViewModel(); }
public JikanPopupWindow(PhotoGalleryViewModel parent) { DataContext = new JikanPopupViewModel(parent); InitializeComponent(); }