custom business code.

Posts   
 
    
lewi
User
Posts: 3
Joined: 21-Aug-2008
# Posted on: 21-Aug-2008 14:38:11   

Hi, I'm new to this ORM things and in the process of evaluating llblgen pro. In a master-detail scenario I usually creating SP for insert, delete and update and put custom business code there. With llblgen pro I don't know where and how to handle custom business code for every detail in master-detail scenario. for example, how to adjust inventory quantity for each detail line item. Is this fully support in llblgen pro? is there code example how to do this? Thank you.

best regards, Lewi

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 21-Aug-2008 15:12:31   

You have many options to handle business logic, the default one is to handle business logic in the business layer, your own logic code, nothing to do with LLBLGen Pro.

Anyway for your particular example (if I understand it correctly) you may use a transatcion to adjust the Inventory quantity based on the Ordered line-items quantities.

lewi
User
Posts: 3
Joined: 21-Aug-2008
# Posted on: 21-Aug-2008 16:21:08   

Hi Walaa, Thanks for your quick response.
How about this, I want to execute a SP called sp_AdjustInventoryQuantity for every "OrderDetail line-item", can I do that?

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 21-Aug-2008 16:47:55   

A SP can be mapped to function call in LLBLGen Pro, which you can call from anywhere in the code.

You can better use a UnitOfWork to call the SP after you insert your Order-LineItmes in the same transaction.

UnitOfWork usage: stored procedures

lewi
User
Posts: 3
Joined: 21-Aug-2008
# Posted on: 21-Aug-2008 20:09:23   

I think I know your point, thanks.