Seting Default Values


Author
Message
Bradley Marston
Bradley Marston
StrataFrame Novice (70 reputation)StrataFrame Novice (70 reputation)StrataFrame Novice (70 reputation)StrataFrame Novice (70 reputation)StrataFrame Novice (70 reputation)StrataFrame Novice (70 reputation)StrataFrame Novice (70 reputation)StrataFrame Novice (70 reputation)StrataFrame Novice (70 reputation)
Group: Forum Members
Posts: 24, Visits: 119
I have a BO with a lot of fields that need to set with defaults, I also have a datatable with the field name and value. Is there a way to set these defaults looping thru the data table without having to use a select case where i must type Case datatable.fieldname = me.fieldname. For example in vfp one could use macro

substitution , but not in vb.net or c sharp.net

Reply
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Yes, there is an overload to accept the field name as a string.  The overload to accept the parameter as an enum (which is defined within the partial class of the business object) just .ToString()s the enum value and calls the other overload.  So, you can certainly make it dynamic, and also add broken rules for custom properties that do not have a value in the enum.
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