您好,欢迎访问一九零五行业门户网

LigerUi中下拉框一级树tree数据库读取代码示例!

/// summary /// 格式化字符型、日期型、布尔型 /// /summary private static string stringformat(string str, type type) { if (type == typeof(string)) { str = string2json(str); str = \ + str + \; } else if (type == typeof(datetime)) { str = \ +
/// /// 格式化字符型、日期型、布尔型 /// private static string stringformat(string str, type type) { if (type == typeof(string)) { str = string2json(str); str = \ + str + \; } else if (type == typeof(datetime)) { str = \ + str + \; } else if (type == typeof(bool)) { str = str.tolower(); } else if (type != typeof(string) && string.isnullorempty(str)) { str = \ + str + \; } return str; } /// /// 过滤特殊字符 /// private static string string2json(string s) { stringbuilder sb = new stringbuilder(); for (int i = 0; i 1 or deleted is null; sql_class sqlclass1 = new sql_class(); sqldatareader dr1 = sqlclass1.sql_select(sql_count); stringbuilder count_1 = new stringbuilder(); while (dr1.read()) { for (int i = 0; i 1 or deleted is null; sql_class sqlclass = new sql_class(); sqldatareader dr = sqlclass.sql_select(sql); stringbuilder jsonstring = new stringbuilder(); jsonstring.append({); // 总括号 -- 开始 jsonstring.append('' + total + '' + : + '' + count_1.tostring() + '' + ,); // 字段总数 jsonstring.append('' + rows + '' + :); // 行字段开始 jsonstring.append([); // 字段开始 while (dr.read()) { jsonstring.append({); for (int i = 0; i
[
 {id:188,value:null,text:中国,icon: null, fatherid: null, children:null},
 {id:20,value:null,text:河北,icon: null, fatherid: null, children:null},
 {id:21,value:null,text:河南,icon: null, fatherid: null, children:null},
 {id:11,value:null,text:河东,icon: null, fatherid: null, children:null},
 {id:12,value:null,text:上海,icon: null, fatherid: null, children:null},
 {id:166,value:null,text:北京,icon: null, fatherid: null, children:null},
 {id:888,value:null,text:天津,icon: null, fatherid: null, children: null}
]

其它类似信息

推荐信息