Ejemplo n.º 1
0
        public void addChild(string id, string name)
        {
            ZtreeData c = new ZtreeData();

            c.id   = id;
            c.name = name;
            children.Add(c);
        }
Ejemplo n.º 2
0
 // 添加子节点
 public void addChild(ZtreeData node)
 {
     if (children == null)
     {
         children = new List <ZtreeData>();
     }
     children.Add(node);
 }
Ejemplo n.º 3
0
 // 添加子节点
 public void addChild(ZtreeData node)
 {
     if (children == null)
     {
         children = new List<ZtreeData>();
     }
     children.Add(node);
 }
Ejemplo n.º 4
0
        public ActionResult GetAll()
        {
            try
            {
                var list = DbContext.VEGETABLESPARENTTYPE.Where(m => m.ISDELETED != 1).OrderBy(o=>o.SEQUENCE).ToList();
                var childList = DbContext.VEGETABLESTYPE.Where(m => m.ISDELETED != 1).OrderBy(o => o.SEQUENCE).ToList();

                List<ZtreeData> z_list = new List<ZtreeData>();
                foreach (VEGETABLESPARENTTYPE item in list)
                {
                    var z = new ZtreeData();
                    z.id = item.GUID.ToString();
                    z.isParent = true;
                    var c_list = childList.Where(m => m.PARENTTYPEID.HasValue &&  m.PARENTTYPEID.Value == item.GUID).ToList();
                    z.name = item.VEGETABLESNAME + "  (" + c_list.Count + ")";
                    z.name2 = item.VEGETABLESNAME;
                    foreach (var j in c_list)
                    {
                        var c = new ZtreeData();
                        c.id = j.GUID.ToString();
                        c.name = j.VEGETABLESNAME;
                        z.addChild(c);
                    }
                    z_list.Add(z);
                }

                return new JsonM().ToJson(true, "", z_list);
            }
            catch (Exception ex)
            {

                return new JsonM().ToJson(false, ex.Message);
            }
        }
Ejemplo n.º 5
0
 public void addChild(string id, string name)
 {
     ZtreeData c = new ZtreeData();
     c.id = id;
     c.name = name;
     children.Add(c);
 }
Ejemplo n.º 6
0
        public ActionResult GetAll()
        {
            try
            {
                var list = DbContext.SYS_DATADICLIST.ToList();

                List<ZtreeData> z_list = new List<ZtreeData>();
                foreach (SYS_DATADICLIST item in list)
                {
                    var z = new ZtreeData();
                    z.id = item.UNIQUEFLAG;
                    z.name = item.DATANAME;
                    z.isParent = true;
                    var c_list = this.FindByUniqueflag(z.id);
                    foreach (var j in c_list)
                    {
                        var c = new ZtreeData();
                        c.id = j.GUID.ToString();
                        c.name = j.DICNAME;
                        z.addChild(c);
                    }
                    z_list.Add(z);
                }

                return new JsonM().ToJson(true, "", z_list);
            }
            catch (Exception ex)
            {

                return new JsonM().ToJson(false, ex.Message);
            }
        }