|
using System;
using System.Globalization;
using System.Web.UI.WebControls;
using GalleryServerPro.Business;
namespace GalleryServerPro.Web.task
{
public partial class deletealbum : GspPage
{
#region Protected Methods
protected void Page_Load(object sender, EventArgs e)
{
this.CheckUserSecurity(SecurityActions.DeleteAlbum);
if (!IsPostBack)
{
ConfigureControls();
}
}
protected override bool OnBubbleEvent(object source, EventArgs args)
{
//An event from the control has bubbled up. If it's the Ok button, then run the
//code to save the data to the database; otherwise ignore.
Button btn = source as Button;
if ((btn != null) && (((btn.ID == "btnOkTop") || (btn.ID == "btnOkBottom"))))
{
int parentAlbumId = this.GetAlbum().Parent.Id;
btnOkClicked();
this.RedirectToAlbumViewPage("aid", parentAlbumId.ToString(CultureInfo.InvariantCulture));
}
return true;
}
#endregion
#region Public Properties
#endregion
#region Private Methods
private void ConfigureControls()
{
Master.TaskHeader = Resources.GalleryServerPro.Task_Delete_Album_Header_Text;
Master.TaskBody = Resources.GalleryServerPro.Task_Delete_Album_Body_Text;
Master.OkButtonText = Resources.GalleryServerPro.Task_Delete_Album_Ok_Button_Text;
Master.OkButtonToolTip = Resources.GalleryServerPro.Task_Delete_Album_Ok_Button_Tooltip;
}
private void btnOkClicked()
{
//User clicked 'Delete album'.
this.GetAlbum().Delete();
HelperFunctions.PurgeCache();
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have nearly 20 years of industry experience in software development, architecture, and Microsoft Office products. My company
Tech Info Systems provides custom software development services for corporations, governments, and other organizations. Tech Info Systems is a registered member of the Microsoft Partner Program and I am a Microsoft Certified Professional Developer (MCPD).
I am the creator and lead developer of
Gallery Server Pro, a free, open source ASP.NET gallery for sharing photos, video, audio, documents, and other files over the web. It has been developed over several years and has involved thousands of hours. The end result is a robust, configurable, and professional grade gallery that can be integrated into your web site, whether you are a large corporation, small business, professional photographer, or a local church.