Please help with this issue for Windows Application.
In my Oracle database table Employee, I have a 1-character column called Manager_Indicator
In my BO,
Private _Manager_Ind_Boolean String = String.Empty
Public Property Manager_Ind_Boolean() As Boolean
Return IIf(_Manager_Ind.ToUpper = "Y", True, False )
Set(ByVal value As Boolean )
_pwgscInd = IIf(value = True, "Y", "N" )
In my UI, using a checkbox to diplay Manager Indicator (checked for "Y", unchecked for "N").
I am using BindingSource for BO obContract.
And Checked property of checkbox binds to Bindingsource. Manager_Ind_Boolean
When I save this object, I get error object is invalid & can not save.
Thanks you in advance for your help.
There is a typo, correct one is:
Private _Manager_Ind as String = String.Empty
If the object is Invalid then you still have broken rules. So check the BrokenRulesCollection to find out which rule is broken and why.
If you have a StringRequired rule on the backing value then it will never get called when the property is changed as you do not call PropertyHasChanged in your setter.
Thank you for your advise. I did find the error.
In addition to what Jonny said, I found that usually this kind of transation was done because i had to put a Y or N in the database. I found I much prefered to handle this when loading / saving the BO, than relying on a string backing field for something that really is a boolean.
Copyright (c) Marimer LLC