public bool Registrate(UserRegistrationInfo userInfo) { bool isValid = ValidationHelper.IsRegFieldsCompleted(userInfo) && ValidationHelper.IsPasswordSame(userInfo.Password, userInfo.ConfirmPassword) && !_authenticationRepository.LoginExists(userInfo.Login); if (isValid) { userInfo.UserId = GetUnicId.GetNewGuid(); _authenticationRepository.SaveRegistrationDate(userInfo); } return(isValid); }
public bool Registrate(UserRegistrationInfo userRegistrationInfo) { bool isValid = ValidationHelper.IsRegFieldsCompleted(userRegistrationInfo) && ValidationHelper.IsPasswordSame(userRegistrationInfo.Password, userRegistrationInfo.ConfirmPassword) && !_userAuthenticationRepository.LoginExists(userRegistrationInfo.Login); if (isValid) { userRegistrationInfo.HasAdminPermission = false; if (!_userAuthenticationRepository.Export(userRegistrationInfo)) { isValid = false; } } return(isValid); }