Exemplo n.º 1
0
    /// <summary>
    /// Deletes the workflow scope(s) and culture assignments used for this example. Called when the "Delete objects" button is pressed.
    /// Expects the "CreateExampleObjects" method to be run first.
    /// </summary>
    private bool DeleteObjects()
    {
        CultureInfo culture = CultureInfoProvider.GetCultureInfo("de-de");

        // Remove the example culture from the site
        CultureSiteInfoProvider.RemoveCultureFromSite(culture.CultureID, CMSContext.CurrentSiteID);

        // Prepare parameters
        string where = "ScopeStartingPath LIKE '/API-Example%'";
        string orderBy = null;
        int    topN    = 0;
        string columns = null;

        DataSet scopes = WorkflowScopeInfoProvider.GetWorkflowScopes(where, orderBy, topN, columns);

        if (!DataHelper.DataSourceIsEmpty(scopes))
        {
            // Loop through all the scopes in case more identical scopes were accidentally created
            foreach (DataRow scopeRow in scopes.Tables[0].Rows)
            {
                // Create scope info object
                WorkflowScopeInfo scope = new WorkflowScopeInfo(scopeRow);

                // Delete the scope
                scope.Delete();
            }

            return(true);
        }

        return(false);
    }
Exemplo n.º 2
0
    /// <summary>
    /// Deletes the workflow scope(s). Called when the "Delete workflow scope" button is pressed.
    /// Expects the "CreateWorkflowScope" method to be run first.
    /// </summary>
    private bool DeleteWorkflowScope()
    {
        // Prepare parameters
        string where = "ScopeStartingPath LIKE '/API-Example%'";
        string orderBy = null;
        int    topN    = 0;
        string columns = null;

        DataSet scopes = WorkflowScopeInfoProvider.GetWorkflowScopes(where, orderBy, topN, columns);

        if (!DataHelper.DataSourceIsEmpty(scopes))
        {
            // Loop through all the scopes in case more identical scopes were accidentally created
            foreach (DataRow scopeRow in scopes.Tables[0].Rows)
            {
                // Create scope info object
                WorkflowScopeInfo scope = new WorkflowScopeInfo(scopeRow);

                // Delete the scope
                scope.Delete();
            }

            return(true);
        }

        return(false);
    }
    /// <summary>
    /// Deletes the workflow scope(s) and culture assignments used for this example. Called when the "Delete objects" button is pressed.
    /// Expects the "CreateExampleObjects" method to be run first.
    /// </summary>
    private bool DeleteObjects()
    {
        CultureInfo culture = CultureInfoProvider.GetCultureInfo("de-de");

        // Remove the example culture from the site
        CultureSiteInfoProvider.RemoveCultureFromSite(culture.CultureID, CMSContext.CurrentSiteID);

        // Prepare parameters
        string where = "ScopeStartingPath LIKE '/API-Example%'";
        string orderBy = null;
        int topN = 0;
        string columns = null;

        DataSet scopes = WorkflowScopeInfoProvider.GetWorkflowScopes(where, orderBy, topN, columns);

        if (!DataHelper.DataSourceIsEmpty(scopes))
        {
            // Loop through all the scopes in case more identical scopes were accidentally created
            foreach (DataRow scopeRow in scopes.Tables[0].Rows)
            {
                // Create scope info object
                WorkflowScopeInfo scope = new WorkflowScopeInfo(scopeRow);

                // Delete the scope
                scope.Delete();
            }

            return true;
        }

        return false;
    }
    /// <summary>
    /// Deletes the workflow scope(s). Called when the "Delete workflow scope" button is pressed.
    /// Expects the "CreateWorkflowScope" method to be run first.
    /// </summary>
    private bool DeleteWorkflowScope()
    {
        // Prepare parameters
        string where = "ScopeStartingPath LIKE '/API-Example%'";
        string orderBy = null;
        int topN = 0;
        string columns = null;

        DataSet scopes = WorkflowScopeInfoProvider.GetWorkflowScopes(where, orderBy, topN, columns);

        if (!DataHelper.DataSourceIsEmpty(scopes))
        {
            // Loop through all the scopes in case more identical scopes were accidentally created
            foreach (DataRow scopeRow in scopes.Tables[0].Rows)
            {
                // Create scope info object
                WorkflowScopeInfo scope = new WorkflowScopeInfo(scopeRow);

                // Delete the scope
                scope.Delete();
            }

            return true;
        }

        return false;
    }