Ejemplo n.º 1
0
    /// <summary>
    /// Gets and bulk updates inline controls. Called when the "Get and bulk update controls" button is pressed.
    /// Expects the CreateInlineControl method to be run first.
    /// </summary>
    private bool GetAndBulkUpdateInlineControls()
    {
        // Prepare the parameters
        string where = "ControlName LIKE N'MyNewControl%'";

        // Get the data
        DataSet controls = InlineControlInfoProvider.GetInlineControls(where, null);
        if (!DataHelper.DataSourceIsEmpty(controls))
        {
            // Loop through the individual items
            foreach (DataRow controlDr in controls.Tables[0].Rows)
            {
                // Create object from DataRow
                InlineControlInfo modifyControl = new InlineControlInfo(controlDr);

                // Update the properties
                modifyControl.ControlDisplayName = modifyControl.ControlDisplayName.ToUpper();

                // Save the changes
                InlineControlInfoProvider.SetInlineControlInfo(modifyControl);
            }

            return true;
        }

        return false;
    }