Beispiel #1
0
    /// <summary>
    /// Gets and bulk updates projects. Called when the "Get and bulk update projects" button is pressed.
    /// Expects the CreateProject method to be run first.
    /// </summary>
    private bool GetAndBulkUpdateProjects()
    {
        // Prepare the parameters
        string where = "ProjectName LIKE N'MyNewProject%'";
        string orderBy = "";
        int    topN    = 0;
        string columns = "";

        // Get the data
        DataSet projects = ProjectInfoProvider.GetProjects(where, orderBy, topN, columns);

        if (!DataHelper.DataSourceIsEmpty(projects))
        {
            // Loop through the individual items
            foreach (DataRow projectDr in projects.Tables[0].Rows)
            {
                // Create object from DataRow
                ProjectInfo modifyProject = new ProjectInfo(projectDr);

                // Update the properties
                modifyProject.ProjectDisplayName = modifyProject.ProjectDisplayName.ToUpper();

                // Save the changes
                ProjectInfoProvider.SetProjectInfo(modifyProject);
            }

            return(true);
        }

        return(false);
    }