Register
Tuesday, January 06, 2009
Forum
 
BusinessListBase derived classes missing Assign method
Last Post 14 Nov 2008 09:57 AM by eurowise. 9 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
huwlloyd
New Member
New Member
Posts:15


--
04 Nov 2008 05:35 PM  
I'm using the beta and trying to use parent child relationships.
However, i have noticed that the collection classes generated and being derived from BusinessListBase are missing an Assign method.

Am i not understanding something or is this an error?
thanks.
eurowise
Basic Member
Basic Member
Posts:107


--
05 Nov 2008 11:26 AM  
I am sure what Assign method you are referring to.

Philip
huwlloyd
New Member
New Member
Posts:15


--
05 Nov 2008 04:36 PM  
Mmmm, yeah thanks Philip. I'm just starting to use CSLA and was referencing Project tracker as an example that shows Assign.
The reason i though it was missing something was that when editing a child in the datagridview and then saving the parent, the child was not saved - stepping through the code it seemed that the Child record change did not make the Parent IsDirty = true.

Anyway, to cut a long story short i think it has to do with the Edit method of the PLxxxControl class. There does not appear to be a Object.BeginEdit() in this method. I have added the line of code and i am now getting the expected behaviour.

I hope this makes some sort of sense; i'd be grateful if you could confirm i have done the right thing.
many thanks,
Huw
huwlloyd
New Member
New Member
Posts:15


--
07 Nov 2008 10:35 AM  
On further investigation, it seems that there are problems with the beta in managing parent/child relationships. It seems the method to save (Save()) generated in the presentation layer does not correctly manage the databinding.

On an edit page, the first time you click Save, it works and child records are added to the db. However, after the save, even though the form remains open, you can no longer add/remove child records.

Could you please take a look and confirm if this is an error/problem with the beta, or am i still not getting something and doing something wrong.

many thanks.
huwlloyd
New Member
New Member
Posts:15


--
11 Nov 2008 01:29 PM  
Anybody?
eurowise
Basic Member
Basic Member
Posts:107


--
11 Nov 2008 04:36 PM  
Long bank holiday in France! Will be looking into that this week.

Philip
huwlloyd
New Member
New Member
Posts:15


--
11 Nov 2008 05:16 PM  
Ok, thanks Philip.
If there's anything you need from me let me know (e.g. further explanation/expansion of my above comments), and i will try to be of assistance.

Whilst we are looking at this area, could you perhaps explain how i could use Code Complete to map a 1 to 1 parent child relationship. Everything i have seen so far seems to create collections.

Thanks again,
Huw
eurowise
Basic Member
Basic Member
Posts:107


--
13 Nov 2008 08:57 AM  
I have done a couple of test and it seems to work. Can you tel me exactly where you are getting the problem i.e., is it a win, wpf or web application, which db are you using etc...

Code Complete for the moment does not support one to ome relationship. We will sse whether we can do that at one stage. I cannot promise it will be soon as we are really busy trying to get 3.5 out.

Regards

Philip
huwlloyd
New Member
New Member
Posts:15


--
13 Nov 2008 03:57 PM  
Ok, it's a Winforms application, with a SQL Server 2005 db.
There are "several" (approx 8) parent/child relationships. The winform edit screen has the main object details and below a number of datagridviews.
On first entering the edit screen, i can add rows to the datagridviews and click save and everything is good. However, after clicking Save (with the form still open) if i try to change any details on the datagridviews (not always possible) then the details are not saved back to the db.

The Edit() method and the Save() method in the PLWINxxxControl class do not contain the same databinding details (which i would expect). I also took a look at another class i have with 1 parent/child relationship and that seemed to be generated ok; so is it a problem with "multiple" child/parent relationships.

I had lots of errors when generating the code, with duplicates. Could this possibly have something to do with me "tidying up" and removing duplicate code?

Could i ask if you are using the latest build or the beta as can be downloaded from the website?
eurowise
Basic Member
Basic Member
Posts:107


--
14 Nov 2008 09:57 AM  
Thanks for the details. We will be looking into that.

Philip
You are not authorized to post a reply.

Active Forums 4.0