示例#1
0
        public DataSet doQueryTemplate(string sqlTemplate)
        {
            DataSet         result = null;
            DatabasePersist d      = (DatabasePersist)persistence;
            string          sql    = d.processSql(sqlTemplate);

            result = d.executeQuery(sql);
            return(result);
        }
示例#2
0
        public long doCommandTemplate(string sqlTemplate)
        {
            long   result = 0;
            string sql    = string.Empty;

            try
            {
                DatabasePersist d = (DatabasePersist)persistence;
                sql    = d.processSql(sqlTemplate);
                result = d.executeCommand(sql);
            }
            catch (Exception x)
            {
                Logger.log(this, x, "Error processing " + sql);
            }
            return(result);
        }
示例#3
0
        public virtual T doSingleObjectQuery <T>(string action) where T : System.Collections.IDictionary, new()
        {
            T result = new T();

            DataSet dataSet = doQuery(action);

            if (DatabasePersist.hasData(dataSet))
            {
                DataRow r = dataSet.Tables[0].Rows[0];

                foreach (DataColumn c in r.Table.Columns)
                {
                    result.Add(c.ColumnName, r[c.ColumnName]);
                }
            }

            return(result);
        }