コード例 #1
0
        public static DataTable ProcessStoredProc(string storeProcName, IDataParameter[] param, string dbName)
        {
            IDbCommand        cmd    = Query.StoredProcCommand(storeProcName, param, dbName);
            PersistenceBroker broker = PersistenceBroker.Instance();

            return(broker.ExecuteQuery(cmd, dbName));
        }
コード例 #2
0
        public static PersistenceBroker Instance()
        {
            if (null == m_Instance)
            {
                m_Instance = new PersistenceBroker();
            }

            return(m_Instance);
        }
コード例 #3
0
        public static DataTable ExecuteSQLQuery(string strSQL, string dbName, int timeout)
        {
            PersistenceBroker broker = PersistenceBroker.Instance();
            IDbCommand        cmd    = broker.GetCommand(dbName);

            cmd.CommandText = strSQL;
            if (timeout >= 0)
            {
                cmd.CommandTimeout = timeout;
            }

            return(broker.ExecuteQuery(cmd, dbName));
        }
コード例 #4
0
        public DataTable Execute()
        {
            StringWriter sql = new StringWriter();

            RenderSelect(sql);
            Assert.VerifyNotNull(sql, Error.NotNull);

            PersistenceBroker broker = PersistenceBroker.Instance();
            IDbCommand        cmd    = broker.GetCommand(m_ClassMap.Database.Name);

            cmd.CommandText = sql.ToString();
            DataTable dt = broker.ExecuteQuery(cmd, m_ClassMap.Database.Name);

            return(dt);
        }
コード例 #5
0
        private static IDbCommand StoredProcCommand(string storedProcName, IDataParameter[] param, string dbName)
        {
            PersistenceBroker broker = PersistenceBroker.Instance();
            IDbCommand        cmd    = broker.GetCommand(dbName);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = storedProcName;
            if (param != null)
            {
                for (int intlop = 0; intlop < param.Length; intlop++)
                {
                    IDataParameter parameter = param[intlop];
                    cmd.Parameters.Add(parameter);
                }
            }
            return(cmd);
        }
コード例 #6
0
        public static void SaveDataTable(DataTable dt, string tableName, string dbName, int timeout)
        {
            PersistenceBroker broker = PersistenceBroker.Instance();

            broker.SaveDataTable(dt, tableName, dbName, timeout);
        }
コード例 #7
0
        public static IDataParameter GetParameter(string dbName)
        {
            PersistenceBroker broker = PersistenceBroker.Instance();

            return(broker.GetCommand(dbName).CreateParameter());
        }
コード例 #8
0
 public void DelDataSource(string dbName) => PersistenceBroker.Instance().DelDataSource(dbName);
コード例 #9
0
 public void AddDataSource(string dbName, string dbType, string connectionString) => PersistenceBroker.Instance().AddDataSource(dbName, dbType, connectionString);
コード例 #10
0
 public void ReInitialize()
 {
     PersistenceBroker.ClearPersistenceBroker();
     Initialize();
 }
コード例 #11
0
 public void Initialize()
 {
     Assert.Verify(this.m_ApplicationContextFile != "", Error.XmlNotFound);
     PersistenceBroker.Initialize();
 }