public ActionResult Index()
        {
            AccountIndexModel model = new AccountIndexModel();

            List <UserView> users = _userService.All();

            model.Users = users;

            return(View(model));
        }
        public ActionResult Index(int?page)
        {
            int          pageNumber = page ?? 1;
            DataEntities db         = new DataEntities();
            var          vm         = new AccountIndexModel()
            {
                Users = db.UserProfiles.OrderByDescending(m => m.Items.Count).ToPagedList(pageNumber, 10)
            };

            return(View(vm));
        }
Beispiel #3
0
        public async Task <IActionResult> Index()
        {
            IEnumerable <ApplicationUser> users = _userManager.Users;
            var models = await _mapper.ApplicationUsersToAccountProfileModelsAsync(users, _orderService, _userManager);

            var model = new AccountIndexModel
            {
                Accounts = models
            };

            return(View(model));
        }
Beispiel #4
0
        public async Task <ActionResult> Index(AccountIndexModel model)
        {
            List <ActivityFeedContainer> list = await userService.GetActivityFeedItems();

            model.Initialize((await userService.GetCurrentUser()), CreateAccountControllerNavList(new List <string>()
            {
                indexActionDest
            }));
            model.ActivityFeedList = model.SkipAndTake <ActivityFeedContainer>(list).ToList();

            ModelState.Clear();

            return(View(model));
        }
Beispiel #5
0
        public async Task <IActionResult> Search(string searchQuery)
        {
            if (string.IsNullOrWhiteSpace(searchQuery))
            {
                return(RedirectToAction("Index"));
            }

            var queries = string.IsNullOrEmpty(searchQuery) ? null : Regex.Replace(searchQuery, @"\s+", " ").Trim().ToLower().Split(" ");
            var models  = await _mapper.ApplicationUsersToAccountProfileModelsAsync(_userManager.Users.Where(user => queries.Any(query => (user.FirstName + " " + user.LastName + " " + user.Email).ToLower().Contains(query))), _orderService, _userManager);

            var model = new AccountIndexModel
            {
                Accounts    = models,
                SearchQuery = searchQuery
            };

            return(View("Index", model));
        }
Beispiel #6
0
        // GET: /Account
        public ActionResult Index()
        {
            var member = Membership.GetUser();

            if (!User.Identity.IsAuthenticated)
            {
                Helpers.AddPageMessage("Please login first!", PageMessageType.Information);
                return(RedirectToAction("logon"));
            }

            var v = SVD.Controller.Instance.VehicleController.GetVehiclesForUser((Guid)member.ProviderUserKey);
            var m = new AccountIndexModel
            {
                Vehicles = v
            };

            return(View(m));
        }
        public async Task <IActionResult> Index(int?pageIndex)
        {
            var accounts = _userManager.Users.Include(p => p.Regency).Select(user => new AccountViewModel
            {
                Id           = user.Id,
                UserName     = user.UserName,
                Email        = user.Email,
                FullName     = GetFullName.FullName(user.LastName, user.FirstName),
                Created      = user.MemberSince,
                ImageProfile = user.ProfileImageUrl,
                Regency      = user.Regency.Name
            });
            int pageSize = 10;
            var result   = await PaginatedList <AccountViewModel> .CreateAsync(accounts, pageIndex ?? 1, pageSize);

            var model = new AccountIndexModel()
            {
                Accounts = result.AsQueryable()
            };

            return(View(model));
        }