/// <summary> /// Handles the OptionCategoryGrid'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 OptionCategoryGrid_OnAction(string actionName, object actionArgument) { int categoryId = ValidationHelper.GetInteger(actionArgument, 0); // Set actions if (actionName == "edit") { URLHelper.Redirect("OptionCategory_Edit.aspx?CategoryID=" + categoryId + "&siteId=" + SelectSite.SiteID); } else if (actionName == "delete") { OptionCategoryInfo categoryObj = OptionCategoryInfoProvider.GetOptionCategoryInfo(categoryId); if (!ECommerceContext.IsUserAuthorizedToModifyOptionCategory(categoryObj)) { // Check module permissions if (categoryObj.CategoryIsGlobal) { RedirectToAccessDenied("CMS.Ecommerce", "EcommerceGlobalModify"); } else { RedirectToAccessDenied("CMS.Ecommerce", "EcommerceModify OR ModifyProducts"); } } // Check dependencies if (OptionCategoryInfoProvider.CheckDependencies(categoryId)) { // Show error message ShowError(GetString("Ecommerce.DeleteDisabled")); return; } // Delete option category from database OptionCategoryInfoProvider.DeleteOptionCategoryInfo(categoryObj); } }