| | | Forum Newbie
       
Group: Forum Members Last Login: 12/1/2008 3:15:17 PM Posts: 8, Visits: 17 |
| Good day,
I'm trying to figure out why the fullname field is not saved on creation or update.
I tried:
- using the setFullName method (now in comment)
- Saving twice (setting the fullname in between both times)
- Saving, loading the user, change the name, then save again.
- Using the saveuser method with the Fullname parameter (in byte() ). This one crashes.
I looked at the .ASP code provided in the IAdmin folder, but ASP doesn't seem to use the same version of the code, since it uses methods and properties that are unavailable in the .Net version (ex: in asp, you would create a user with the following: "newUser = oDomain.CreateUser();", which doesn't exist on the .Net version).
Here's the code:
Public Sub AddUser( _
ByVal aDomain As String, _
ByVal UserID As String, _
ByVal Password As String, _
ByVal Name As String, _
ByVal FullName As String, _
ByVal type As T_Employe_Type _
)
Dim IMailDomain As IMailAPI_NET.DomainData = New IMailAPI_NET.DomainCollection().Item(aDomain)
If Not IMailDomain Is Nothing Then
Dim MyUserCollection As IMailAPI_NET.UserCollection = IMailDomain.GetUsers()
Dim newUser As IMailAPI_NET.UserData = New IMailAPI_NET.UserData()
newUser.MailAddress = UserID
newUser.UserID = UserID
newUser.Name = UserID
newUser.FullName = FullName
'newUser.setFullName(Encoding.Convert(Encoding.Unicode, Encoding.UTF8, Encoding.Unicode.GetBytes(FullName)), Encoding.UTF8)
newUser.Password = Password
newUser.Domain = aDomain
newUser.EnableWebAccess = True
newUser.AllowPassChange = False
MyUserCollection.Add(newUser)
Try
If Not newUser.SaveUser() Then
'If Not newUser.SaveUser(Encoding.Convert(Encoding.Unicode, Encoding.UTF8, Encoding.Unicode.GetBytes(FullName))) Then
Throw New Exception("Error, Data save error.")
End If
Catch ex As Exception
Throw New Exception("Error: Error while saving. " & ex.Message)
End Try
' Some other stuff...
end if
End Sub |
| |
|
|