How to do batch update from Adobe LiveCycle Form to Database using CSLA .NET ?

How to do batch update from Adobe LiveCycle Form to Database using CSLA .NET ?

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


tarekahf posted on Monday, August 11, 2008

I am working on a project to perform Data Cleanup for Staff Information in HRMD Database.

The user will click on a link to Initiate an Update Request, which will generate a LiveCycle PDF From and Populate it with ALL the Field Values from HRMD Live Database (which has flat and repeated values).

The Data presented on the Form is all the Staff Related Information and it has flat data such as Staff Name and Date of Birth, and other repeated records such as Staff Family Members, Education, Experience, Spoken Languages ...etc.

On the PDF, the user will see the Original Values in Read-Only Fields, and there will be open fields (duplicate of the original) for user entry to correct the errors.

Since the PDF Form used to review and correct the errors in the Data Fields is relatively long, the user will be able to save the form off-line, and fill it anytime where possible.

Once completed, the user will Click on "Submit" to send the Form to the Server by posting it to ASP.NET Page.

The Form Field values are received on the server and retrieved as XML Structure, and can be easily processed by ASP.NET Program, or converted to Dataset for example.

The XML may look something like the following:

<root>
  <staffname>Tarek</staffname>
  <dob>1/1/1970</dob>
  <familymembers>
    <familymember>
       <name>member 1</name>
       <dob>1/1/2000</dob>
    </familymember
    <familymember>
       <name>member 2</name>
       <dob>1/2/2000</dob>
    </familymember
  </familymembers>
   ...
   ...
</root>

The process described above have already been implemented in other similar projects, but I did not follow CSLA.NET Framework. I used Traditional methods, and things are working fine.


The Question:

In this Data Cleanup project, I want to use CSLA.NET Frame work to implement the above process.

I want to perform the update using a Batch Process or Bulk Update to prevent making multiple the trips to Server/Database and for making the update process as efficient as possible.

The difference here is that I am using PDF Form for the Presentation Layer, not a regular ASP.NET Web Form.

I was looking into the PTracker Sample Application, and I could not find an example where there are multiple updates happened on the UI Side (Web Form) and posted for processing as a batch process on the Server/Database. All updates I have seen for the List Objects such as Resource Assignment List are processed one record at a time.

How I can use CSLA.NET to Update the Database from the XML Structure using Bulk Update or Batch Update, with the CSLA.NET Command Object ?

Any help will be appreciated.

Regards ...

Tarek.

tarekahf replied on Friday, September 12, 2008

I noticed that I can use Adobe LiveCycle Form with CSLA .NET much like the same method used in the PTracker Sample Applicaiton (Web UI Code), and the only difference is that the CSLA DataSource and its related events cannot be used since there is no binding capability between Adobe LC Form and .NET DataSource.

So, with each submission of the Form, I would need to do some extra effort to to pass the kind of operation requested (CRUD) as a parameter and handle it probably in the page_load event or something like that, or simply, delete the related previous record stored in the Database, and create a new fresh copy of it based on the newly submitted data fields. This is because I am passing a single main record and related detail records in one go (Staff Info and Family Members) in XML Format.

However, I still need to now how it is possible to use XML Data and/or Dataset to perform batch update to reduce the round-trip between the Business Logic Layer (ASP.NET Code) and the Database Layer.

Tarek.

Copyright (c) Marimer LLC