/// <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) { if (actionName == "edit") { var editElementName = IsMultiStoreConfiguration ? "edit.configuration.GlobalPaymentoption" : "edit.configuration.paymentoption"; URLHelper.Redirect(UIContextHelper.GetElementUrl("cms.ecommerce", editElementName, false, ValidationHelper.GetInteger(actionArgument, 0))); } else if (actionName == "delete") { var paymentInfoObj = PaymentOptionInfoProvider.GetPaymentOptionInfo(ValidationHelper.GetInteger(actionArgument, 0)); // Nothing to delete if (paymentInfoObj == null) { return; } // Check permissions CheckConfigurationModification(paymentInfoObj.PaymentOptionSiteID); if (paymentInfoObj.Generalized.CheckDependencies()) { // Show error message ShowError(ECommerceHelper.GetDependencyMessage(paymentInfoObj)); return; } // Delete PaymentOptionInfo object from database PaymentOptionInfoProvider.DeletePaymentOptionInfo(paymentInfoObj); } }
/// <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) { if (actionName == "edit") { URLHelper.Redirect("PaymentOption_Edit.aspx?paymentOptionId=" + Convert.ToString(actionArgument) + "&siteId=" + SelectSite.SiteID); } else if (actionName == "delete") { PaymentOptionInfo paymentInfoObj = PaymentOptionInfoProvider.GetPaymentOptionInfo(ValidationHelper.GetInteger(actionArgument, 0)); // Nothing to delete if (paymentInfoObj == null) { return; } // Check permissions CheckConfigurationModification(paymentInfoObj.PaymentOptionSiteID); if (PaymentOptionInfoProvider.CheckDependencies(paymentInfoObj.PaymentOptionID)) { // Show error message ShowError(GetString("Ecommerce.DeleteDisabled")); return; } // Delete PaymentOptionInfo object from database PaymentOptionInfoProvider.DeletePaymentOptionInfo(paymentInfoObj); } }