Пример #1
0
        private static void ShowAllUsers()
        {
            IEnumerable <User> users = usersLogic.GetAll();

            foreach (User user in users)
            {
                ShowUser(user);
            }

            Console.WriteLine();
        }
Пример #2
0
        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);
     }
 }
Пример #4
0
 public IActionResult Index()
 {
     return(View(_usersLogic.GetAll()));
 }