private static void ShowAllUsers() { IEnumerable <User> users = usersLogic.GetAll(); foreach (User user in users) { ShowUser(user); } Console.WriteLine(); }
public ActionResult Index(int page = 1) { IEnumerable <User> Users; int PageSize = 10; int TotalCount = Logic.CountUsers(); Users = Logic.GetAll(null, o => o.OrderBy(i => i.Id), "Roles", PageSize, (PageSize * (page - 1))); int pageCount = (TotalCount % PageSize == 0 ? TotalCount / PageSize : (TotalCount / PageSize + 1)); var result = new PagedListModel <User>(Users, TotalCount, pageCount, page); return(View(result)); }
public List <User> GetUsers() { try { var users = _userLogic.GetAll().OrderBy(us => us.Login); return(users.ToList()); } catch (SqlException ex) { Logger.LogShortErrorInfo(ex); return(null); } }
public IActionResult Index() { return(View(_usersLogic.GetAll())); }