Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Biz Objects and populating WPF data grid
Message
De
23/07/2009 14:56:49
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Biz Objects and populating WPF data grid
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01414028
Message ID:
01414028
Vues:
76
I have a WPF data grid which I am populating. Each row in the grid needs to represent data from 3 different tables. The tables are:

Patients
Encounters (child of Patients)
Orders (child of Encounters)

In other words - each row would show patient's name, encounter info and corresponding order info.

What I've done is create a database view which incorporates these 3 tables and then create a biz object (BizOrdersEncountersPatients) based on that view. Data grid name is gridOrderPoolList.DataSource. I had to generate stored procedures by hand because biz layer generator could not handle creating them properly.

In code behind for the xaml I have:

private BizOrdersEncountersPatients _bizOrders;

this._bizOrders = (BizOrdersEncountersPatients)this.RegisterPrimaryBizObj(new BizOrdersEncountersPatients()); (this is the constructor)

_bizOrders.GetOrdersByStatus("NW"); - populating biz obj with data with a certain filter
gridOrderPoolList.DataSource = _bizOrders.EntityList;

Question: is it a better practice to use 3 business objects, each based on the single table? I didn't do it because I didn't know how to handle the data binding and I could not find anything in the MM.NET dev guide on the subject. If it is a better practice to always use objects based on single tables please illustrate how I'd go about showing the data from the 3 tables on the single data grid row. BTW - I am not using ExpressionBlend.

Thank you.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform