Exemple #1
0
        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; }
        }
Exemple #2
0
 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; }
 }
Exemple #3
0
 public void DABeginTransaction()
 {
     try
     {
         DASqlConnection = (SqlConnection)DASqlDatabase.CreateConnection();
         DASqlConnection.Open();
         DASqlTransaction = DASqlConnection.BeginTransaction();
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #4
0
 public Object DAExecuteScalar()
 {
     try
     {
         if (DASqlTransaction == null)
         {
             return(DASqlDatabase.ExecuteScalar(DASqlCommand));
         }
         else
         {
             return(DASqlDatabase.ExecuteScalar(DASqlCommand, DASqlTransaction));
         }
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #5
0
 public IDataReader DAExecuteReader()
 {
     try
     {
         if (DASqlTransaction == null)
         {
             return(DASqlDatabase.ExecuteReader(DASqlCommand));
         }
         else
         {
             return(DASqlDatabase.ExecuteReader(DASqlCommand, DASqlTransaction));
         }
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #6
0
 public Int32 DAExecuteNonQuery()
 {
     try
     {
         if (DASqlTransaction == null)
         {
             return(DASqlDatabase.ExecuteNonQuery(DASqlCommand));
         }
         else
         {
             return(DASqlDatabase.ExecuteNonQuery(DASqlCommand, DASqlTransaction));
         }
     }
     catch (Exception ex)
     { throw ex; }
 }