Exemplo n.º 1
0
    /// <summary>
    /// Deletes relationship name. Called when the "Delete name" button is pressed.
    /// Expects the CreateRelationshipName method to be run first.
    /// </summary>
    private bool DeleteRelationshipName()
    {
        // Get the relationship name
        RelationshipNameInfo deleteName = RelationshipNameInfoProvider.GetRelationshipNameInfo("MyNewRelationshipName");

        // Delete the relationship name
        RelationshipNameInfoProvider.DeleteRelationshipName(deleteName);

        return(deleteName != null);
    }
    /// <summary>
    /// Handles the UniGrid's OnAction event.
    /// </summary>
    /// <param name="actionName">Name of item (button) that threw event</param>
    /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param>
    protected void UniGridRelationshipNames_OnAction(string actionName, object actionArgument)
    {
        int relationshipNameId = Convert.ToInt32(actionArgument);

        if (actionName == "edit")
        {
            URLHelper.Redirect("RelationshipName_Edit.aspx?relationshipnameid=" + relationshipNameId);
        }

        else if (actionName == "delete")
        {
            RelationshipNameInfoProvider.DeleteRelationshipName(relationshipNameId);
        }
    }