public ActionResult GetAcountInfo(user user, borrower borrower, string newpassword = null)
        {
            //Knyter samman user och borrower -objekten
            BorrowerWithUser borrowerWithUser = new BorrowerWithUser()
            {
                User     = user,
                Borrower = borrower
            };

            Auth _auth = new Auth((BorrowerWithUser)Session["User"]);

            if (_auth.HasUserPermission())
            {
                if (ModelState.IsValid)
                {
                    if (user.Password != null && PasswordService.VerifyPassword(user.Password, _auth.LoggedInUser.User.Password))
                    {
                        if (UserService.EmailExists(user.Email) && _auth.LoggedInUser.User.Email != user.Email)
                        {
                            borrowerWithUser.PushAlert(AlertView.Build("Email existerar. Försök igen!", AlertType.Danger));
                            return(View(borrowerWithUser));
                        }

                        if (!_auth.IsSameAs(borrowerWithUser, newpassword))
                        {
                            if (newpassword == "")
                            {
                                UserService.Update(borrowerWithUser, user.Password);
                            }
                            else
                            {
                                if (!PasswordValidaton.IsValid(newpassword))
                                {
                                    borrowerWithUser.PushAlert(AlertView.Build(PasswordValidaton.ErrorMessage, AlertType.Danger));
                                    return(View(borrowerWithUser));
                                }

                                UserService.Update(borrowerWithUser, newpassword);
                            }

                            borrowerWithUser.PushAlert(AlertView.Build("Du har uppdaterat ditt konto.", AlertType.Success));
                            Session["User"] = BorrowerService.GetBorrowerWithUserByPersonId(user.PersonId);

                            return(View(borrowerWithUser));
                        }
                        else
                        {
                            borrowerWithUser.PushAlert(AlertView.Build("Inget har uppdaterats.", AlertType.Info));
                            return(View(borrowerWithUser));
                        }
                    }

                    borrowerWithUser.PushAlert(AlertView.Build("Du måste ange ditt eget lösenord.", AlertType.Danger));
                    return(View(borrowerWithUser));
                }

                return(View(borrowerWithUser));
            }
            return(Redirect("/Error/Code/403"));
        }
        public ActionResult GetAcountInfo()
        {
            Auth _auth = new Auth((BorrowerWithUser)Session["User"]);

            if (_auth.HasUserPermission())
            {
                return(View(BorrowerService.GetBorrowerWithUserByPersonId(_auth.LoggedInUser.User.PersonId)));
            }

            return(Redirect("/Error/Code/403"));
        }