Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Entity from multiple tables
Message
De
22/05/2010 13:51:38
Guy Pardoe
Pardoe Development Corporation
Peterborough, New Hampshire, États-Unis
 
 
À
21/05/2010 13:14:39
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01465461
Message ID:
01465586
Vues:
42
Hi Antonio,

I thought I had a handle on what you are saying below but I can't get it to work as I thought it would. Are you saying the code below should be in the business object, or the business entity object?

I put it in the Invoice entity object and it compiles OK. But when I want to reference the custName in a WPF business window (data binding set to the Invoice business object) I don't get the custName. No errors or anything; the custName just stays blank. I tried this both with and without the "public string custName" property being defined in the business object.

What am I missing to get this to work?

Guy





>Hi Guy,
>
>I use this features in an App now. If you want to use Entities and do it in the Business Layer, you should create a new Public property for your Entity and lookup through objects. The entity has a GetBusinessObject() Method in order to get the Entity´s Business Object, and the Business Object has a ParentBizObj property, so you can define in your invoice Entity something like:
>
>public string CustName
>{
>    get
>    {
>        string custName = ""
>        InvoiveObj invObj = this.GetBusinessObject() as InvoiceObj;
>        if (invObj != null)
>        {
>            if (invObj.ParentBizObj != null)
>            {
>                CustomerObj custObj = invObj.ParentBizObj as CustomerObj;
>                if (custObj != null && custObj.Entity != null) custName = custObj.Entity.CustomerName;
>            }
>        }
>        return custName;
>    }
>}
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform