Пример #1
0
    /// <summary>
    /// Gets and bulk updates reports. Called when the "Get and bulk update reports" button is pressed.
    /// Expects the CreateReport method to be run first.
    /// </summary>
    private bool GetAndBulkUpdateReports()
    {
        // Prepare the parameters
        string where = "ReportName LIKE N'MyNewReport%'";
        string orderby = "";
        int    topN    = 0;
        string columns = "";

        // Get the data
        DataSet reports = ReportInfoProvider.GetReports(where, orderby, topN, columns);

        if (!DataHelper.DataSourceIsEmpty(reports))
        {
            // Loop through the individual items
            foreach (DataRow reportDr in reports.Tables[0].Rows)
            {
                // Create object from DataRow
                ReportInfo modifyReport = new ReportInfo(reportDr);

                // Update the properties
                modifyReport.ReportDisplayName = modifyReport.ReportDisplayName.ToUpper();

                // Save the changes
                ReportInfoProvider.SetReportInfo(modifyReport);
            }

            return(true);
        }

        return(false);
    }