private AssetTypeFileExtension GetATFEFromForm() { AssetTypeFileExtension atfe = AssetTypeFileExtension.Get(AssetTypeFileExtensionId); if (atfe.IsNull) { atfe = AssetTypeFileExtension.New(); } atfe.Extension = ExtensionTextBox.Text.Trim().ToLower(); atfe.Name = FileTypeNameTextBox.Text.Trim(); atfe.AssetTypeId = AssetTypeDropDownList.SelectedId; atfe.IsVisible = IsVisibleCheckBox.Checked; atfe.Plugin = PluginManager.GetRegistrationKey(PreviewPluginDropDownList.SelectedId); return(atfe); }
protected void DeleteButton_Click(object sender, EventArgs e) { // Get the ID of the extension to be deleted int id = WebUtils.GetIntRequestParam("AssetTypeFileExtensionId", 0); // Get the file extension to be deleted AssetTypeFileExtension atfe = AssetTypeFileExtension.Get(id); // Now actually delete it AssetTypeFileExtensionManager.Delete(atfe); // Update audit log AuditLogManager.LogUserAction(SessionInfo.Current.User, AuditUserAction.DeleteFileExtension, string.Format("File Extension: {0}, ID: {1}", atfe.Extension, atfe.AssetTypeFileExtensionId)); // Update UI FormPanel.Visible = false; SuccessPanel.Visible = true; MessageLabel2.SetSuccessMessage("File extension deleted successfully"); }