コード例 #1
0
        protected void btnRename_Click(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                RenameFileModal.Show();
                return;
            }

            // move files
            string oldPath = GetFullRelativePath((string)ViewState["RenameFile"]);
            string newPath = GetFullRelativePath(txtRenameFile.Text);

            try
            {
                int result = ES.Services.Files.RenameFile(PanelSecurity.PackageId, oldPath, newPath);
                if (result < 0)
                {
                    messageBox.ShowResultMessage(result);
                    return;
                }
            }
            catch (Exception ex)
            {
                messageBox.ShowErrorMessage("FILES_RENAME_FILE", ex);
            }

            // hide form
            RenameFileModal.Hide();
            gvFiles.DataBind();
        }
コード例 #2
0
 protected void btnCancelRename_Click(object sender, EventArgs e)
 {
     RenameFileModal.Hide();
 }