Example #1
0
        public ActionResult ByCategory(int categoryid = 0, int page = 1, int pagesize = 3)
        {
            var albums          = new List <Album>();
            var Pagination      = albumRepository.CalculatePages(categoryid, pagesize);
            var currentCategory = categoryRepository.GetbyId(categoryid);

            if (categoryid == 0)
            {
                albums = albumRepository.GetList(page, pagesize);
            }
            else
            {
                albums = albumRepository.GetByCategory(categoryid, page, pagesize);
            }

            AlbumAuthorCategory albumAuthorCategory = new AlbumAuthorCategory
            {
                Albums          = albums,
                Categories      = CategoryList,
                Pagination      = Pagination,
                CurrentCategory = currentCategory
            };

            return(View("Index", albumAuthorCategory));
        }
Example #2
0
        public ActionResult SearchAlbum(string title, int page = 1, int pagesize = 3)
        {
            var albums     = albumRepository.SearchByTitle(title, page, pagesize);
            var Pagination = albumRepository.CalculatePagesForSearch(title, pagesize);

            AlbumAuthorCategory albumAuthorCategory = new AlbumAuthorCategory
            {
                Albums        = albums,
                Categories    = CategoryList,
                Pagination    = Pagination,
                SearchKeyword = title
            };

            return(View("Index", albumAuthorCategory));
        }
Example #3
0
        public ActionResult Index(int page = 1, int pagesize = 3)
        {
            var albums     = albumRepository.GetList(page, pagesize);
            var Pagination = albumRepository.CalculatePages(0, pagesize);



            AlbumAuthorCategory _albumAuthorCategory = new AlbumAuthorCategory
            {
                Albums     = albums,
                Categories = CategoryList,
                Pagination = Pagination
            };

            return(View(_albumAuthorCategory));
        }