Пример #1
0
        public ActionResult Index(int?page)
        {
            int pagesize = 1;
            int pagenumber;

            var works = workRepository.GetAll().Reverse();
            var user  = profileRepository.GetByID(WebSecurity.CurrentUserId);

            if (user.Profile != null)
            {
                pagesize = user.Profile.NumerOfResults;
                if (pagesize == 0)
                {
                    pagesize = 10;
                }
            }

            pagenumber = (page ?? 1);
            return(View(works.ToPagedList(pagenumber, pagesize)));
        }
Пример #2
0
 public List <Work> ShowAllWork()
 {
     return(_repository.GetAll());
 }