public ActionResult Index(RegisterDetails RegisterDetails) { ActionResult actionResult = new ActionResult(); try { RegisterManager.MapRegisterDetail(RegisterDetails); if (RegisterManager.Validate()) { if (PortalSettings.UserRegistration != (int)Globals.PortalRegistrationType.NoRegistration) { actionResult = RegisterManager.CreateUser(RegisterDetails); } else { actionResult.AddError("Registration_NotAllowed", "User registration is not allowed."); } } else { if (RegisterManager.CreateStatus != UserCreateStatus.AddUser) { actionResult.AddError("Registration_Failed", UserController.GetUserCreateStatus(RegisterManager.CreateStatus)); } } } catch (Exception ex) { actionResult.AddError("Register_Error", ex.Message); } return(actionResult); }