예제 #1
0
        public ActionResult BulletinsNextPage(BulletinsPageMetadata metadata)
        {
            // Use page metadata to retrieve bulletins
            var bulletins = BulletinService.List(metadata.Contract, 0);

            // Map pageable instance with page metadata
            var data = bulletins.ToBulletinViewModelList(new Pageable <BulletinViewModel>(metadata));//   MappingEngine.Map<IEnumerable<BulletinModel>, IPageable<BulletinViewModel>>(bulletins, new Pageable<BulletinViewModel>(metadata));

            return(PagedView(data, "_PagedBulletins"));
        }
예제 #2
0
        /// <summary>
        /// List of bulletins.
        /// </summary>
        public ActionResult Bulletins()
        {
            var model = new BulletinsViewModel();

            // Set metadata to be for ESS Web bulletins
            var metadata = new BulletinsPageMetadata {
                Contract = BulletinType.RJCP
            };

            // Get all ESS Web bulletins
            var bulletins = BulletinService.List(metadata.Contract, 0);

            // Map pageable instance with page metadata
            model.Bulletins = bulletins.ToBulletinViewModelList(new Pageable <BulletinViewModel>(metadata));//     MappingEngine.Map<IEnumerable<BulletinModel>, IPageable<BulletinViewModel>>(bulletins, new Pageable<BulletinViewModel>(metadata));

            return(View(model));
        }