public IActionResult Verify(int fromNumber, int toNumber) { Account fromAccount = _repo.Accounts.Where(x => x.AccountId == fromNumber).FirstOrDefault(); Customer fromPerson = _repo.Customers.Where(x => x.PersonId == fromAccount.PersonId).FirstOrDefault(); fromAccount.Name = fromPerson.Name; fromAccount.LastName = fromPerson.LastName; Account toAccount = _repo.Accounts.Where(x => x.AccountId == toNumber).FirstOrDefault(); Customer toPerson = _repo.Customers.Where(x => x.PersonId == toAccount.PersonId).FirstOrDefault(); toAccount.Name = toPerson.Name; toAccount.LastName = toPerson.LastName; VerifyTransactionViewModel vm = new VerifyTransactionViewModel(); vm.FromAccount = fromAccount; vm.ToAccount = toAccount; return(View(vm)); //Snyggare i vyn om namnen finns med /* * getValue.Name = person.Name; * getValue.LastName = person.LastName; * * return View(getValue); */ //return RedirectToAction("Index", "Home"); }
public IActionResult Verify(int fromNumber, int toNumber) { Account fromAccount = _repo.Accounts.Where(x => x.AccountId == fromNumber).FirstOrDefault(); Customer fromPerson = _repo.Customers.Where(x => x.PersonId == fromAccount.PersonId).FirstOrDefault(); fromAccount.Name = fromPerson.Name; fromAccount.LastName = fromPerson.LastName; Account toAccount = _repo.Accounts.Where(x => x.AccountId == toNumber).FirstOrDefault(); Customer toPerson = _repo.Customers.Where(x => x.PersonId == toAccount.PersonId).FirstOrDefault(); toAccount.Name = toPerson.Name; toAccount.LastName = toPerson.LastName; VerifyTransactionViewModel vm = new VerifyTransactionViewModel(); vm.FromAccount = fromAccount; vm.ToAccount = toAccount; return(View(vm)); }