Ejemplo n.º 1
0
 public DataSet ExecuteDataSet(ITransactionCustom Transaction, ICommandCustom Command)
 {
     if (Transaction == null)
     {
         return(ExecuteDataSet(string.Empty, Command.IDbCommand));
     }
     return(ExecuteDataSet(Transaction.IDbTransaction, Command.IDbCommand));
 }
Ejemplo n.º 2
0
 public bool ExecuteNonQuery(ITransactionCustom Transaction, List <ICommandCustom> CommandList)
 {
     if (Transaction == null)
     {
         return(ExecuteNonQuery(string.Empty, CommandList));
     }
     if (CommandList == null)
     {
         throw new Exception("SqlBaseCommand不存在");
     }
     if (CommandList.Count == 0)
     {
         throw new Exception("SqlBaseCommand只有O条");
     }
     if (CommandList.Count == 1)
     {
         return(((SqlCommandCustom)CommandList[0]).comparison(ExecuteNonQuery(Transaction, CommandList[0])));
     }
     else
     {
         try
         {
             CommandCustom Command;
             for (int i = 0; i < CommandList.Count; i++)
             {
                 Command = ((CommandCustom)CommandList[i]);
                 Command.ComparisonTypeCustom = ComparisonTypeCustom.ThanEqual;
                 if (!Command.comparison(ExecuteNonQuery(Transaction, Command)))
                 {
                     Transaction.Rollback();
                     return(false);
                 }
             }
             return(true);
         }
         catch (Exception ex)
         {
             Transaction.Rollback();
             throw ex;
         }
     }
 }
Ejemplo n.º 3
0
        public int ExecuteNonQuery(ITransactionCustom Transaction, ICommandCustom Command)
        {
            if (Transaction == null)
            {
                return(ExecuteNonQuery(Command));
            }
            Command.IDbCommand.CommandTimeout = 600;
            PrepareCommand(Command.IDbCommand, Transaction.IDbTransaction.Connection, Transaction.IDbTransaction);
            int retval = -1;

            try
            {
                retval = Command.IDbCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                Transaction.Rollback();
                throw ex;
            }
            Command.IDbCommand.Parameters.Clear();
            return(retval);
        }
Ejemplo n.º 4
0
 public int ExecuteNonQuery(ITransactionCustom Transaction, ICommandCustom Command)
 {
     return(_iFWCommandHelper.ExecuteNonQuery(Transaction, Command));
 }
        public static List <T> queryList <T>(ITransactionCustom transaction, ICommandCustom command)
        {
            SqlEntityToCommandCustom sqlEntityToCommandCustom = new SqlEntityToCommandCustom();

            return(sqlEntityToCommandCustom.queryList <T>(transaction, command));
        }
Ejemplo n.º 6
0
        public static List <T> queryList <T>(ITransactionCustom transaction, ICommandCustom command)
        {
            EntityToCommandCustom fwEntityToFWCommand = new EntityToCommandCustom(command.DatabaseTypeCustom);

            return(fwEntityToFWCommand.queryList <T>(transaction, command));
        }
Ejemplo n.º 7
0
 public CommandCustom(ITransactionCustom iTransactionCustom)
     : this(iTransactionCustom != null ? iTransactionCustom.DatabaseTypeCustom : (new ConnectionCustom()).DatabaseTypeCustom)
 {
 }
Ejemplo n.º 8
0
 public List <T> queryList <T>(ITransactionCustom transaction, ICommandCustom fwcmd)
 {
     return(entityToCommandCustom.queryList <T>(transaction, fwcmd));
 }
Ejemplo n.º 9
0
 public List <IDbResultCustom> insertOrUpdate <T>(ITransactionCustom transaction, List <T> entityList, List <string> idPropertyNameList, List <string> uniquePropertyNameList)
 {
     return(entityToCommandCustom.insertOrUpdate(transaction, entityList, idPropertyNameList, uniquePropertyNameList));
 }
Ejemplo n.º 10
0
 public CommandCustomHelper(ITransactionCustom iTransactionCustom)
     : this(iTransactionCustom.DatabaseTypeCustom)
 {
 }
Ejemplo n.º 11
0
        public static int ExecuteNonQuery(ITransactionCustom Transaction, ICommandCustom Command)
        {
            CommandCustomHelper fwCommandHelper = new CommandCustomHelper(Transaction);

            return(fwCommandHelper.ExecuteNonQuery(Transaction, Command));
        }
Ejemplo n.º 12
0
 public DataTable ExecuteDataTable(ITransactionCustom Transaction, ICommandCustom Command)
 {
     return(ExecuteDataSet(Transaction, Command).Tables[0]);
 }
        public static List <IDbResultCustom> insertOrUpdate <T>(ITransactionCustom transaction, List <T> entityList, List <string> idPropertyNameList)
        {
            SqlEntityToCommandCustom sqlEntityToCommandCustom = new SqlEntityToCommandCustom();

            return(sqlEntityToCommandCustom.insertOrUpdate <T>(transaction, entityList, idPropertyNameList));
        }
Ejemplo n.º 14
0
 public DataTable ExecuteDataTable(ITransactionCustom Transaction, ICommandCustom Command)
 {
     return(_iFWCommandHelper.ExecuteDataTable(Transaction, Command));
 }
Ejemplo n.º 15
0
        public static DataTable ExecuteDataTable(ITransactionCustom Transaction, ICommandCustom Command)
        {
            CommandCustomHelper fwCommandHelper = new CommandCustomHelper(Transaction);

            return(fwCommandHelper.ExecuteDataTable(Transaction, Command));
        }
Ejemplo n.º 16
0
 public bool ExecuteNonQuery(ITransactionCustom Transaction, List <ICommandCustom> CommandList)
 {
     return(_iFWCommandHelper.ExecuteNonQuery(Transaction, CommandList));
 }
Ejemplo n.º 17
0
 public SaveUsuario(IUsuarioBL usuarioBL, ITransactionCustom transactionCustom)
 {
     _IUsuarioBL         = usuarioBL;
     _ITransactionCustom = transactionCustom;
 }
Ejemplo n.º 18
0
 public IDbResultCustom insertOrUpdate <T>(ITransactionCustom transaction, T entity, List <string> idPropertyNameList)
 {
     return(entityToCommandCustom.insertOrUpdate(transaction, entity, idPropertyNameList));
 }
Ejemplo n.º 19
0
        public static DataTable ExecuteDataTable(ITransactionCustom Transaction, ICommandCustom Command)
        {
            SqlCommandHelper commandHelper = new SqlCommandHelper();

            return(commandHelper.ExecuteDataTable(Transaction, Command));
        }
Ejemplo n.º 20
0
 public T query <T>(ITransactionCustom transaction, string afterWhereSql, List <IParameterCustom> afterWhereSqlParams)
 {
     return(entityToCommandCustom.query <T>(transaction, afterWhereSql, afterWhereSqlParams));
 }
Ejemplo n.º 21
0
        public static bool ExecuteNonQuery(ITransactionCustom Transaction, List <ICommandCustom> CommandList)
        {
            SqlCommandHelper commandHelper = new SqlCommandHelper();

            return(commandHelper.ExecuteNonQuery(Transaction, CommandList));
        }
Ejemplo n.º 22
0
 public EntityToCommandCustom(ITransactionCustom fwTransaction)
     : this(fwTransaction != null ? fwTransaction.DatabaseTypeCustom : (new ConnectionCustom()).DatabaseTypeCustom)
 {
 }
Ejemplo n.º 23
0
        public static int ExecuteNonQuery(ITransactionCustom Transaction, ICommandCustom Command)
        {
            SqlCommandHelper commandHelper = new SqlCommandHelper();

            return(commandHelper.ExecuteNonQuery(Transaction, Command));
        }
Ejemplo n.º 24
0
        public static T query <T>(ITransactionCustom transaction, string afterWhereSql, List <IParameterCustom> afterWhereSqlParams)
        {
            EntityToCommandCustom fwEntityToFWCommand = new EntityToCommandCustom(transaction);

            return(fwEntityToFWCommand.query <T>(transaction, afterWhereSql, afterWhereSqlParams));
        }
Ejemplo n.º 25
0
 public int ExecuteScalar(ITransactionCustom Transaction, ICommandCustom Command)
 {
     return(_iFWCommandHelper.ExecuteScalar(Transaction, Command));
 }
Ejemplo n.º 26
0
        public static List <IDbResultCustom> insertOrUpdate <T>(ITransactionCustom transaction, List <T> entityList, List <string> idPropertyNameList)
        {
            EntityToCommandCustom fwEntityToFWCommand = new EntityToCommandCustom(transaction);

            return(fwEntityToFWCommand.insertOrUpdate <T>(transaction, entityList, idPropertyNameList));
        }
        public static T query <T>(ITransactionCustom transaction, string afterWhereSql, List <IParameterCustom> afterWhereSqlParams)
        {
            SqlEntityToCommandCustom sqlEntityToCommandCustom = new SqlEntityToCommandCustom();

            return(sqlEntityToCommandCustom.query <T>(transaction, afterWhereSql, afterWhereSqlParams));
        }