Example #1
0
        public UsersViewModel(IEnumerable <ApplicationUser> users)
        {
            foreach (var user in users)
            {
                var x = new ApplicationUserViewModel(user);
                this._users.Add(x);
            }

            this.AddUserViewModel = new AddUserViewModel();

            PagingInfo = new PagingInfoViewModel();
        }
Example #2
0
        public void AddUsers(PagedResult <ApplicationUser> users)
        {
            foreach (ApplicationUser user in users.Results)
            {
                var avm = new ApplicationUserViewModel(user);
                Users.Add(avm);
            }

            PagingInfo = new PagingInfoViewModel
            {
                CurrentPage  = users.CurrentPage,
                TotalItems   = users.TotalItems,
                ItemsPerPage = users.ItemsPerPage,
                TotalPages   = users.TotalPages,
                StartRow     = users.StartRow,
                EndRow       = users.EndRow
            };

            CurrentPage = PagingInfo.CurrentPage.ToString();
        }