Esempio n. 1
0
 public static int UpdateAddress(Address address)
 {
     try
     {
         using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
         {
             int save;
             address = insertNewCityAndNewStreet(address);
             if (address.Id > 0)
             {
                 save = AddressDataManager.UpdateAddress(address);
             }
             else
             {
                 save = address.Id = AddressDataManager.InsertAddress(address);
             }
             scope.Complete();
             return(save);
         }
     }
     catch (Exception ex)
     {
         _logger.Debug($"Failed to update adddress {address.Id}", ex);
         throw;
     }
 }
Esempio n. 2
0
 public static int InsertAddress(Address address)
 {
     try
     {
         using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
         {
             address = insertNewCityAndNewStreet(address);
             int insert = AddressDataManager.InsertAddress(address);
             scope.Complete();
             return(insert);
         }
     }
     catch (Exception ex)
     {
         _logger.Debug("Failed to insert adddress", ex);
         throw;
     }
 }
Esempio n. 3
0
 public void InsertAddressTest()
 {
     AddressDataManager target = new AddressDataManager(); // TODO: Initialize to an appropriate value
     AddressDto dto = null; // TODO: Initialize to an appropriate value
     target.InsertAddress(dto);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }