Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Clean way to reference 'current' entity?
Message
De
18/08/2008 21:46:09
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Clean way to reference 'current' entity?
Versions des environnements
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01339837
Message ID:
01339837
Vues:
48
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform