Exemple #1
0
        private void NewFolder()
        {
            TreeNode Node     = TemplateTree.SelectedNode;
            Boolean  IsModule = Convert.ToBoolean(Node.Tag);

            if (!IsModule)
            {
                string Code       = DepositoryResourceCatlog.GetNextCode(Node.Name);
                string FolderName = "新建文件夹";

                Boolean Result = DepositoryResourceCatlog.New(Code, FolderName);
                if (Result)
                {
                    TreeNode SubNode = new TreeNode();
                    SubNode.Name = Code;
                    SubNode.Text = FolderName;
                    SubNode.SelectedImageIndex = 1;
                    SubNode.ImageIndex         = 0;

                    Node.Nodes.Add(SubNode);
                    Node.Expand();
                    Node.TreeView.SelectedNode = SubNode;
                }
            }
        }
Exemple #2
0
        private void NewModule()
        {
            TreeNode Node     = TemplateTree.SelectedNode;
            Boolean  IsModule = Convert.ToBoolean(Node.Tag);

            if (!IsModule)
            {
                string Code       = DepositoryResourceCatlog.GetNextCode(Node.Name);
                string ModuleName = "新建模板";

                Sys_Module module = new Sys_Module();
                module.ID             = Guid.NewGuid();
                module.ModuleSettings = new List <ModuleSetting>();
                module.Name           = ModuleName;
                module.Description    = ModuleName;
                module.CatlogCode     = Code;

                Boolean Result = ModuleHelperClient.NewModule(module);
                if (Result)
                {
                    TreeNode SubNode = new TreeNode();
                    SubNode.Name = module.ID.ToString();
                    SubNode.Text = ModuleName;
                    SubNode.SelectedImageIndex = 2;
                    SubNode.ImageIndex         = 2;
                    SubNode.Tag = true;


                    Node.Nodes.Add(SubNode);
                    Node.Expand();
                    Node.TreeView.SelectedNode = SubNode;
                    Node.TreeView.SelectedNode.TreeView.LabelEdit = true;
                    Node.TreeView.SelectedNode.BeginEdit();
                }
            }
        }