General information
Category:
The Mere Mortals .NET Framework
Title:
Clean way to reference 'current' entity?
Environment versions
Network:
Windows 2003 Server
Hi Kevin/Tim/All, me again.
In the Northwind sample application, let's say I wanted to add a button on the employee form that calls oEmployee.ShowLast in Employee.Partial that can do something like console.writeline("The employee LastName is: " + LastName ). (I know it can be done directly from the employee form, but I'm trying to sort out a clean approach to accessing that current row data from the business object.)
I've tried two approaches
1): pass the unique key and within the bizobj create a new emp Employee collection, then do an emp.get based on the primary key. This works but the calling form list becomes the new list of 1 record from the database.
2) in the employee form, do a foreach ent loop through oEmployee.entitylist, looking for the unique key, then set entindex = oEmployee.EntityList.IndexOf(ent), then call oEmployee.ShowLast(oEmployee.EntityList[entindex]) passing the entity.
Both approaches seem suboptimal, seems fundamental, I must be missing something obvious.
Any suggestions?
thanks,
Larry
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only