private ActionResult RedirectToLocalOrHome(string returnUrl, User user) { if ((!string.IsNullOrEmpty(returnUrl)) && (!string.Equals(returnUrl, "/", System.StringComparison.OrdinalIgnoreCase)) && (Url.IsLocalUrl(returnUrl))) { return Redirect(returnUrl); } return RedirectToHome(user); }
private ActionResult RedirectToHome(User user) { switch (user.Role) { case "AccountUser": return RedirectToAction("Index", "CompanyHome"); case "ParticipantUser": return RedirectToAction("Index", "Home"); case "Administrator": return RedirectToAction("Index", "AdministratorHome"); default: throw new SystemException(); } }