/// <summary> /// Deletes static newsletter. Called when the "Delete newsletter" button is pressed. /// Expects the CreateStaticNewsletter method to be run first. /// </summary> private bool DeleteStaticNewsletter() { // Get the static newsletter NewsletterInfo deleteNewsletter = NewsletterInfoProvider.GetNewsletterInfo("MyNewStaticNewsletter", CMSContext.CurrentSiteID); // Delete the static newsletter NewsletterInfoProvider.DeleteNewsletterInfo(deleteNewsletter); return(deleteNewsletter != null); }
/// <summary> /// Deletes dynamic newsletter. Called when the "Delete newsletter" button is pressed. /// Expects the CreateDynamicNewsletter method to be run first. /// </summary> private bool DeleteDynamicNewsletter() { // Get the dynamic newsletter NewsletterInfo deleteNewsletter = NewsletterInfoProvider.GetNewsletterInfo("MyNewDynamicNewsletter", SiteContext.CurrentSiteID); // Delete the dynamic newsletter NewsletterInfoProvider.DeleteNewsletterInfo(deleteNewsletter); return(deleteNewsletter != null); }
/// <summary> /// Handles the UniGrid's OnAction event. /// </summary> /// <param name="actionName">Name of item (button) that throws event</param> /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param> protected void uniGrid_OnAction(string actionName, object actionArgument) { switch (actionName.ToLowerCSafe()) { case "edit": URLHelper.Redirect("Newsletter_Frameset.aspx?newsletterid=" + Convert.ToString(actionArgument)); break; case "delete": if (!CMSContext.CurrentUser.IsAuthorizedPerResource("cms.newsletter", "configure")) { RedirectToCMSDeskAccessDenied("cms.newsletter", "configure"); } // delete Newsletter object from database NewsletterInfoProvider.DeleteNewsletterInfo(ValidationHelper.GetInteger(actionArgument, 0)); break; } }