public ActionResult Create(Location item) { try { if (User.IsInRole("Admin")) { if (ModelState.IsValid) { var newRecord = _repo.Create(item); if (newRecord.LocationId < 1) { return(RedirectToAction("Error404", "Home")); } Session["LocationEvent"] = newRecord; return(RedirectToAction("Index", "Locations")); } } return(RedirectToAction("Login", "Account")); } catch (Exception ex) { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.ToString())); } }