public IActionResult OnGet() { string usesId = _userService.GetUserId(User); var registrant = _registrantService.GetRegistrantByUserId(int.Parse(usesId)); if (registrant == null) { StatusMessage = "No personal info was found, please enter it now"; Input = new InputModel(); } else { Input = new InputModel() { Adress = registrant.Address, FirstName = registrant.FirstName, LastName = registrant.LastName, CountryId = registrant.Country }; } var countryServiceModels = _nomenclatureService.GetCountries(); Countries = _mapper.Map <List <CountryModel> >(countryServiceModels); return(Page()); }
public IActionResult UserWallets() { int userId = int.Parse(_userService.GetUserId(User)); var model = new UserWalletsViewModel(); var registrant = _registrantService.GetRegistrantByUserId(userId, includeWallets: true); if (registrant == null) { //model.Message = "Please enter personal info before attempting to request a new wallet!"; return(Redirect("/Identity/Account/Manage/PersonalData")); } foreach (var wallet in registrant.Wallets) { wallet.Accounts = _accountService.GetAllAccountsWithWalledId(wallet.Id).ToList(); } model.Wallets = _mapper.Map <List <UserWallets> >(registrant.Wallets); for (int i = 0; i < registrant.Wallets.Count; i++) { model.Wallets[i].Verified = registrant.Wallets[i].IsVerified ? "Yes" : "No"; model.Wallets[i].RowId = "RowGroup" + i; model.Wallets[i].Heading = "Heading" + i; } return(View(model)); }