TransactionManager tm = DataRepositor.Provider.CreateTransaction();
tm.BeginTransaction();
DataRepositor.Provider.OrderProvider.Save(tm, order);
foreach(OrderDetail detail in order.OrderDetailCollection)
{
detail.OrderId = order.Id; // get the new order.Id
}
DataRepositor.Provider.OrderDetailProvider.Save(tm,
order.order.OrderDetailCollection);
tm.RollBack();
No comments:
Post a Comment
Comments