public static string ErrorCodeToString(MembershipActiviationStatus status) { switch (status) { case MembershipActiviationStatus.InvalidUsername: return("The user name provided is invalid. Please check the value and try again."); case MembershipActiviationStatus.InvalidActivationCode: return("The activation code provided is invalid. Please check the value and try again."); case MembershipActiviationStatus.ProviderError: return("The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator."); default: return("An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator."); } }
public User ActivateUser(string username, string activationCode, out MembershipActiviationStatus status) { if (!_dataService.IsValidAuthenticationCode(username, activationCode)) { status = MembershipActiviationStatus.InvalidActivationCode; return(null); } var user = _dataService.ActivateUser(username, activationCode); if (user != null) { status = MembershipActiviationStatus.Success; return(user); } status = MembershipActiviationStatus.ProviderError; return(null); }
public static string ErrorCodeToString(MembershipActiviationStatus status) { switch (status) { case MembershipActiviationStatus.InvalidUsername: return "The user name provided is invalid. Please check the value and try again."; case MembershipActiviationStatus.InvalidActivationCode: return "The activation code provided is invalid. Please check the value and try again."; case MembershipActiviationStatus.ProviderError: return "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator."; default: return "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator."; } }
public User ActivateUser(string username, string activationCode, out MembershipActiviationStatus status) { if (!_dataService.IsValidAuthenticationCode(username, activationCode)) { status = MembershipActiviationStatus.InvalidActivationCode; return null; } var user = _dataService.ActivateUser(username, activationCode); if (user != null) { status = MembershipActiviationStatus.Success; return user; } status = MembershipActiviationStatus.ProviderError; return null; }