private void btnSubmit_Click(object sender, EventArgs e)
        {
            localhost.Service1 ser = new localhost.Service1();
            bool isValidUpload;
            bool isValidUploadSpecified;
            bool isValidTeacherResult;
            bool isValidTeacherResultSpecified;

            ser.isValidTeacher(txtTeacherName.Text, out isValidTeacherResult, out isValidTeacherResultSpecified);
            if (isValidTeacherResult)
            {
                ser.UploadDMC(txtStudentName.Text, txtTeacherName.Text, cmbGrade.Text, label3.Text, out isValidUpload, out isValidUploadSpecified);
                if (isValidUpload)
                {
                    MessageBox.Show("Grade has been uploaded");
                }
                else
                {
                    MessageBox.Show("Invalid Data");
                }
            }
            else
            {
                MessageBox.Show("Invalid Teacher Name");
            }
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            localhost.Service1 service = new localhost.Service1();
            bool isValidUpload;
            bool isValidUploadSpecified;
            bool isValidTeacherResult;
            bool isValidTeacherResultSpecified;

            service.isValidTeacher(textBox1.Text, out isValidTeacherResult, out isValidTeacherResultSpecified);
            if (isValidTeacherResult)
            {
                service.UploadReport(textBox2.Text, textBox1.Text, label3.Text, comboBox1.Text, textBox4.Text, out isValidUpload, out isValidUploadSpecified);
                if (isValidUpload)
                {
                    MessageBox.Show("Report has been uploaded");
                }
                else
                {
                    MessageBox.Show("Invalid Information");
                }
            }
            else
            {
                MessageBox.Show("Invalid Teacher");
            }
        }
        private void btnViewSubject_Click(object sender, EventArgs e)
        {
            localhost.Service1 ser = new localhost.Service1();
            bool          isvalidTeacherResult;
            bool          isValidTeacherResultSpecified;
            BindingSource source = new BindingSource();

            ser.isValidTeacher(txtUserName.Text, out isvalidTeacherResult, out isValidTeacherResultSpecified);
            if (isvalidTeacherResult)
            {
                ser.TeacherShowSubject(txtUserName.Text);
                source.DataSource        = ser.TeacherShowSubject(txtUserName.Text);
                dataGridView1.DataSource = source;
            }
            else
            {
                MessageBox.Show("Invalid Teacher");
            }
        }
        private void btnregister_Click(object sender, EventArgs e)
        {
            localhost.Service1 ser = new localhost.Service1();
            bool isalreadyexist;
            bool isalreadyexistpassed;

            ser.isTeacherSubAlreadyExist(txtusername.Text, cmbofferedsubjects.Text, cmbsubjectcode.Text, out isalreadyexist, out isalreadyexistpassed);
            bool isValudTeacherResultSpecified;
            bool isValidTeacherResult;

            ser.isValidTeacher(txtusername.Text, out isValidTeacherResult, out isValudTeacherResultSpecified);
            if (isalreadyexist && isValidTeacherResult)
            {
                MessageBox.Show("Subject is already registered ");
                cmbsubjectcode.Text     = "";
                cmbofferedsubjects.Text = "";
                txtcredithours.Text     = "";
            }
            else
            {
                if (isValidTeacherResult)
                {
                    if (cmbofferedsubjects.Text == sub1.Text && cmbsubjectcode.Text == code1.Text && txtcredithours.Text == label6.Text)
                    {
                        ser.AddTeacherRegisteredSubject(txtusername.Text, cmbofferedsubjects.Text, cmbsubjectcode.Text, txtcredithours.Text);
                        MessageBox.Show("OOP has been registered");
                        cmbsubjectcode.Text     = "";
                        cmbofferedsubjects.Text = "";
                        txtcredithours.Text     = "";
                    }
                    else if (cmbofferedsubjects.Text == sub2.Text && cmbsubjectcode.Text == code2.Text && txtcredithours.Text == label6.Text)
                    {
                        ser.AddTeacherRegisteredSubject(txtusername.Text, cmbofferedsubjects.Text, cmbsubjectcode.Text, txtcredithours.Text);
                        MessageBox.Show("PF has been registered");
                        cmbsubjectcode.Text     = "";
                        cmbofferedsubjects.Text = "";
                        txtcredithours.Text     = "";
                    }
                    else if (cmbsubjectcode.Text == code3.Text && cmbofferedsubjects.Text == sub3.Text && txtcredithours.Text == label6.Text)
                    {
                        ser.AddTeacherRegisteredSubject(txtusername.Text, cmbofferedsubjects.Text, cmbsubjectcode.Text, txtcredithours.Text);
                        MessageBox.Show("ICS has been registered");
                        cmbsubjectcode.Text     = "";
                        cmbofferedsubjects.Text = "";
                        txtcredithours.Text     = "";
                    }
                    else if (cmbofferedsubjects.Text == lblDiscreteMathematics.Text && cmbsubjectcode.Text == code4.Text && txtcredithours.Text == label6.Text)
                    {
                        ser.AddTeacherRegisteredSubject(txtusername.Text, cmbofferedsubjects.Text, cmbsubjectcode.Text, txtcredithours.Text);
                        MessageBox.Show("DM has been registered");
                        cmbsubjectcode.Text     = "";
                        cmbofferedsubjects.Text = "";
                        txtcredithours.Text     = "";
                    }
                    else if (cmbofferedsubjects.Text == sub5.Text && cmbsubjectcode.Text == code5.Text && txtcredithours.Text == label6.Text)
                    {
                        ser.AddTeacherRegisteredSubject(txtusername.Text, cmbofferedsubjects.Text, cmbsubjectcode.Text, txtcredithours.Text);
                        MessageBox.Show("DLD has been registered");
                        cmbsubjectcode.Text     = "";
                        cmbofferedsubjects.Text = "";
                        txtcredithours.Text     = "";
                    }
                    else
                    {
                        MessageBox.Show("Invalid Data");
                    }
                }
                else
                {
                    MessageBox.Show("Invalid User");
                }
            }
        }