Ejemplo n.º 1
0
        private void PopulateFileControls()
        {
            Title        = SiteUtils.FormatPageTitle(siteSettings, SharedFileResources.SharedFilesEditLabel);
            heading.Text = SharedFileResources.SharedFilesEditLabel;

            SharedFile file = new SharedFile(moduleId, itemId);

            if ((file.ItemId > 0) && (file.ModuleId == moduleId))
            {
                pnlNotFound.Visible = false;
                pnlFolder.Visible   = false;
                pnlFile.Visible     = true;

                using (IDataReader reader = SharedFileFolder.GetSharedModuleFolders(file.ModuleId))
                {
                    ddFolders.DataSource = reader;
                    ddFolders.DataBind();
                }

                ddFolders.Items.Insert(0, new ListItem("Root", "-1"));
                ddFolders.SelectedValue = file.FolderId.ToInvariantString();

                hdnCurrentFolderId.Value = file.FolderId.ToInvariantString();

                if (timeZone != null)
                {
                    lblUploadDate.Text = file.UploadDate.ToLocalTime(timeZone).ToString();
                }
                else
                {
                    lblUploadDate.Text = file.UploadDate.AddHours(TimeOffset).ToString();
                }

                SiteUser uploadUser = new SiteUser(siteSettings, file.UploadUserId);
                lblUploadBy.Text     = uploadUser.Name;
                lblFileSize.Text     = file.SizeInKB.ToString();
                txtFriendlyName.Text = file.FriendlyName;
                edDescription.Text   = file.Description;

                if (config.EnableVersioning)
                {
                    using (IDataReader reader = file.GetHistory())
                    {
                        grdHistory.DataSource = reader;
                        grdHistory.DataBind();
                    }
                }

                PopulateAllowedRolesList(cblRolesThatCanViewFile, file.ViewRoles);
            }
            else
            {
                pnlNotFound.Visible = true;
                pnlFolder.Visible   = false;
                pnlFile.Visible     = false;
            }
        }
Ejemplo n.º 2
0
        private void PopulateFileControls()
        {
            Title = SiteUtils.FormatPageTitle(siteSettings, SharedFileResources.SharedFilesEditLabel);

            SharedFile file = new SharedFile(this.moduleId, this.itemId);

            if ((file.ItemId > 0) && (file.ModuleId == this.moduleId))
            {
                this.pnlNotFound.Visible = false;
                this.pnlFolder.Visible   = false;
                this.pnlFile.Visible     = true;

                using (IDataReader reader = SharedFileFolder.GetSharedModuleFolders(file.ModuleId))
                {
                    this.ddFolders.DataSource = reader;
                    this.ddFolders.DataBind();
                }
                this.ddFolders.Items.Insert(0, new ListItem("Root", "-1"));
                this.ddFolders.SelectedValue = file.FolderId.ToString();

                this.lblUploadDate.Text = file.UploadDate.AddHours(timeOffset).ToString();
                SiteUser uploadUser = new SiteUser(siteSettings, file.UploadUserId);
                this.lblUploadBy.Text     = uploadUser.Name;
                this.lblFileSize.Text     = file.SizeInKB.ToString();
                this.txtFriendlyName.Text = file.FriendlyName;
                edDescription.Text        = file.Description;

                using (IDataReader reader = file.GetHistory())
                {
                    grdHistory.DataSource = reader;
                    grdHistory.DataBind();
                }
            }
            else
            {
                pnlNotFound.Visible = true;
                pnlFolder.Visible   = false;
                pnlFile.Visible     = false;
            }
        }