private void BindData()
        {
            if (CurrentFolderId > -1)
            {
                SharedFileFolder folder = new SharedFileFolder(this.ModuleId, CurrentFolderId);
                this.lblCurrentDirectory.Text = folder.FolderName;
                this.btnGoUp.Visible          = true;
            }
            else
            {
                this.lblCurrentDirectory.Text = string.Empty;
                this.btnGoUp.Visible          = false;
            }

            DataView dv = new DataView(SharedFileFolder.GetFoldersAndFiles(ModuleId, CurrentFolderId));

            dv.Sort           = "filename" + " " + defaultSort;
            dgFile.DataSource = dv;

            //dgFile.DataSource = SharedFileFolder.GetFoldersAndFiles(ModuleId, CurrentFolderId);

            //dgFile.DataKeyField = "ID";
            dgFile.DataBind();
            lblCounter.Text = dgFile.Rows.Count.ToString() + " "
                              + SharedFileResources.FileManagerObjectsLabel;
        }
Exemple #2
0
        private void BindData()
        {
            if (CurrentFolderId > -1)
            {
                SharedFileFolder folder = new SharedFileFolder(ModuleId, CurrentFolderId);

                btnGoUp.Visible         = true;
                rptFoldersLinks.Visible = true;

                if (displaySettings.ShowClickableFolderPathCrumbs)
                {
                    lblCurrentDirectory.Visible = false;

                    // by Thomas N
                    List <SharedFileFolder> allFolders = SharedFileFolder.GetSharedModuleFolderList(folder.ModuleId);
                    rptFoldersLinks.DataSource = SharedFilesHelper.GetAllParentsFolder(folder, allFolders);

                    IEnumerable <SharedFileFolder> fullPathList = SharedFilesHelper.GetAllParentsFolder(folder, allFolders).Concat(Enumerable.Repeat(folder, 1));
                    rptFoldersLinks.DataSource = fullPathList;
                    rptFoldersLinks.DataBind();
                }
                else
                {
                    lblCurrentDirectory.Text = folder.FolderName;
                }
            }
            else
            {
                lblCurrentDirectory.Visible = false;
                btnGoUp.Visible             = false;
                rptFoldersLinks.Visible     = false;
            }

            DataView dv = new DataView(SharedFileFolder.GetFoldersAndFiles(ModuleId, CurrentFolderId));

            EnumerableRowCollection <DataRow> query =
                from row in dv.Table.AsEnumerable()
                where CheckRoles(row.Field <string>("ViewRoles"))
                select row;

            DataView view = query.AsDataView();

            view.Sort         = $"type ASC, filename {config.DefaultSort}";
            dgFile.DataSource = view;
            dgFile.DataBind();

            lblCounter.Text = $"{dgFile.Rows.Count.ToString()} {SharedFileResources.FileManagerObjectsLabel}";
        }
        private void BindData()
        {
            if (CurrentFolderId > -1)
            {
                SharedFileFolder folder = new SharedFileFolder(this.ModuleId, CurrentFolderId);

                btnGoUp.Visible         = true;
                rptFoldersLinks.Visible = true;

                if (displaySettings.ShowClickableFolderPathCrumbs)
                {
                    lblCurrentDirectory.Visible = false;

                    // by Thomas N
                    List <SharedFileFolder> allFolders = SharedFileFolder.GetSharedModuleFolderList(folder.ModuleId);
                    rptFoldersLinks.DataSource = SharedFilesHelper.GetAllParentsFolder(folder, allFolders);
                    IEnumerable <SharedFileFolder> fullPathList = SharedFilesHelper.GetAllParentsFolder(folder, allFolders).Concat(Enumerable.Repeat(folder, 1));
                    rptFoldersLinks.DataSource = fullPathList;
                    rptFoldersLinks.DataBind();
                }
                else
                {
                    lblCurrentDirectory.Text = folder.FolderName;
                }
            }
            else
            {
                lblCurrentDirectory.Visible = false;
                btnGoUp.Visible             = false;
                rptFoldersLinks.Visible     = false;
            }

            DataView dv = new DataView(SharedFileFolder.GetFoldersAndFiles(ModuleId, CurrentFolderId));

            dv.Sort           = "type ASC, filename" + " " + config.DefaultSort;
            dgFile.DataSource = dv;
            dgFile.DataBind();
            lblCounter.Text = dgFile.Rows.Count.ToString() + " "
                              + SharedFileResources.FileManagerObjectsLabel;
        }
Exemple #4
0
        protected void dgFile_Sorting(object sender, GridViewSortEventArgs e)
        {
            if (ViewState["SortBy"] == null)
            {
                ViewState["SortBy"] = "ASC";
            }
            else if (ViewState["SortBy"].ToString().Equals("ASC"))
            {
                ViewState["SortBy"] = "DESC";
            }
            else
            {
                ViewState["SortBy"] = "ASC";
            }

            DataView dv = new DataView(SharedFileFolder.GetFoldersAndFiles(ModuleId, CurrentFolderId));

            dv.Sort           = e.SortExpression + " " + ViewState["SortBy"];
            dgFile.DataSource = dv;
            dgFile.DataBind();
            upFiles.Update();
        }