// private string AddNodes(string OrgCode) { try { StringBuilder stringBuilder = new StringBuilder(); DataTable dataTable = dal.GetLower(OrgCode); foreach (DataRow rows in dataTable.Rows) { stringBuilder.Append("{\"id\":\"" + rows["OrgCode"] + "\",\"text\":\"" + rows["OrgShortName"] + "\",\"children\":[" + AddNodes(rows["OrgCode"].ToString()) + "]}"); stringBuilder.Append(","); } if (stringBuilder.Length > 0) { stringBuilder.Remove(stringBuilder.Length - 1, 1); } return(stringBuilder.ToString()); } catch (Exception ex) { SystemErrorPlug.ErrorRecord("时间:[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]类名:[" + this.GetType().Name + "],行号:[" + Component.GetLineNum().ToString() + "行],错误信息:[" + ex.Message + "]"); return(string.Empty); } }