Esempio n. 1
0
        /// <summary>
        /// 树节点操作
        /// </summary>
        /// <returns></returns>
        private string TreeNodeManage()
        {
            string nodeNo    = getUTF8ToString("nodeNo");
            string dowhat    = getUTF8ToString("dowhat");
            string returnVal = "";

            EntityTree treeNode = this.HisEn as EntityTree;

            treeNode.RetrieveByAttr(EntityTreeAttr.No, nodeNo);

            switch (dowhat.ToLower())
            {
            case "sample":    //新增同级节点
                EntityTree enTree = treeNode.DoCreateSameLevelNode();
                returnVal = "{No:'" + enTree.No + "',Name:'" + enTree.Name + "'}";
                break;

            case "children":    //新增子节点
                enTree    = treeNode.DoCreateSubNode();
                returnVal = "{No:'" + enTree.No + "',Name:'" + enTree.Name + "'}";
                break;

            case "doup":    //上移
                treeNode.DoUp();
                break;

            case "dodown":    //下移
                treeNode.DoDown();
                break;

            case "delete":    //删除
                treeNode.Delete();
                break;
            }
            //返回
            return(returnVal);
        }