Exemplo n.º 1
0
    /// <summary>
    /// Deletes tag group. Called when the "Delete group" button is pressed.
    /// Expects the CreateTagGroup method to be run first.
    /// </summary>
    private bool DeleteTagGroup()
    {
        // Get the tag group
        string where = "TagGroupName LIKE 'MyNew%'";

        // Get the data
        DataSet groups = TagGroupInfoProvider.GetTagGroups(where, null);

        if (!DataHelper.DataSourceIsEmpty(groups))
        {
            // Loop through the individual items
            foreach (DataRow groupDr in groups.Tables[0].Rows)
            {
                // Create object from DataRow
                TagGroupInfo deleteGroup = new TagGroupInfo(groupDr);

                // Delete the tag group
                TagGroupInfoProvider.DeleteTagGroupInfo(deleteGroup);
            }

            return(true);
        }

        return(false);
    }
Exemplo n.º 2
0
    /// <summary>
    /// Gets and bulk updates tag groups. Called when the "Get and bulk update groups" button is pressed.
    /// Expects the CreateTagGroup method to be run first.
    /// </summary>
    private bool GetAndBulkUpdateTagGroups()
    {
        // Prepare the parameters
        string where = "TagGroupName LIKE 'MyNew%'";

        // Get the data
        DataSet groups = TagGroupInfoProvider.GetTagGroups(where, null);

        if (!DataHelper.DataSourceIsEmpty(groups))
        {
            // Loop through the individual items
            foreach (DataRow groupDr in groups.Tables[0].Rows)
            {
                // Create object from DataRow
                TagGroupInfo modifyGroup = new TagGroupInfo(groupDr);

                // Update the property
                modifyGroup.TagGroupDisplayName = modifyGroup.TagGroupDisplayName.ToUpper();

                // Update the tag group
                TagGroupInfoProvider.SetTagGroupInfo(modifyGroup);
            }

            return(true);
        }

        return(false);
    }