Need help regarding CSLA .Net Framework

Need help regarding CSLA .Net Framework

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


nagendrad posted on Wednesday, January 17, 2007

Hi to all,

             I wanted to implement the CSLA .net framework for my next project, I have read the book called “Expert C# 2005 Business Objects” and found it interesting and thought that this framework will suit best for my project. I just wanted to know a very brief detail regarding the implementation of the N – Level implementation for my project. In the book it say that the framework takes care of the n – level undo but if u have some sample application regarding the n – level undo implementation then kindly send me the same.

I also have one more doubt in the implementation of CSLA .net Framework, As per the book the framework stores the data in the stack memory and the data will only be saved when we close the form. I have a situation like i will be having 100 records, I will edit some 50 records at this instance the modifed data will be stored in the memory, due to some instance if there is a system failure and if the system gets restarted wht happens to those 50 edited records. As per my knowledge the data will be lost due to the failure of the system is this a fallback in the CSLA .net framework plz suggest me abt this. I would be help to all if they resolve this as early possible.

Nagendra.

Brian Criswell replied on Wednesday, January 17, 2007

Download the PTracker sample app that is available from the same location that you downloaded CSLA on Rocky's web site.  It provides examples of N-level undo.

nagendrad replied on Thursday, January 18, 2007

hi Brian Criswell,

Can u just tell me which form or which part has implemented the n-level undo functionality because i tried and was unable to rectify i tested in roles screen where there is a listbox with two button's named save and cancel but here when we click on the save button that was directly updating the data in the database rather than storing in the memory. I have also posted some extension for my previous post can u just tell me whether that is a drawback in that framework ? and if you have any sample code apart from projecttracker to n-level undo send me tht code to my mail id ajaynag2001@yahoo.com 

Thanking you,

Nagendra.

Brian Criswell replied on Thursday, January 18, 2007

Look at ResourceEdit instead.  As for your keeping objects in memory issue, that is the nature of objects in memory.  If the user's machine is rebooted, you lose what is in memory.  If the database server reboots, the user could most likely wait until the server had finished and then make the save.  If you want a secondary holding area for your data, you will have to create that yourself, as that is not the purpose of CSLA.

Jimbo replied on Thursday, January 18, 2007

Your problem seems to have more to do with committing additions and changes rather than undo. Most  data entry operators would save at least a page at a time ( 10 to 20 records) to be comfortable. You dont have to close the form to save the data - where are your  Apply and Save buttons or keyboard short cut  save keys?

nagendrad replied on Friday, January 19, 2007

hi Brain Criswell,

First of all i would like to thank you for suggesting me some good knowlege in the framework thanks for your time in replying me.


i have a treeview in my form and an usercontrol with some 6 textboxes and i have two buttons named as load and save
my requirement is when i click on the load button i am loading all the units in the tree view and when click on the node in the treeview i have to list the respective properties in there respective textboxes that i am able to do but if  i want to edit the selected node in there textboxes and if i click on the different node and return the previous node i will not be able to see the updated changes for that object wht would be your suggest reason for that.

Thanking you,

Nagendra.

Brian Criswell replied on Friday, January 19, 2007

It sounds like you are not updating the references in your TreeView after the save.  So the item in the TreeView does not have the updated changes.  This is only one possibility.  I would recommend that the objects loaded into the TreeView be read only objects that have just the id and display name for the TreeView.  When you click on a node, your UI should load a fully editable object that can be saved independently.  You still will have an issue of updating the TreeView if items are added or the display name has changed, but that is a smaller issue.

Copyright (c) Marimer LLC