コード例 #1
0
ファイル: DataMapper.cs プロジェクト: kewenwang/BlueSky
        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));
        }
コード例 #2
0
        public static DataMapper Build(string configFile, Assembly sqlSourceAssembly, string connKey)
        {
            DaoConfig   daoConfig = DaoConfigProvider.Build(sqlSourceAssembly, configFile, connKey);
            IDataHelper helper    = DataHelperFactory.Create(SqlConnectType.SqlServer, daoConfig.ConnectionString);

            return(new DataMapper(helper, daoConfig));
        }
コード例 #3
0
ファイル: DataMapper.cs プロジェクト: kewenwang/BlueSky
        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));
        }
コード例 #4
0
ファイル: DataMapper.cs プロジェクト: kewenwang/BlueSky
        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));
        }
コード例 #5
0
ファイル: DataMapper.cs プロジェクト: kewenwang/BlueSky
        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));
        }
コード例 #6
0
ファイル: DataMapper.cs プロジェクト: kewenwang/BlueSky
        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));
        }
コード例 #7
0
ファイル: DataMapper.cs プロジェクト: kewenwang/BlueSky
        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));
        }
コード例 #8
0
ファイル: DataMapper.cs プロジェクト: kewenwang/BlueSky
        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));
        }
コード例 #9
0
ファイル: DataMapper.cs プロジェクト: kewenwang/BlueSky
        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));
        }
コード例 #10
0
ファイル: DataMapper.cs プロジェクト: kewenwang/BlueSky
        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));
        }
コード例 #11
0
        private static void ProcessSqlResources(DaoConfig config, XDocument xdoc, Assembly assembey)
        {
            IEnumerable <XElement> resources = xdoc.Root.Element("SqlResources").Elements("SqlResource");

            foreach (var item in resources)
            {
                string      url      = item.Attribute("Url").Value;
                SqlResource resource = GetSqlResource(url, assembey);
                config.AddResource(resource);
            }
        }
コード例 #12
0
        public static DaoConfig Build(Assembly sqlSourceAssembly, string configFile, string connectionKey)
        {
            DaoConfig config = new DaoConfig();

            config.ConnectionString = System.Configuration.ConfigurationManager.AppSettings[connectionKey];
            XDocument xdoc = GetXDocument(configFile, sqlSourceAssembly);

            ProcessSqlResources(config, xdoc, sqlSourceAssembly);

            return(config);
        }
コード例 #13
0
ファイル: DataMapper.cs プロジェクト: kewenwang/BlueSky
 internal DataMapper(IDataHelper dataHelper, DaoConfig daoConfig)
 {
     this.DataHelper   = dataHelper;
     this.DaoConfig    = daoConfig;
     this.DateTimeKind = System.DateTimeKind.Unspecified;
 }