public static string ParsePkFieldName(Type type) { string pkFieldName = string.Empty; List <MethodInfo> ary_Methods = Ajutil.GetMethodList(type); MethodInfo mdh_GetUUID = ary_Methods.Find(t => t.Name.Equals("get_pkfieldname", StringComparison.CurrentCultureIgnoreCase)); if (mdh_GetUUID != null) { pkFieldName = (string)mdh_GetUUID.Invoke(type.Assembly.CreateInstance(type.FullName), null); } return(pkFieldName); }
internal static string ParseSelectSql(string dbname) { StringBuilder sql = new StringBuilder(); string typeString = "com.cgWorkstudio.BIMP.Client.vo." + dbname + ",bimp_CloudPro"; Type getType = Type.GetType(typeString); List <MethodInfo> ary_Methods = Ajutil.GetMethodList(getType); MethodInfo mdh_GetFields = ary_Methods.Find(t => t.Name.Equals("get_fields", StringComparison.CurrentCultureIgnoreCase)); List <SQLField> sqlFields = (List <SQLField>)mdh_GetFields.Invoke(getType.Assembly.CreateInstance(getType.FullName), null); foreach (SQLField sqlField in sqlFields) { //if(sqlField.DbType == SqlDbType.NText) { // 不查询大数据类型 // continue; //} switch (sqlField.Name.ToUpper()) { case "ISDELETE": case "ISVALID": case "ISUSED": //case "PID": continue; } if (sql.Length > 0) { sql.Append(","); } sql.Append(sqlField.Name); // 是否显示字段中文备注 //if(string.IsNullOrEmpty(sqlField.Remarks) == false) { // sql.Append(" as '" + sqlField.Remarks + "'"); //} } return(sql.ToString()); }