Exemplo n.º 1
0
        private void BindFileGrid()
        {
            FileSystem fs = new FileSystem(Globals.CurrentIdentity);
            string path = GetCurrentPath();
            if (path == null) return;

            CFile file = fs.GetFile(path);
            CFile.FileList dirlist;
            try {
                dirlist = fs.ListDirectory(file);
            } catch (CustomException er) {
                dirlist = new CFile.FileList();
                DisplayMessage(er.Message);
            }

            dirlist.Insert(0, file);

            m_curdir = file;
            dgFiles.DataSource = dirlist;
            dgFiles.DataBind();
        }
Exemplo n.º 2
0
        protected void UpdateTreeNode(TreeNode node, bool fullreload)
        {
            FileSystem fs = new FileSystem(Globals.CurrentIdentity);
            CFile dir;

            dir = fs.GetFile(node.NodeData);
            if (fullreload) node.Nodes.Clear();
            if (node.Nodes.Count == 0) {

                CFile.FileList dirlist;
                try {
                    dirlist = fs.ListDirectory(dir);
                } catch (CustomException er) {
                    DisplayMessage(er.Message); return;
                }

                if (dirlist.Count > 0)
                    AddToTreeNode(node, dirlist);
            }
        }
Exemplo n.º 3
0
        private void LoadCourseNode(TreeNode par, int courseID)
        {
            FileSystem fs = new FileSystem(Globals.CurrentIdentity);
            Courses courseda = new Courses(Globals.CurrentIdentity);
            Course course = courseda.GetInfo(courseID);

            par.Nodes.Clear();
            //Load announcement folder
            if (!StudentMode)
                AddAnnFolderNode(par.Nodes, courseID);

            //Load content
            CFile.FileList cdir = fs.ListDirectory(fs.GetFile(course.ContentID));
            foreach (CFile file in cdir) {
                if (file.IsDirectory())
                    AddFolderNode(par.Nodes, file);
                else
                    AddDocumentNode(par.Nodes, file);
            }

            //Load assignments
            Assignment.AssignmentList assts;
            if (StudentMode)
                assts = courseda.GetStudentAssignments(courseID);
            else
                assts = courseda.GetAssignments(courseID);
            foreach (Assignment asst in assts)
                AddAsstNode(par.Nodes, asst);

            //Add section folder
            if (!StudentMode) {
                AddBackupsNode(par.Nodes, courseID);
                AddSectionFolderNode(par.Nodes, courseID, "Users and Sections");
                AddPermNode(par.Nodes, courseID);
            }
        }
Exemplo n.º 4
0
        private void LoadFolderNode(TreeNode par, int fileID)
        {
            FileSystem fs = new FileSystem(Globals.CurrentIdentity);
            par.Nodes.Clear();
            CFile.FileList cdir;

            try {
                cdir = fs.ListDirectory(fs.GetFile(fileID));
            } catch (CustomException er) {
                PageError(er.Message); return;
            }

            foreach (CFile file in cdir) {
                if (file.IsDirectory())
                    AddFolderNode(par.Nodes, file);
                else
                    AddDocumentNode(par.Nodes, file);
            }
        }
Exemplo n.º 5
0
        private void LoadAsstNode(TreeNode par, int asstID)
        {
            FileSystem fs = new FileSystem(Globals.CurrentIdentity);
            Assignments asstda = new Assignments(Globals.CurrentIdentity);
            Assignment asst = asstda.GetInfo(asstID);

            //Load content
            par.Nodes.Clear();
            CFile.FileList cdir = fs.ListDirectory(fs.GetFile(asst.ContentID));
            foreach (CFile file in cdir) {
                if (file.IsDirectory())
                    AddFolderNode(par.Nodes, file);
                else
                    AddDocumentNode(par.Nodes, file);
            }

            if (StudentMode) {
                AddSubFolderNode(par.Nodes, asstID);
                AddGroupFolderNode(par.Nodes, asstID);
                AddCompetitionNode(par.Nodes, asstID);
                AddResFolderNode(par.Nodes, asstID);
            }
            else {
                //Load rubric
                Rubric rub = asstda.GetRubric(asstID);
                AddRubricNode(par.Nodes, rub);

                AddFeedbackNode(par.Nodes, asstID);
                AddAutoSysNode(par.Nodes, asstID);

                AddSectionFolderNode(par.Nodes, asst.CourseID, "Users and Sections");

                AddPermNode(par.Nodes, asstID);
            }
        }