Beispiel #1
0
        public Stock_DocumentFormat Insert(Stock_DocumentFormat Item, Stock_DocumentRunning itemR)
        {
            var option = new TransactionOptions();

            option.IsolationLevel = IsolationLevel.ReadCommitted;
            //option.Timeout = TimeSpan.FromSeconds(5);
            using (var tx = new TransactionScope(TransactionScopeOption.Required, option))
            {
                Db.Insert(Item);
                Db.SaveChanges();

                itemR.Format_Id = Item.Format_Id;
                itemR.Menu_ID   = Item.Menu_ID;
                Db_Run.Insert(itemR);
                Db_Run.SaveChanges();
                tx.Complete();
                return(Item);
            }
        }
 public Stock_DocumentRunning Insert(Stock_DocumentRunning Item)
 {
     Db.Insert(Item);
     Db.SaveChanges();
     return(Item);
 }