StrataFrame Forum

SFSUsersBO.Save() error

http://forum.strataframe.net/Topic23322.aspx

By dgsoft - 6/3/2009

Hi,

I try to create new user programmatically



Dim loSFSUserBO As MicroFour.StrataFrame.Security.BusinessObjects.SFSUsersBO = New MicroFour.StrataFrame.Security.BusinessObjects.SFSUsersBO()

Try

BusinessLayer.TransactionBegin("PENSOLUTIONOFFICE", "PENSOLUTIONOFFICE", Data.IsolationLevel.ReadCommitted)

loSFSUserBO.Add()

loSFSUserBO.us_FirstName = Me.PSOUser_Firstname.Text

loSFSUserBO.us_MiddleName = Me.PSOUser_Middle.Text

loSFSUserBO.us_LastName = Me.PSOUser_Lastname.Text

loSFSUserBO.us_Username = Me.PSOUser_Username.Text

loSFSUserBO.us_PasswordPlainText = Me.PSOUser_Password.Text

loSFSUserBO.us_IsInactive = Me.PSOUser_chkAccountinactive.Checked

loSFSUserBO.us_IsAdministrator = Me.PSOUser_chkAdministrator.Checked

loSFSUserBO.us_PasswordNeverExpires = Me.PSOUser_chkPassNeverExpires.Checked

loSFSUserBO.us_UserMustChangePwNextLogin = Me.PSOUser_chkUserMustChangePass.Checked

loSFSUserBO.us_UserCannotChangePassword = Me.PSOUser_chkUserCantChangePass.Checked

Catch ex As Exception

lcErrorMessage = ex.Message

BusinessLayer.TransactionRollback("PENSOLUTIONOFFICE", "PENSOLUTIONOFFICE")

End Try





I have an Exception

MicroFour.StrataFrame.Business.BusinessLayerException.InnerException {"The specified key [SFST_ConfirmPasswordError] was not found within the localization database."}



The question is Smile What it means and where to search error



Thanks!

Denis
By Trent L. Taylor - 6/3/2009

These are embedded localization keys within the MicroFour.StrataFrame.Security assembly. You can programmatically register the embedded localization files within your solution by doing the following:



MicroFour.StrataFrame.UI.Localization.RegisterEmbeddedXmlFile(System.Reflection.Assembly.LoadFile(PathToSecurityAssembly), "MicroFour.StrataFrame.Security.Messages_1033.XML")




That is only going to get you part of the way there, however, you will also need to set the us_ConfirmPassword property to make this broken rule pass the test.