private void btnSelect_Click(object sender, EventArgs e)
        {
            if (cboReport.SelectedItem == "Report 1")
            {
                ReportDataSet.Clear();
                string filePath = "http://nestor.sunderland.ac.uk/~bg69qw/accenture-courses/api.php?key=213958403&type=courses&quarter=1";

                ReportDataSet.ReadXml(filePath);
            }
            else if (cboReport.SelectedItem == "Report 2")
            {
                ReportDataSet.Clear();
                string filePath = "http://nestor.sunderland.ac.uk/~bg69qw/accenture-courses/api.php?key=213958403&type=courses&quarter=2";

                ReportDataSet.ReadXml(filePath);
            }
            else if (cboReport.SelectedItem == "Report 3")
            {
                ReportDataSet.Clear();
                string filePath = "http://nestor.sunderland.ac.uk/~bg69qw/accenture-courses/api.php?key=213958403&type=courses&quarter=3";

                ReportDataSet.ReadXml(filePath);
            }
            else if (cboReport.SelectedItem == "Report 4")
            {
                ReportDataSet.Clear();
                string filePath = "http://nestor.sunderland.ac.uk/~bg69qw/accenture-courses/api.php?key=213958403&type=courses&quarter=4";

                ReportDataSet.ReadXml(filePath);
            }
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            btnSelect.TabStop   = false;
            btnSelect.FlatStyle = FlatStyle.Flat;
            btnSelect.FlatAppearance.BorderSize = 0;

            btnViewComment.TabStop   = false;
            btnViewComment.FlatStyle = FlatStyle.Flat;
            btnViewComment.FlatAppearance.BorderSize = 0;

            btnAddComment.TabStop   = false;
            btnAddComment.FlatStyle = FlatStyle.Flat;
            btnAddComment.FlatAppearance.BorderSize = 0;

            btnCancel.TabStop   = false;
            btnCancel.FlatStyle = FlatStyle.Flat;
            btnCancel.FlatAppearance.BorderSize = 0;

            btnSearch.TabStop   = false;
            btnSearch.FlatStyle = FlatStyle.Flat;
            btnSearch.FlatAppearance.BorderSize = 0;


            //using (StreamReader sr = new StreamReader("Settings.txt"))
            //{
            //    while (sr.Peek() != -1)
            //    {
            //        this.BackColor = (sr.Read);
            //    }
            //}


            // combo box
            cboReport.Items.Add("Report 1");
            cboReport.Items.Add("Report 2");
            cboReport.Items.Add("Report 3");
            cboReport.Items.Add("Report 4");

            //fill datagrid
            string filePath = "http://nestor.sunderland.ac.uk/~bg69qw/accenture-courses/api.php?key=213958403&type=courses&quarter=1";

            ReportDataSet.ReadXml(filePath);

            dgvAll.DataSource = ReportDataSet;
            ReportDataSet.Clear();
            dgvAll.DataMember = "course";

            dgvAll.Columns[0].HeaderText = "Course";
            dgvAll.Columns[1].HeaderText = "Quater";
            dgvAll.Columns[2].HeaderText = "Course Cost";
            dgvAll.Columns[3].HeaderText = "Hours";
            dgvAll.Columns[4].HeaderText = "Cost With Travel";
            dgvAll.Columns[5].HeaderText = "Location";
            dgvAll.Columns[6].HeaderText = "Number of Enrolements";
            dgvAll.Columns[7].HeaderText = "Raw Total Cost";
            dgvAll.Columns[8].HeaderText = "Total Cost With Travel";
            dgvAll.Columns[9].HeaderText = "Total Hours";
        }
        private void btnSearch_Click(object sender, EventArgs e)
        {
            ReportDataSet.Clear();
            string filePath = "http://nestor.sunderland.ac.uk/~bg69qw/accenture-courses/api.php?key=213958403&type=search&query=" + txtSearch.Text;

            ReportDataSet.ReadXml(filePath);

            dgvAll.DataSource = ReportDataSet;
        }
 public virtual int Fill(ReportDataSet.LineLaborHourReportSourceDataTable dataTable, System.DateTime 日期, System.DateTime 日期1) {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     this.Adapter.SelectCommand.Parameters[0].Value = ((System.DateTime)(日期));
     this.Adapter.SelectCommand.Parameters[1].Value = ((System.DateTime)(日期1));
     if ((this.ClearBeforeFill == true)) {
         dataTable.Clear();
     }
     int returnValue = this.Adapter.Fill(dataTable);
     return returnValue;
 }
 public virtual int Fill(ReportDataSet.UnitPriceReportDataTable dataTable, global::System.Nullable<global::System.DateTime> 實際完成日, global::System.Nullable<global::System.DateTime> 實際完成日1) {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if ((實際完成日.HasValue == true)) {
         this.Adapter.SelectCommand.Parameters[0].Value = ((System.DateTime)(實際完成日.Value));
     }
     else {
         this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
     }
     if ((實際完成日1.HasValue == true)) {
         this.Adapter.SelectCommand.Parameters[1].Value = ((System.DateTime)(實際完成日1.Value));
     }
     else {
         this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
     }
     if ((this.ClearBeforeFill == true)) {
         dataTable.Clear();
     }
     int returnValue = this.Adapter.Fill(dataTable);
     return returnValue;
 }
 public virtual int Fill(ReportDataSet.UnfinishedWorksheetReportSourceDataTable dataTable, System.DateTime 開始日期, System.DateTime 結束日期, bool 輸出全部) {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     this.Adapter.SelectCommand.Parameters[0].Value = ((System.DateTime)(開始日期));
     this.Adapter.SelectCommand.Parameters[1].Value = ((System.DateTime)(結束日期));
     this.Adapter.SelectCommand.Parameters[2].Value = ((bool)(輸出全部));
     if ((this.ClearBeforeFill == true)) {
         dataTable.Clear();
     }
     int returnValue = this.Adapter.Fill(dataTable);
     return returnValue;
 }
 public virtual int Fill(ReportDataSet.FinishedWorksheetReportSourceDataTable dataTable, global::System.Nullable<global::System.DateTime> 開始日期, global::System.Nullable<global::System.DateTime> 結束日期) {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if ((開始日期.HasValue == true)) {
         this.Adapter.SelectCommand.Parameters[0].Value = ((System.DateTime)(開始日期.Value));
     }
     else {
         this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
     }
     if ((結束日期.HasValue == true)) {
         this.Adapter.SelectCommand.Parameters[1].Value = ((System.DateTime)(結束日期.Value));
     }
     else {
         this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
     }
     if ((this.ClearBeforeFill == true)) {
         dataTable.Clear();
     }
     int returnValue = this.Adapter.Fill(dataTable);
     return returnValue;
 }