Esempio n. 1
0
 private void Init(object procNameOrSql, string conn, bool isClearPara)
 {
     #region 分析是Sql或者存储过程
     if (procNameOrSql != null)
     {
         if (string.IsNullOrEmpty(conn))
         {
             if (procNameOrSql is Enum)
             {
                 conn = CrossDB.GetConnByEnum(procNameOrSql as Enum);
             }
             else if (procNameOrSql is String)
             {
                 string fixName;
                 conn = CrossDB.GetConn(procNameOrSql.ToString(), out fixName);
             }
         }
         _procName = procNameOrSql.ToString().Trim();
         _isProc   = _procName.IndexOf(' ') == -1;//不包含空格
     }
     #endregion
     DalBase dalBase = null;
     if (conn != null && dalHelper == null)
     {
         dalBase = DalCreate.CreateDal(conn);
     }
     SetDalBase(dalBase, isClearPara);
 }
Esempio n. 2
0
        /// <summary>
        /// 获取表列架构
        /// </summary>
        /// <param name="tableName">表名</param>
        public static MDataColumn GetColumns(object tableNameObj)
        {
            string conn = string.Empty;

            if (tableNameObj is Enum)
            {
                conn = CrossDB.GetConnByEnum(tableNameObj as Enum);
            }
            return(GetColumns(Convert.ToString(tableNameObj), conn));
        }