private void SetContactoEmergenciaDeleteCommandOutputs(SqlCommand cmd, ContactoEmergenciaDeleteOutput output) { if (cmd.Parameters[1].Value != DBNull.Value) { output.ReturnValue = (ContactoEmergenciaDeleteOutput.Returns)cmd.Parameters[1].Value; } }
/// <summary> /// Deletes single row from dbo.ContactoEmergencia table by identity column. /// SQL+ Routine: dbo.ContactoEmergenciaDelete - Authored by IvoStrficek /// </summary> public ContactoEmergenciaDeleteOutput ContactoEmergenciaDelete(IContactoEmergenciaDeleteInput input) { if (!input.IsValid()) { throw new ArgumentException("ContactoEmergenciaDeleteInput fails validation - use the ContactoEmergenciaDeleteInput.IsValid() method prior to passing the input argument to the ContactoEmergenciaDelete method.", "input"); } ContactoEmergenciaDeleteOutput output = new ContactoEmergenciaDeleteOutput(); if (sqlConnection != null) { using (SqlCommand cmd = GetContactoEmergenciaDeleteCommand(sqlConnection, input)) { cmd.Transaction = sqlTransaction; ContactoEmergenciaDeleteCommand(cmd, output); } return(output); } for (int idx = 0; idx <= retryOptions.RetryIntervals.Count; idx++) { if (idx > 0) { System.Threading.Thread.Sleep(retryOptions.RetryIntervals[idx - 1]); } try { using (SqlConnection cnn = new SqlConnection(connectionString)) using (SqlCommand cmd = GetContactoEmergenciaDeleteCommand(cnn, input)) { cnn.Open(); ContactoEmergenciaDeleteCommand(cmd, output); cnn.Close(); } break; } catch (SqlException sqlException) { bool throwException = true; if (retryOptions.TransientErrorNumbers.Contains(sqlException.Number)) { throwException = (idx == retryOptions.RetryIntervals.Count); if (retryOptions.Logger != null) { retryOptions.Logger.Log(sqlException); } } if (throwException) { throw; } } } return(output); }
private void ContactoEmergenciaDeleteCommand(SqlCommand cmd, ContactoEmergenciaDeleteOutput output) { cmd.ExecuteNonQuery(); SetContactoEmergenciaDeleteCommandOutputs(cmd, output); }