Ejemplo n.º 1
0
        private void CreateFolder_Closed(object sender, EventArgs e)
        {
            NameForm nameForm = (NameForm)sender;

            if (nameForm.DialogResult != DialogResult.OK)
            {
                return;
            }

            try
            {
                int selectedResource = GetSelectedTreeResource();
                if (selectedResource <= 0)
                {
                    MessageBox.Show("选择的父目录不存在", "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                _currentUser.CreateFolder(selectedResource, nameForm.NewName);
                DirTree selTree = GetActiveTree();
                selTree.ReloadTreeNode(selTree.MainTreeView.SelectedNode);
            }
            catch (Exception ex)
            {
                MessageBox.Show("创建目录失败:" + ex.Message, "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
        public virtual void CreateFolder(CUserEntity user, int parentResource, String folderName)
        {
            CACLEntity acl = new CACLEntity(user.ConnString);

            acl.Acl_Resource  = parentResource;
            acl.Acl_Operation = (int)ACLOPERATION.WRITE;
            if (!user.CheckPrivilege(acl))
            {
                throw new Exception("没有写权限!");
            }

            user.CreateFolder(parentResource, folderName);
        }