public void OnGet(string searchString, int pageIndex = 1) { UserIndexVM = _userService.GetUserListVm(SearchString, UserRole, pageIndex); if (string.IsNullOrEmpty(HttpContext.Session.GetString("IDUser"))) { Response.Redirect("http://localhost:5000/Login"); } }
public IActionResult Index(string searchString, int pageIndex = 1, int pageSize = 5, int?status = null) { if (HttpContext.Session.GetInt32("LoginLevel") != 2) { ViewBag.checkLogin = 0; return(View("../Home/AddCart")); } IndexVm UserIndexVM = _userService.GetUserListVm(searchString, pageIndex, pageSize, status); ViewBag.pageSize = pageSize; ViewBag.status = status; return(View(UserIndexVM)); }