Пример #1
0
        public string GetCateTree()
        {
            List <Category> lstCate = cateBll.GetAllList();
            var             sb      = new StringBuilder();

            sb.Append("[");
            if (lstCate != null && lstCate.Count > 0)
            {
                //if (id == 0)
                //{
                //    sb.Append(",");
                //}
                int count = 0;
                foreach (Category cate in lstCate)
                {
                    sb.Append("{");
                    sb.AppendFormat("\"id\":{0},\"pId\":{1},\"name\":\"{2}\"", cate.CateId,
                                    cate.ParentId, cate.CateName);
                    sb.Append("}");
                    if (count != lstCate.Count - 1)
                    {
                        sb.Append(",");
                    }
                    count++;
                }
            }
            sb.Append("]");
            return(sb.ToString());
        }
Пример #2
0
    private void BindSelType()
    {
        DataSet ds = bllCategory.GetAllList();

        //  int pid = bllCategory.GetIdByCodeNo(codeNo);
        CreateLevelDropDown(ddlType, ds.Tables[0], 0);
    }