Exemple #1
0
        /// <summary>
        /// 是否c#中的值类型
        /// </summary>
        public static bool isValueType(string cstype)
        {
            bool isval = false;

            if (File.Exists(datatypefile))
            {
                datatype = new LTP.Utility.INIFile(datatypefile);
                string val = datatype.IniReadValue("isValueType", cstype.Trim());
                if (val == "true")
                {
                    isval = true;
                }
            }
            return(isval);
        }
Exemple #2
0
        /// <summary>
        /// 该数据类型是否加单引号
        /// </summary>
        /// <param name="columnType">数据库类型</param>
        /// <returns></returns>
        public static bool IsAddMark(string columnType)
        {
            bool isadd = false;

            if (File.Exists(datatypefile))
            {
                datatype = new LTP.Utility.INIFile(datatypefile);
                string val = datatype.IniReadValue("IsAddMark", columnType.Trim().ToLower());
                if (val != "")
                {
                    isadd = true;
                }
            }
            return(isadd);
        }
Exemple #3
0
        private static string CSToProcTypeOleDb(string cstype)
        {
            string CSType = cstype;

            if (File.Exists(datatypefile))
            {
                datatype = new LTP.Utility.INIFile(datatypefile);
                string val = datatype.IniReadValue("ToOleDbProc", cstype.ToLower().Trim());
                if (val == "")
                {
                    CSType = cstype.ToLower().Trim();
                }
                else
                {
                    CSType = val;
                }
            }
            return(CSType);
        }
Exemple #4
0
        /// <summary>
        /// 转换【数据库字段类型】 =》为【c#类型】
        /// </summary>
        /// <param name="dbtype">数据库字段类型</param>
        /// <returns>c#类型</returns>
        public static string DbTypeToCS(string dbtype)
        {
            string CSType = "string";

            if (File.Exists(datatypefile))
            {
                datatype = new LTP.Utility.INIFile(datatypefile);
                string val = datatype.IniReadValue("DbToCS", dbtype.ToLower().Trim());
                if (val == "")
                {
                    CSType = dbtype.ToLower().Trim();
                }
                else
                {
                    CSType = val;
                }
            }
            return(CSType);
        }