コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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";
        }
コード例 #3
0
        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;
        }