Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clean way to reference 'current' entity?
Message
From
18/08/2008 21:46:09
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Clean way to reference 'current' entity?
Environment versions
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01339837
Message ID:
01339837
Views:
49
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
Map
View

Click here to load this message in the networking platform