This is out of context, ignore the property stuff - it's for a single sign on feature I have - but it should get the point across..
objNewUser.PortalID = portalsettings.PortalId
objNewUser.Email = Email
objNewUser.Username = Username
objNewUser.Membership.Password = Password
objNewUser.Membership.Approved =
objNewUser.DisplayName = Username
userCreateStatus = UserController.CreateUser(objNewUser)
objEventLog.AddLog(objNewUser, portalsettings, objNewUser.UserID, Username, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.USER_CREATED)
Mail.SendMail(portalsettings.Email, portalsettings.Email,
DotNetNuke.Services.Localization.Localization.GetSystemMessage(portalsettings.DefaultLanguage, portalsettings,
DotNetNuke.Services.Localization.Localization.GetSystemMessage(portalsettings.DefaultLanguage, portalsettings,
nRDUser.PortalId = portalsettings.PortalId
nRDUser.Username = Username
dsUsers.rd_User.Addrd_UserRow(nRDUser)
npr.RDUserId = nRDUser.RDUserId
npr.UserProfilePropertyDefinitionId = p.PropertyDefinitionId
npr.LocalPropertyValue = p.PropertyValue
npr.SSPropertyValue = p.PropertyValue
npr.LastLocalUpdatedRDUserId = -1
npr.LastLocalUpdatedDate = rightnow
npr.LastSSContactDate = rightnow
npr.LastSSUpdatedDate = rightnow
npr.IsStale =
npr.IsVerified =
dsUsers.rd_UserProfile.Addrd_UserProfileRow(npr)
taRDUser.Update(dsUsers.rd_User)
taRDUserProfile.Update(dsUsers.rd_UserProfile)
taUser.FillByRDUserIdPortalId(dsAccount.rd_User, nRDUser.RDUserId, portalsettings.PortalId)
na.PortalId = portalsettings.PortalId
na.AccountTypeId = RealDropzone.LookupTables.AccountType.Personal
na.Name = nRDUser.Username &
na.IsActive =
dsAccount.rd_Account.Addrd_AccountRow(na)
nua.AccountId = na.AccountId
nua.RDUserId = nRDUser.RDUserId
nua.AllocationOrder = 1
dsAccount.rd_UserAccount.Addrd_UserAccountRow(nua)
taAccount.Update(dsAccount.rd_Account)
taUserAccount.Update(dsAccount.rd_UserAccount)