A simple instance of an c application transaction

  • 2020-05-17 06:18:03
  • OfStack


using (TransactionScope tr = new TransactionScope())
 {
     int i = this.deskmanager.addOpenDesk(account_c);
     int j = this.deskmanager.updateDeskStatus(account_c.AccountC_desk, " Have a guest ");
     if (i > 0 && j > 0)
     {
         tr.Complete();

         
       
     }
     else
     {
         MessageBox.Show(" Failed to open the table, contact the administrator !");
         this.btnkz.Enabled = false;
         this.btndc.Enabled = false;
         this.btnchange.Enabled = false;
         this.button3.Enabled = false;
   }
     tr.Dispose();
 }


Related articles: