/// <summary> /// Displays a list of all locations in the system. /// </summary> /// <param name="page">Page to display. Default is 1.</param> /// <returns>View with ViewModel.</returns> public ActionResult LocationIndex(int page = 1) { PageInfo pagingInfo = new PageInfo { CurrentPage = page, ItemsPerPage = pageSize, TotalItems = repo.pointCount() }; PointListViewModel model = new PointListViewModel { Points = repo.getAllPoints(pageSize, (page - 1) * pageSize), PagingInfo = pagingInfo }; return View(model); }
public ActionResult orgLocations(string userName, int orgId, int page = 1) { if (!authRepo.userCanManageOrg(userName, orgId)) { return RedirectToAction(actionName: "LogOn", controllerName: "Account"); } repo.initialize(orgId); ViewBag.userChangeContent = authRepo.hasOrgContentWritePermissions(userName, orgId); ViewBag.organizationName = repo.orgName(); ViewBag.organizationID = orgId.ToString(); List<Point> listLocation = repo.getAllPoints(pageSize, (page - 1) * pageSize).ToList(); PageInfo pagingInfo = new PageInfo { CurrentPage = page, ItemsPerPage = pageSize, TotalItems = repo.pointCount() }; PointListViewModel model = new PointListViewModel { Points = listLocation, PagingInfo = pagingInfo }; return View(model); }