Exemplo n.º 1
0
        private void menuCopyFolder_Click(object sender, EventArgs e)
        {
            try
            {
                int selectedResource = GetSelectedTreeResource();
                if (selectedResource <= 0)
                {
                    MessageBox.Show("请选择一个目录", "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                ResourceClip clipBoard = (ResourceClip)Context.Session["ResourceClipBoard"];
                clipBoard.Copy(_currentUser, selectedResource);
            }
            catch (Exception ex)
            {
                MessageBox.Show("系统错误: " + ex.Message, "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
/*
 *      private void menuCutFolder_Click(object sender, EventArgs e)
 *      {
 *          try
 *          {
 *              int selectedResource = GetSelectedTreeResource();
 *              if (selectedResource <= 0)
 *              {
 *                  MessageBox.Show("请选择一个目录", "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
 *                  return;
 *              }
 *
 *              ResourceClip clipBoard = (ResourceClip)Context.Session["ResourceClipBoard"];
 *              clipBoard.Cut(_currentUser, selectedResource);
 *          }
 *          catch (Exception ex)
 *          {
 *              MessageBox.Show("系统错误: " + ex.Message, "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
 *          }
 *      }
 */
        private void menuPaste_Click(object sender, EventArgs e)
        {
            try
            {
                int selectedResource = GetSelectedTreeResource();
                if (selectedResource <= 0)
                {
                    MessageBox.Show("请选择一个目录", "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                ResourceClip clipBoard = (ResourceClip)Context.Session["ResourceClipBoard"];
                clipBoard.Paste(_currentUser, selectedResource);
                ReloadTreeNode(MainTreeView.SelectedNode);
                ReloadFileList();
            }
            catch (Exception ex)
            {
                MessageBox.Show("系统错误: " + ex.Message, "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 3
0
 private void menuCopyFile_Click(object sender, EventArgs e)
 {
     try
     {
         List <int> resources = new List <int>();
         foreach (ListViewItem item in FileListView.SelectedItems)
         {
             resources.Add((int)item.Tag);
         }
         if (resources.Count == 0)
         {
             MessageBox.Show("请选择文件!", "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         ResourceClip clipBoard = (ResourceClip)Context.Session["ResourceClipBoard"];
         clipBoard.Copy(_currentUser, resources);
     }
     catch (Exception ex)
     {
         MessageBox.Show("系统错误: " + ex.Message, "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }