I have the ASP.NET web application which is based on 3 tiers architecture. (Presentation, Business, and Data Access Layer).

I am going to develop the function which inserts the new client records. Based on Business rules, the new client record must contain the client information, guardian information, and client log history (client created date and client activation date).

When inserting a new client record to the database, I need the insert to write any related records to database as well (i.e, guardian records and log history records based on 1 to many relationship database design).

Under DAL, I already created functions: InsertClientRecord, InsertClientGuardian, and InsertClientLogHistory function.

I want to create a main function which calls InsertClientMain which contains orderly step:

  1. InsertClientRecord (ClientRecords);

  2. InsertClientGuardian (ClientGuardian);

  3. InsertClientLogHistory ("Client is created");

  4. InsertClientLogHistory ("Client is activated");

Since InsertClientMain contains Business rules (insert client log history), should I create this function under Business Layer or DAL?

Also, I want to wrap the transaction scope in the InsertClientMain function. If the InsertClientMain is in the Business Layer, can I use the transaction scope in the Business Layer? I read an article that Business layer must not use anything related to database transaction or persistence (DAL should handle all the database things).

Thank you

0

There are 0 answers