public void DAAsignarProcedure(String x_procedure, InstanceEntity x_accion) { try { DASqlCommand = (SqlCommand)DASqlDatabase.GetStoredProcCommand(x_procedure); DASqlCommand.CommandType = System.Data.CommandType.StoredProcedure; switch (x_accion) { case InstanceEntity.New: DAAgregarParametro("@Accion", "I", SqlDbType.NChar, 1, ParameterDirection.Input); break; case InstanceEntity.Modify: DAAgregarParametro("@Accion", "U", SqlDbType.NChar, 1, ParameterDirection.Input); break; case InstanceEntity.Delete: DAAgregarParametro("@Accion", "D", SqlDbType.NChar, 1, ParameterDirection.Input); break; default: break; } DASqlCommand.CommandTimeout = m_timeout; } catch (Exception ex) { throw ex; } }
public void DAAsignarProcedure(String x_procedure) { try { DASqlCommand = (SqlCommand)DASqlDatabase.GetStoredProcCommand(x_procedure); DASqlCommand.CommandType = System.Data.CommandType.StoredProcedure; DASqlCommand.CommandTimeout = m_timeout; } catch (Exception ex) { throw ex; } }
public void DABeginTransaction() { try { DASqlConnection = (SqlConnection)DASqlDatabase.CreateConnection(); DASqlConnection.Open(); DASqlTransaction = DASqlConnection.BeginTransaction(); } catch (Exception ex) { throw ex; } }
public Object DAExecuteScalar() { try { if (DASqlTransaction == null) { return(DASqlDatabase.ExecuteScalar(DASqlCommand)); } else { return(DASqlDatabase.ExecuteScalar(DASqlCommand, DASqlTransaction)); } } catch (Exception ex) { throw ex; } }
public IDataReader DAExecuteReader() { try { if (DASqlTransaction == null) { return(DASqlDatabase.ExecuteReader(DASqlCommand)); } else { return(DASqlDatabase.ExecuteReader(DASqlCommand, DASqlTransaction)); } } catch (Exception ex) { throw ex; } }
public Int32 DAExecuteNonQuery() { try { if (DASqlTransaction == null) { return(DASqlDatabase.ExecuteNonQuery(DASqlCommand)); } else { return(DASqlDatabase.ExecuteNonQuery(DASqlCommand, DASqlTransaction)); } } catch (Exception ex) { throw ex; } }