/// <summary> /// Deletes badge. Called when the "Delete badge" button is pressed. /// Expects the CreateBadge method to be run first. /// </summary> private bool DeleteBadge() { // Get the badge BadgeInfo deleteBadge = BadgeInfoProvider.GetBadgeInfo("MyNewBadge"); // Delete the badge BadgeInfoProvider.DeleteBadgeInfo(deleteBadge); return(deleteBadge != null); }
/// <summary> /// Unigrid on action event handler. /// </summary> void UniGrid_OnAction(string actionName, object actionArgument) { // Edit action if (DataHelper.GetNotEmpty(actionName, String.Empty) == "edit") { URLHelper.Redirect("~/CMSModules/Badges/Badges_Edit.aspx?badgeid=" + ValidationHelper.GetString(actionArgument, "0")); } // Delete action else if (DataHelper.GetNotEmpty(actionName, String.Empty) == "delete") { int badgeId = ValidationHelper.GetInteger(actionArgument, 0); if (badgeId > 0) { BadgeInfoProvider.DeleteBadgeInfo(badgeId); } } }