コード例 #1
0
ファイル: Default.aspx.cs プロジェクト: kudutest2/Kentico
    /// <summary>
    /// Gets and bulk updates scheduled tasks. Called when the "Get and bulk update tasks" button is pressed.
    /// Expects the CreateScheduledTask method to be run first.
    /// </summary>
    private bool GetAndBulkUpdateScheduledTasks()
    {
        // Get the data
        DataSet tasks = TaskInfoProvider.GetAllTasks();

        if (!DataHelper.DataSourceIsEmpty(tasks))
        {
            // Loop through the individual items
            foreach (DataRow taskDr in tasks.Tables[0].Rows)
            {
                // Create object from DataRow
                TaskInfo modifyTask = new TaskInfo(taskDr);

                // Update the properties
                modifyTask.TaskDisplayName = modifyTask.TaskDisplayName.ToUpper();

                // Save the changes
                TaskInfoProvider.SetTaskInfo(modifyTask);
            }

            return(true);
        }

        return(false);
    }