Change the instance of the main BO in a form.


Author
Message
George Nentidis
George Nentidis
StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)
Group: Forum Members
Posts: 72, Visits: 251
Hi all.

What I am trying to do is this: I drop a BO component (let's say CustomerBO) on the form and bind it in different controls. How can change the instance of this BO? I need to implement a method like this:

private CustomerBO mCustomer;
public void ChangeCustomer(CustomerBO newCustomer)
{
 mCustomer = newCustomer;
}

Where mCustomer is the object which is dropped on the form and bound to all controls, and newCustomer is an object created somewhere outside the form.

After the above assignment, the controls are still bound to the previous instance, and the Save method of the form still saves the original instance. Is there a way of "centrally" changing the instance of the BO (Something like the DataSource property of a BindingSource?)? Do I have to loop all controls and assign it manually?

Thanks in advance.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search