// GET: ReservationsController public async Task <IActionResult> Index(AccountsIndexViewModel model) { model.Pager ??= new PagerViewModel(); model.Pager.CurrentPage = model.Pager.CurrentPage <= 0 ? 1 : model.Pager.CurrentPage; List <AccountsViewModel> items = await context.Accounts.Skip((model.Pager.CurrentPage - 1) *PageSize).Take(PageSize).Select(c => new AccountsViewModel() { Id = c.Id, Username = c.Username, Password = c.Password, FirstName = c.FirstName, LastName = c.LastName, PersonalId = c.PersonalId, PhoneNumber = c.PhoneNumber, Email = c.Email, Start = c.Start, Active = c.Active, Released = c.Released }).ToListAsync(); model.Accounts = items; model.Pager.PagesCount = (int)Math.Ceiling(await context.Rooms.CountAsync() / (double)PageSize); return(View(model)); }
public async Task <ActionResult> Index() { var kycResult = await this.GetKycStatus(); if (kycResult != null) { return(kycResult); } var clientId = this.GetClientId(); var viewModel = new AccountsIndexViewModel { Accounts = await _accountsRepository.GetAccountsAsync(clientId) }; return(View(viewModel)); }