public ActionResult Create(BorrowerAndCategories baci) { if (new Auth((BorrowerWithUser)Session["User"]).HasAdminPermission()) { baci.Categories = CategoryService.GetCategories(); if (ModelState.IsValid && (baci.CatergoryId == 1 || baci.CatergoryId == 2 || baci.CatergoryId == 3 || baci.CatergoryId == 4)) { if (!BorrowerService.BorrowerExists(baci.Borrower.PersonId)) { borrower b = new borrower(); b = baci.Borrower; b.CategoryId = baci.CatergoryId; BorrowerService.StoreBorrower(b); TempData["Alert"] = AlertView.Build("Låntagare " + baci.Borrower.FirstName + " " + baci.Borrower.LastName + " skapad.", AlertType.Success); return(Redirect("Start")); } baci.PushAlert(AlertView.Build("Detta personnumret är redan registrerat hos oss", AlertType.Danger)); return(View(baci)); } return(View(baci)); } return(Redirect("/Error/Code/403")); }