Choosing a property of type businesslayer based on the name as a string


Author
Message
Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
This is one of those things I do instinctively in Fox with Eval() or & and don't quite have the hang of yet in .NET



I have a number of private properties of type businesslayer



_Endorsements

_Premises

_GL

_Propmaster





I get a name ( but getting the displayvalue of an enum BOName ) of a business object.



The properties are named _



Now I want to look at the count of the BO based on the string which have representing



Dim varname as String = "_" & MicroFour.StrataFrame.Tools.Common.GetEnumDisplayValue(bo.BOName)



Lets say varname = "PROPMASTER"



Now I want to get the count of whatever BO is in the property which is in the string varname



i.e. Propmaster.count





Fumbling with syntax here. Appreciate any guidance.



TIA

Reply
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Charles,



I know you want to get a direct access like in VFP EVAL() but I am not sure that can be done in .Net. With the code I gave you you can create a function passing the BO type name, do the loop and return the count, assuming you have less than 50 BOs in the form that should be super fast. Tongue

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search