示例#1
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            try
            {
                COrganizeEntity currentOrg = new COrganizeEntity().Load(_currentUser.GetUserOrganize().Org_Id);
                CResourceEntity orgRes     = new CResourceEntity().Load(currentOrg.Org_Resource);
                //string rootDir = Context.Server.MapPath("~/App_data");
                string rootDir = ConfigurationManager.AppSettings["UserData"];
                _temperoryFolder = rootDir + DateTime.Now.ToString("yyyy-MM-dd") + currentOrg.Org_Name;
                DirectoryInfo di = Directory.CreateDirectory(_temperoryFolder);

                Context.Session["temperoryFolder"] = _temperoryFolder;

                string outputPath = _temperoryFolder + @"\";
                outputPath += currentOrg.Org_Name;
                outputPath += ".zip";
                string orignPath = orgRes.MakeFullPath();
                ZipFiles(orignPath, outputPath);

                LinkParameters objlinkParameters = new LinkParameters();
                objlinkParameters.Target = "_self";
                Link.Open(new Gizmox.WebGUI.Common.Gateways.GatewayReference(this, "Download"), objlinkParameters);

                //System.IO.File.Delete(outputPath);
                //di.Delete();
            }
            catch (Exception ex)
            {
                MessageBox.Show("系统错误:" + ex.Message, "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
示例#2
0
        private void ShowArchiveContent_Load(object sender, EventArgs e)
        {
            FileList archiFilst = new FileList();

            archiFilst.CurrentUser        = _currentUser;
            ContentDirTree.CurrentUser    = _currentUser;
            ContentDirTree.RootResourceId = _currentUser.GetUserOrganize().Org_ArchiveRes;

            try
            {
                //ContentDirTree.RootDir = Context.Server.MapPath("~/app_data");
                ContentDirTree.RootDir = ConfigurationManager.AppSettings["UserData"];
                ContentDirTree.Init();
                ContentDirTree.FileListUI = archiFilst;
            }
            catch (Exception ex)
            {
                MessageBox.Show("系统错误:" + ex.Message, "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            //this.Menu = mainMenu1;
            _currentUser = (CUserEntity)Context.Session["CurrentUser"];

            try
            {
                myDirTree.CurrentUser         = _currentUser;
                myDirTree.RootResourceId      = _currentUser.Usr_Resource;
                archiveDirTree.CurrentUser    = _currentUser;
                archiveDirTree.RootResourceId = _currentUser.GetUserOrganize().Org_ArchiveRes;
                _myFileList.CurrentUser       = _currentUser;
                _archiveFileLst.CurrentUser   = _currentUser;
                shareDirTree.CurrentUser      = _currentUser;
                shareDirTree.Helper           = new ShareHelpClass();
                _shareFileList.CurrentUser    = _currentUser;
                _userList.CurrentUser         = _currentUser;
                _groupList.CurrentUser        = _currentUser;
                _userUpdate.CurrentUser       = _currentUser;
                _myApply.CurrentUser          = _currentUser;
                _auditeApply.CurrentUser      = _currentUser;

                orgMgerDirTree.CurrentUser    = _currentUser;
                orgMgerDirTree.RootResourceId = _currentUser.GetUserOrganize().Org_Resource;
                _orgMgerList.CurrentUser      = _currentUser;

                _orgMemo.CurrentUser = _currentUser;
                _mailSet.CurrentUser = _currentUser;

                // Create resource clipboard and save in session
                ResourceClip clipBoard = new ResourceClip();
                Context.Session["ResourceClipBoard"] = clipBoard;

                //系统管理
                List <CFunction> systemFunctions = new List <CFunction>();
                CFunction        function        = new CFunction();
                function.Name  = "备份";
                function.Ui    = _orgMemo;
                function.Image = new IconResourceHandle("save.gif");
                systemFunctions.Add(function);

                function       = new CFunction();
                function.Name  = "用户管理";
                function.Image = new IconResourceHandle("member.png");
                function.Ui    = _userList;
                systemFunctions.Add(function);

                function       = new CFunction();
                function.Name  = "用户组管理";
                function.Image = new IconResourceHandle("member.png");
                function.Ui    = _groupList;
                systemFunctions.Add(function);


                function       = new CFunction();
                function.Name  = "系统配置";
                function.Image = new IconResourceHandle("properties.gif");
                function.Ui    = _mailSet;
                systemFunctions.Add(function);
                this.sysFunctionTree.FunctionList = systemFunctions;
                this.sysFunctionTree.TreeEvent   += FunctionTreeEventHandler;

                //我的信息
                List <CFunction> myinfoFunctions = new List <CFunction>();
//                 function = new CFunction();
//                 function.Name = "安全信息";
//                 function.Image = new IconResourceHandle("importantmail.gif");
//                 myinfoFunctions.Add(function);

//                 function = new CFunction();
//                 function.Name = "其它信息";
//                 function.Image = new IconResourceHandle("member.gif");
//                 myinfoFunctions.Add(function);

                function       = new CFunction();
                function.Name  = "修改个人资料";
                function.Image = new IconResourceHandle("member.gif");
                function.Ui    = _userUpdate;
                myinfoFunctions.Add(function);

                function       = new CFunction();
                function.Name  = "审核归档申请";
                function.Image = new IconResourceHandle("member.gif");
                function.Ui    = _auditeApply;
                CACLEntity acl = new CACLEntity();
                acl.Acl_Operation = (int)ACLOPERATION.AUDITAPPLY;
                acl.Acl_Resource  = _currentUser.Usr_Organize;
                if (_currentUser.CheckPrivilege(acl) == true)
                {
                    myinfoFunctions.Add(function);
                }

                function       = new CFunction();
                function.Name  = "我的归档申请";
                function.Image = new IconResourceHandle("member.gif");
                function.Ui    = _myApply;
                myinfoFunctions.Add(function);

                this.myinfofunctionTree.FunctionList = myinfoFunctions;
                this.myinfofunctionTree.TreeEvent   += FunctionTreeEventHandler;

                //我的文档
                // myDirTree.RootDir = Context.Server.MapPath("~/App_Data");
                //myDirTree.RootDir = Context.Server.MapPath("~/"+ConfigurationManager.AppSettings["Userdata"]);
                myDirTree.RootDir = ConfigurationManager.AppSettings["UserData"];
                myDirTree.Init();
                myDirTree.FileListUI   = _myFileList;
                myDirTree.TreeEvent   += DirTreeEventHandler;
                myDirTree.SearchEvent += DirTreeSearchEventHandler;

                //共享空间

                /*
                 * List<CFunction> shareSpaceFunctionList = new List<CFunction>();
                 * function = new CFunction();
                 * function.Name = "我共享给他人的文档";
                 * function.Image = new IconResourceHandle("folders.gif");
                 * shareSpaceFunctionList.Add(function);
                 * function = new CFunction();
                 * function.Name = "他人共享给我的文档";
                 * function.Image = new IconResourceHandle("folders.gif");
                 * shareSpaceFunctionList.Add(function);
                 * shareSpacefunctionTree.FunctionList = shareSpaceFunctionList;
                 */
                shareDirTree.Init();
                shareDirTree.FileListUI   = _shareFileList;
                shareDirTree.TreeEvent   += DirTreeEventHandler;
                shareDirTree.SearchEvent += DirTreeSearchEventHandler;

                //归档区
                //archiveDirTree.RootDir = Context.Server.MapPath("~/App_Data");
                archiveDirTree.RootDir = ConfigurationManager.AppSettings["UserData"];
                archiveDirTree.Init();
                archiveDirTree.FileListUI   = _archiveFileLst;
                archiveDirTree.TreeEvent   += DirTreeEventHandler;
                archiveDirTree.SearchEvent += DirTreeSearchEventHandler;

                //组织管理——赵英武
                // orgMgerDirTree.RootDir = Context.Server.MapPath("~/App_Data");
                orgMgerDirTree.RootDir = ConfigurationManager.AppSettings["UserData"];
                orgMgerDirTree.Init();
                orgMgerDirTree.FileListUI   = _orgMgerList;
                orgMgerDirTree.TreeEvent   += DirTreeEventHandler;
                orgMgerDirTree.SearchEvent += DirTreeSearchEventHandler;

                systemPage.Image    = new IconResourceHandle("24X24.applications.gif");
                myInfoPage.Image    = new IconResourceHandle("24X24.behaviors.gif");
                myDocPage.Image     = new IconResourceHandle("24X24.controls.gif");
                shareSpaceTab.Image = new IconResourceHandle("24X24.sharedspace.gif");
                archiveTab.Image    = new IconResourceHandle("24X24.folders.gif");
                orgManageTab.Image  = new IconResourceHandle("24X24.orgAdmin.gif");

                // only administrator can see system admin page
                if (_currentUser.Usr_Type != (int)USERTYPE.ORGANIZEADMIN &&
                    _currentUser.Usr_Type != (int)USERTYPE.SYSTEMADMIN)
                {
                    leftNavigationTabs.Controls.Remove(systemPage);
                }
                //only orgnizeAdministrator can see orgnize admin page
                if (_currentUser.Usr_Type != (int)USERTYPE.ORGANIZEADMIN)
                {
                    leftNavigationTabs.Controls.Remove(orgManageTab);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("系统错误:" + ex.Message, "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#4
0
        private void OKBtn_Click(object sender, EventArgs e)
        {
            String targetText = targetBox.Text;

            if (targetText.Length <= 0)
            {
                MessageBox.Show("请填写检索内容!", "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            List <String> searchScopes = new List <string>();

            if (currentDirBox.Checked)
            {
                CResourceEntity res    = new CResourceEntity().Load(_resource);
                String          curDir = res.MakeFullPath();
                searchScopes.Add(curDir);
            }

            if (myDirBox.Checked)
            {
                int             myDirId = _currentUser.Usr_Resource;
                CResourceEntity res     = new CResourceEntity().Load(myDirId);
                String          myDir   = res.MakeFullPath();
                searchScopes.Add(myDir);
            }

            if (archiveDirBox.Checked)
            {
                int        archiveId = _currentUser.GetUserOrganize().Org_ArchiveRes;
                CACLEntity acl1      = new CACLEntity();
                acl1.Acl_Resource  = archiveId;
                acl1.Acl_Operation = (int)ACLOPERATION.READ;

                if (_currentUser.CheckPrivilege(acl1))
                {
                    CResourceEntity res        = new CResourceEntity().Load(archiveId);
                    String          archiveDir = res.MakeFullPath();
                    searchScopes.Add(archiveDir);
                }
                else
                {
                    List <CResourceEntity> ress = _currentUser.ListDescendants(archiveId);
                    foreach (CResourceEntity res in ress)
                    {
                        searchScopes.Add(res.MakeFullPath());
                    }
                }
            }

            if (shareDirBox.Checked)
            {
                List <CResourceEntity> ress = _currentUser.ListShareResources();
                foreach (CResourceEntity res in ress)
                {
                    searchScopes.Add(res.MakeFullPath());
                }
            }

            _result.Clear();
            foreach (String s in searchScopes)
            {
                SearchFullText(targetText, s);
            }

            this.DialogResult = DialogResult.OK;
            Close();
        }