Exemple #1
0
        public DataSet ExecuteDataset(string statementName, IDataAccessSession session, List <StatementCondition> conditions, Hashtable paramMap)
        {
            Sql         sql  = DaoConfig.GetSql(statementName);
            ExecuteUnit unit = new ExecuteUnit(this, sql, session, conditions, paramMap);

            return(ExecuteDataset(unit));
        }
Exemple #2
0
        public DataTable ExecuteDatatable(string statementName, IDataAccessSession session, List <StatementCondition> conditions, int startIndex, int endIndex, out int totalCount, IModel model)
        {
            Sql         sql  = DaoConfig.GetSql(statementName);
            ExecuteUnit unit = new ExecuteUnit(this, sql, session, conditions, model);

            return(ExecuteDatatable(unit, startIndex, endIndex, out totalCount));
        }
Exemple #3
0
        public DataTable ExecuteDatatable(string statementName, IDataAccessSession session, List <StatementCondition> conditions, IModel model)
        {
            Sql         sql  = DaoConfig.GetSql(statementName);
            ExecuteUnit unit = new ExecuteUnit(this, sql, session, conditions, model);

            return(ExecuteDatatable(unit));
        }
Exemple #4
0
        public int ExecuteNonQuery(string statementName, IDataAccessSession session, List <StatementCondition> conditions, params object[] parameters)
        {
            Sql         sql  = DaoConfig.GetSql(statementName);
            ExecuteUnit unit = new ExecuteUnit(this, sql, session, conditions, parameters);

            return(ExecuteNonQuery(unit));
        }
Exemple #5
0
        public DataSet ExecuteDataset(string statementName, IDataAccessSession session, List <StatementCondition> conditions, int startIndex, int endIndex, out int totalCount, Hashtable paramMap)
        {
            Sql         sql  = DaoConfig.GetSql(statementName);
            ExecuteUnit unit = new ExecuteUnit(this, sql, session, conditions, paramMap);

            return(ExecuteDataset(unit, startIndex, endIndex, out totalCount));
        }
Exemple #6
0
        public T Query <T>(string statementName, IDataAccessSession session, List <StatementCondition> conditions, Hashtable paramMap) where T : new()
        {
            Sql         sql  = DaoConfig.GetSql(statementName);
            ExecuteUnit unit = new ExecuteUnit(this, sql, session, conditions, paramMap);

            return(Query <T>(unit));
        }
Exemple #7
0
        public ModelCollection <T> QueryCollection <T>(string statementName, IDataAccessSession session, List <StatementCondition> conditions, IModel model) where T : new()
        {
            Sql         sql  = DaoConfig.GetSql(statementName);
            ExecuteUnit unit = new ExecuteUnit(this, sql, session, conditions, model);

            return(QueryCollection <T>(unit));
        }
Exemple #8
0
        public PagerModelCollection <T> QueryCollection <T>(string statementName, IDataAccessSession session, List <StatementCondition> conditions, int startIndex, int endIndex, Hashtable paramMap) where T : new()
        {
            Sql         sql  = DaoConfig.GetSql(statementName);
            ExecuteUnit unit = new ExecuteUnit(this, sql, session, conditions, paramMap);

            return(QueryCollection <T>(unit, startIndex, endIndex));
        }
Exemple #9
0
        public T Query <T>(string statementName, IDataAccessSession session, List <StatementCondition> conditions, params object[] parameters) where T : new()
        {
            Sql         sql  = DaoConfig.GetSql(statementName);
            ExecuteUnit unit = new ExecuteUnit(this, sql, session, null, parameters);

            return(Query <T>(unit));
        }
Exemple #10
0
        private ModelCollection <T> QueryCollection <T>(ExecuteUnit unit) where T : new()
        {
            DataTable           dt   = this.DataHelper.ExecuteDataTable(unit.CommandText, unit.Session, unit.DbParams.ToArray());
            ModelCollection <T> coll = new ModelCollection <T>();
            Type elementType         = coll.ElementType;

            foreach (DataRow row in dt.Rows)
            {
                T model = DataRowToT <T>(row);
                coll.Add(model);
            }

            return(coll);
        }
Exemple #11
0
        private T Query <T>(ExecuteUnit unit) where T : new()
        {
            DataTable dt = this.DataHelper.ExecuteDataTable(unit.CommandText, unit.Session, unit.DbParams.ToArray());

            if (dt.Rows.Count == 0)
            {
                return(default(T));
            }
            DataRow row   = dt.Rows[0];
            T       model = new T();

            this.FillModelValues(model, row);
            return(model);
        }
Exemple #12
0
        private PagerModelCollection <T> QueryCollection <T>(ExecuteUnit unit, int startIndex, int endIndex) where T : new()
        {
            int totalCount;

            DataTable dt = this.DataHelper.ExecuteDataTable(unit.CommandText, unit.Session, startIndex, endIndex, out totalCount, unit.DbParams.ToArray());
            PagerModelCollection <T> coll = new PagerModelCollection <T>(startIndex, endIndex, totalCount);
            Type elementType = coll.ElementType;

            foreach (DataRow row in dt.Rows)
            {
                T model = DataRowToT <T>(row);
                coll.Add(model);
            }

            return(coll);
        }
Exemple #13
0
        private DataSet ExecuteDataset(ExecuteUnit unit)
        {
            DataSet ds = this.DataHelper.ExecuteDataSet(unit.CommandText, unit.Session, unit.DbParams.ToArray());

            return(ds);
        }
Exemple #14
0
        private DataSet ExecuteDataset(ExecuteUnit unit, int startIndex, int endIndex, out int totalCount)
        {
            DataSet ds = this.DataHelper.ExecuteDataSet(unit.CommandText, unit.Session, startIndex, endIndex, out totalCount, unit.DbParams.ToArray());

            return(ds);
        }
Exemple #15
0
        private DataTable ExecuteDatatable(ExecuteUnit unit, int startIndex, int endIndex, out int totalCount)
        {
            DataTable dt = this.DataHelper.ExecuteDataTable(unit.CommandText, unit.Session, startIndex, endIndex, out totalCount, unit.DbParams.ToArray());

            return(dt);
        }
Exemple #16
0
        private DataTable ExecuteDatatable(ExecuteUnit unit)
        {
            DataTable dt = this.DataHelper.ExecuteDataTable(unit.CommandText, unit.Session, unit.DbParams.ToArray());

            return(dt);
        }
Exemple #17
0
        private int ExecuteNonQuery(ExecuteUnit unit)
        {
            int count = this.DataHelper.ExecuteNonQuery(unit.CommandText, unit.Session, unit.DbParams.ToArray());

            return(count);
        }
Exemple #18
0
        private object ExecuteScalar(ExecuteUnit unit)
        {
            object obj = this.DataHelper.ExecuteScalar(unit.CommandText, unit.Session, unit.DbParams.ToArray());

            return(obj);
        }
Exemple #19
0
        private DbDataReader ExecuteReader(ExecuteUnit unit)
        {
            DbDataReader reader = this.DataHelper.ExecuteReader(unit.CommandText, unit.Session, unit.DbParams.ToArray());

            return(reader);
        }