// Tar bort en borrower och konto om det finns public ActionResult Remove(BorrowerWithBorrows bwb) { if (new Auth((BorrowerWithUser)Session["User"]).HasAdminPermission()) { if (!BorrowerService.RemoveBorrower(bwb.BorrowerWithUser.Borrower)) { TempData["Alert"] = AlertView.Build("Det gick inte att ta bort låntagare. Kontrollera att inga aktiva lån finns.", AlertType.Danger); return(RedirectToAction("Borrower", new { id = bwb.BorrowerWithUser.Borrower.PersonId })); } TempData["Alert"] = AlertView.Build("Låntagare med PersonId " + bwb.BorrowerWithUser.Borrower.PersonId + " är nu borttagen", AlertType.Success); return(Redirect("Start")); } return(Redirect("/Error/Code/403")); }