Information générale
Catégorie:
The Mere Mortals .NET Framework
Titre:
Biz Objects and populating WPF data grid
Versions des environnements
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement