Beispiel #1
0
        public AllProfileMenuViewModelPages GetAllProfileMenus(int page)
        {
            var totalMenus = this.Context.ProfileMenus.Count();
            IEnumerable <ProfileMenu> getProfileMenus = this.Context.ProfileMenus.OrderBy(m => m.System).Skip((page - 1) * 10).Take(10).ToList();

            if (getProfileMenus == null)
            {
                return(null);
            }

            IEnumerable <AllProfileMenuViewModel> profileMenus = Mapper.Map <IEnumerable <ProfileMenu>, IEnumerable <AllProfileMenuViewModel> >(getProfileMenus);

            var allProfileMenus = new AllProfileMenuViewModelPages()
            {
                AllProfileMenus = profileMenus,
                TotalMenus      = totalMenus,
                CurrentPage     = page
            };

            return(allProfileMenus);
        }
Beispiel #2
0
        // GET: Menu
        public ActionResult Index(int page = 1)
        {
            AllProfileMenuViewModelPages listProfileMenus = service.GetAllProfileMenus(page);

            return(View(listProfileMenus));
        }