KendoTreeNode BuildTreeNode(DataRow parentRow, DataTable dt) { KendoTreeNode node = BuildSingleTreeNode(parentRow); DataRow[] childRows = dt.Select("ParentID=" + parentRow["ID"].ToString(), "OrderNum ASC"); if (childRows.Length == 0) { DataTable leafTable = contextDt.GetComboboxData("ID, Name, OrderNum", "MapID=" + parentRow["ID"].ToString()); if (leafTable != null) { foreach (DataRow leafRow in leafTable.Select("", "OrderNum ASC")) { node.items.Add(BuildSingleTreeNode(leafRow, true)); } } } else { foreach (DataRow childRow in childRows) { node.items.Add(BuildTreeNode(childRow, dt)); } } return(node); }
public HttpResponseMessage GetComboboxData(string sessionKey, string cond = "", string order = "") { try { string columns = ""; cond = AdmContextDFR.GetComboboxData(sessionKey, out columns, cond, out order); return(Request.CreateResponse <string>(HttpStatusCode.OK, JsonConvert.SerializeObject(dta.GetComboboxData(columns, cond, order)))); } catch (Exception e) { ExceptionHandler.Log(e); return(null); } }