示例#1
0
 public void Dispose()
 {
     _baseDao = null;
 }
示例#2
0
 public DALContext(string connectionKey)
 {
     _connectionKey = connectionKey;
     _baseDao       = new BaseDaoExt(_connectionKey);
     //_baseDao = BaseDaoFactory.CreateBaseDao(_connectionKey);
 }
示例#3
0
 public DALContext(string connectionKey)
 {
     _connectionKey = connectionKey;
     _baseDao = new BaseDaoExt(_connectionKey);
     //_baseDao = BaseDaoFactory.CreateBaseDao(_connectionKey);
 }
示例#4
0
 public void Dispose()
 {
     _baseDao = null;
 }
示例#5
0
        public static DbCommand BuildDynamicParam(string toReplaceString, string strSql, string strParam, char sperateSymbol, DbCommand dbCommand, DbType dbType, BaseDaoExt DB)
        {
            StringBuilder sb = new StringBuilder();

            string[]      ids  = strParam.Split(sperateSymbol);
            List <string> keys = new List <string>();

            for (var i = 0; i < ids.Length; i++)
            {
                string key = "@key" + i;
                keys.Add(key);
                sb.Append(key + ",");
            }
            strSql = strSql.Replace(toReplaceString, sb.ToString().TrimEnd(','));

            //DbCommand dbCommand = DB.GetSqlStringCommand(strSql);
            for (var i = 0; i < ids.Length; i++)
            {
                DB.AddInParameter(dbCommand, keys[i], dbType, ids[i]);
            }
            dbCommand.CommandText = strSql;
            return(dbCommand);
        }