Torna al Thread
bool result = true;
try
{
TransactionOptions transactionOptions = new TransactionOptions();
transactionOptions.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
transactionOptions.Timeout = new TimeSpan(0, 5, 0);
using (TransactionScope scopeDelAmministratore = new TransactionScope(TransactionScopeOption.Required, transactionOptions))
{
result = Delete("Amministratori", "fkAmministratore", userId);
if (result)
scopeDelAmministratore.Complete();
else
scopeDelAmministratore.Dispose();
}//TransactionScope
return true;
}//Try
catch (TransactionAbortedException ex)
{
return false;
}
catch (ApplicationException ex)
{
return false;
}