Exemple #1
0
        public ActionResult PriceList(int?page)
        {
            const int itemsOnPage = 15;
            int       pg          = page.HasValue ? page.Value : 1;
            int       totalActivityTypes;

            ActivityTypeDao      activityTypeDao          = new ActivityTypeDao();
            IList <ActivityType> listActivityTypesPerPage = activityTypeDao.GetActivityTypesPaged(itemsOnPage, pg, out totalActivityTypes);

            ViewBag.Pages       = (int)Math.Ceiling((double)totalActivityTypes / (double)itemsOnPage);
            ViewBag.CurrentPage = pg;

            return(View("PriceList", listActivityTypesPerPage));
        }
Exemple #2
0
        // GET: /Admin/ActivityTypes/
        public ActionResult Index(int?page)
        {
            const int itemsOnPage = 6;
            int       pg          = page.HasValue ? page.Value : 1;
            int       totalActivityTypes;

            ActivityTypeDao      activityTypeDao          = new ActivityTypeDao();
            IList <ActivityType> listActivityTypesPerPage = activityTypeDao.GetActivityTypesPaged(itemsOnPage, pg, out totalActivityTypes);

            ViewBag.Pages       = (int)Math.Ceiling((double)totalActivityTypes / (double)itemsOnPage);
            ViewBag.CurrentPage = pg;

            FitnessCentreUser user = new FitnessCentreUserDao().GetByLogin(User.Identity.Name);

            if (user.Role.Identificator == "staff")
            {
                return(View("IndexStaff", listActivityTypesPerPage));
            }

            return(View("Index", listActivityTypesPerPage));
        }