Beispiel #1
0
        // GET: UserManager
        public ActionResult Index(int?page)
        {
            // Show message
            if (Session["mes"] != null)
            {
                ViewBag.message = Session["mes"];
                Session.Remove("mes");
            }
            if (Session["mes_er"] != null)
            {
                ViewBag.message_er = Session["mes_er"];
                Session.Remove("mes_er");
            }

            ViewBag.Active = "manager";
            CustomPrincipal prin     = (CustomPrincipal)User;
            IPagedList      ListUser = null;

            if (prin.ROLE.Equals(ConstanAppkey.ADMIN()))
            {
                ListUser = userModels.GetItems(page ?? 1, ConstanAppkey.PAGESIZE());
            }
            else if (prin.ROLE.Equals(ConstanAppkey.MOD()))
            {
                ListUser = userModels.GetItemsMod(page ?? 1, ConstanAppkey.PAGESIZE(), prin);
            }
            return(View(ListUser));
        }
        // GET: Search
        public ActionResult Index(string keySearch, int?page)
        {
            IPagedList ListPost = postsModels.GetItemsSearch(keySearch, page ?? 1, ConstanAppkey.PAGESIZE());

            ViewBag.keySearch = keySearch;
            return(View(ListPost));
        }
        // GET: Categories
        public ActionResult Index(int?page)
        {
            // Show message
            if (Session["mes"] != null)
            {
                ViewBag.message = Session["mes"];
                Session.Remove("mes");
            }
            if (Session["mes_er"] != null)
            {
                ViewBag.message_er = Session["mes_er"];
                Session.Remove("mes_er");
            }

            IPagedList ListCategories = categoriesModels.GetItems(page ?? 1, ConstanAppkey.PAGESIZE());

            return(View(ListCategories));
        }