Having a "dense" moment!

Having a "dense" moment!

Old forum URL: forums.lhotka.net/forums/t/8240.aspx


FoodmanCyclingPA posted on Wednesday, December 30, 2009

Ok, I am working with parent-child collection-child objects and am looking at the Rolodex example.  When you add a Company Contact in the Company Edit Control, where in the business objects is it setting the CompanyId in the CompanyContact object or the CompanyContactList?  This is a major ah duh moment because I cannot find it and it has got to be happening somewhere?

CyclingFoodmanPA

 

skagen00 replied on Wednesday, December 30, 2009

Look at InsertUpdate of the CompanyContact business class - the Company (parent object) ends up getting passed in... it loads the property when "inserting".

if (insert)
{
command.Parameters["@companyContactId"].Direction = System.Data.ParameterDirection.Output;
LoadProperty(CompanyIdProperty, company.CompanyId);
command.CommandText = "CompanyContactsInsert";
}

FoodmanCyclingPA replied on Wednesday, December 30, 2009

Yep, you were right!  Thank you.  I was looking for it in the constructor of the child object.

Thank you,

CyclingFoodmanPA

Copyright (c) Marimer LLC