Guest User

Untitled

a guest
May 25th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 KB | None | 0 0
  1. using (DBUtility dbu = new DBUtility())
  2.                 {
  3.                     dbu.BeginTransaction();
  4.  
  5.                     try
  6.                     {  
  7.                         // Add total points to balance
  8.                         txId = CreateTransaction(dbu, memberNum, totalPoints);
  9.  
  10.                         // Details for each supplier
  11.                         foreach (DataRow dr in ds.Tables[0].Rows)
  12.                             CreateEarnDetails(dbu, txId, Convert.ToInt32(dr["supplierNum"]), Convert.ToInt32(dr["rewardsPoints"]), Convert.ToDouble(dr["volume"]));
  13.                    
  14.                         dbu.CommitTransaction();
  15.                     }
  16.                     catch (Exception ex)
  17.                     {
  18.                         Console.WriteLine(ex.Message);
  19.                         Debug.WriteLine("Error in ProcessRewards! Message: " + ex.Message + "\n StackTrace: " + ex.StackTrace);
  20.                         dbu.RollbackTransaction();
  21.                         throw;
  22.                     }
  23.                 }
Add Comment
Please, Sign In to add comment