Esempio n. 1
0
    /// <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 gridElem_OnAction(string actionName, object actionArgument)
    {
        int id = actionArgument.ToInteger(0);

        if (actionName == "edit")
        {
            URLHelper.Redirect("InternalStatus_Edit.aspx?statusid=" + id + "&siteId=" + SiteID);
        }
        else if (actionName == "delete")
        {
            CheckConfigurationModification();

            var status = InternalStatusInfoProvider.GetInternalStatusInfo(id);
            if (status != null)
            {
                if (status.Generalized.CheckDependencies())
                {
                    // Show error message
                    ShowError(ECommerceHelper.GetDependencyMessage(status));

                    return;
                }

                // delete InternalStatusInfo object from database
                InternalStatusInfoProvider.DeleteInternalStatusInfo(status);
            }
        }
    }
Esempio n. 2
0
    /// <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 gridElem_OnAction(string actionName, object actionArgument)
    {
        if (actionName == "edit")
        {
            URLHelper.Redirect("InternalStatus_Edit.aspx?statusid=" + Convert.ToString(actionArgument) + "&siteId=" + SiteID);
        }
        else if (actionName == "delete")
        {
            CheckConfigurationModification();

            if (InternalStatusInfoProvider.CheckDependencies(ValidationHelper.GetInteger(actionArgument, 0)))
            {
                lblError.Visible = true;
                lblError.Text    = GetString("Ecommerce.DeleteDisabled");
                return;
            }

            // delete InternalStatusInfo object from database
            InternalStatusInfoProvider.DeleteInternalStatusInfo(ValidationHelper.GetInteger(actionArgument, 0));
        }
    }