コード例 #1
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            var item = dataGridView1.Rows[e.RowIndex].Cells[1].Value;

            localhost.Service1 service = new localhost.Service1();
            bool isvalidsub;
            bool isvalidsubject;

            service.isTeacherValidSubject(comboBox1.Text, out isvalidsubject, out isvalidsub);
            if (isvalidsubject)
            {
                TeacherUploadReport r = new TeacherUploadReport(comboBox1.Text);
                this.Hide();
                r.Show();
            }
            else
            {
                MessageBox.Show("Teacher has not registered this subject, so he has no authority to update any result.");
            }
        }
コード例 #2
0
        private void btnShow_Click(object sender, EventArgs e)
        {
            localhost.Service1 ser = new localhost.Service1();
            bool isvalidSub;
            bool isvalidsubject;

            ser.isTeacherValidSubject(cmbSubject.Text, out isvalidsubject, out isvalidSub);
            BindingSource source = new BindingSource();

            if (isvalidsubject)
            {
                source.DataSource = ser.TeacherViewDMC(cmbSubject.Text);
                ser.TeacherViewDMC(cmbSubject.Text);
                dataGridView1.DataSource = source;
            }
            else
            {
                MessageBox.Show("Invalid subject");
            }
        }
コード例 #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            localhost.Service1 service = new localhost.Service1();
            bool isValidsub;
            bool isValidsubject;

            service.isTeacherValidSubject(comboBox1.Text, out isValidsubject, out isValidsub);
            BindingSource source = new BindingSource();

            if (isValidsubject)
            {
                source.DataSource = service.TeacherViewReport(comboBox1.Text);
                service.TeacherViewReport(comboBox1.Text);
                dataGridView1.DataSource = source;
            }
            else
            {
                MessageBox.Show("Invalid Subject");
            }
        }