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");
            }
        }
Ejemplo n.º 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 dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            localhost.Service1 ser    = new localhost.Service1();
            BindingSource      source = new BindingSource();

            ser.showSubjects(txtUserName.Text);
            source.DataSource            =
                dataGridView1.DataSource = source;
        }
        private void dataGridView1_Click(object sender, EventArgs e)
        {
            localhost.Service1 service = new localhost.Service1();
            BindingSource      source  = new BindingSource();

            service.ShowBySubject(cmbsubject.Text);
            source.DataSource        = service.ShowBySubject(cmbsubject.Text);
            dataGridView1.DataSource = source;
        }
Ejemplo n.º 5
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (txtpassword.Text.Length >= 6)
     {
         localhost.Service1 server = new localhost.Service1();
         server.resetPass(txtusername.Text, txtpassword.Text);
         MessageBox.Show("password has been reset");
     }
     else
     {
         MessageBox.Show("Invalid password length");
     }
 }
 private void bbreset_Click(object sender, EventArgs e)
 {
     localhost.Service1 server = new localhost.Service1();
     if (txtpassword.Text.Length >= 6)
     {
         server.resetPassTeacher(txtusername.Text, txtpassword.Text);
         MessageBox.Show("password has been reset");
     }
     else
     {
         MessageBox.Show("Length of password is incorrect");
     }
 }
Ejemplo n.º 7
0
 private void button1_Click(object sender, EventArgs e)
 {
     localhost.Service1 ser = new localhost.Service1();
     if (txtPassword.Text == txtConfirmPassword.Text)
     {
         StudentLoginform form = new StudentLoginform();
         form.Show();
         this.Hide();
     }
     else
     {
         MessageBox.Show("Incorrect Password");
     }
 }
Ejemplo n.º 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool isvalidreset;
            bool isvalidresetpassed;

            localhost.Service1 ser = new localhost.Service1();
            ser.ValidReset(txtusername.Text, cmbquestions.Text, txtanswer.Text, out isvalidreset, out isvalidresetpassed);
            if (isvalidreset)
            {
                MessageBox.Show("Valid Data");
            }
            else
            {
                MessageBox.Show("Invalid information");
            }
        }
Ejemplo n.º 9
0
        private void button1_Click(object sender, EventArgs e)
        {
            localhost.Service1 ser = new localhost.Service1();
            bool isvalidteacher;
            bool isvalidteacherpassed;

            ser.IsLoginTeacher(txtusername.Text, txtpassword.Text, out isvalidteacher, out isvalidteacherpassed);
            if (isvalidteacher)
            {
                MessageBox.Show("Valid Teacher");
            }
            else
            {
                MessageBox.Show("Invalid Teacher");
            }
        }
Ejemplo n.º 10
0
        private void btnLogout_Click(object sender, EventArgs e)
        {
            localhost.Service1 ser = new localhost.Service1();
            bool TeacherLogoutResult;
            bool TeacherLogoutResultSpecified;

            ser.TeacherLogout(out TeacherLogoutResult, out TeacherLogoutResultSpecified);
            if (TeacherLogoutResult)
            {
                TeacherLoginform frm = new TeacherLoginform();
                this.Hide();
                frm.Show();
            }
            else
            {
            }
        }
        private void bbsave_Click(object sender, EventArgs e)
        {
            bool isF;
            bool isFF;

            localhost.Service1 ser = new localhost.Service1();
            ser.SetPasswordTeacher(txtusername.Text, txtsecret.Text, out isF, out isFF);
            if (isF == true)
            {
                TeacherResetPassword rf = new TeacherResetPassword();
                this.Hide();
                rf.Show();
            }
            else
            {
                MessageBox.Show("wrong code");
            }
        }
        private void button6_Click(object sender, EventArgs e)
        {
            localhost.Service1 ser = new localhost.Service1();
            bool StudentLogoutResult;
            bool StudentLogoutResultSpecified;

            ser.StudentLogout(out StudentLogoutResult, out StudentLogoutResultSpecified);
            if (StudentLogoutResult)
            {
                StudentLoginform login = new StudentLoginform();
                this.Hide();
                login.Show();
            }
            else
            {
                MessageBox.Show("Something went wrong");
            }
        }
Ejemplo n.º 13
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            bool isF;
            bool isFF;

            localhost.Service1 ser = new localhost.Service1();
            ser.SetPassword(txtusername.Text, cmbquestions.Text, txtanswer.Text, out isF, out isFF);
            if (isF == true)
            {
                Reset_Password rf = new Reset_Password();
                this.Hide();
                rf.Show();
            }
            else
            {
                MessageBox.Show("wrong answer");
            }
        }
        private void btnShowSubject_Click(object sender, EventArgs e)
        {
            localhost.Service1 ser = new localhost.Service1();
            bool isValidStudentResult;
            bool isValidStudentResultSpecified;

            ser.isValidStudent(txtUserName.Text, out isValidStudentResult, out isValidStudentResultSpecified);
            if (isValidStudentResult)
            {
                BindingSource source = new BindingSource();
                ser.showSubjects(txtUserName.Text);
                source.DataSource        = ser.showSubjects(txtUserName.Text);
                dataGridView1.DataSource = source;
            }
            else
            {
                MessageBox.Show("Invalid Student");
            }
        }
Ejemplo n.º 15
0
        private void button1_Click(object sender, EventArgs e)
        {
            localhost.Service1 ser = new localhost.Service1();
            bool isvaliduser;
            bool isvaliduserpassed;

            ser.isValidUser(txtusername.Text, txtpassword.Text, out isvaliduser, out isvaliduserpassed);

            if (isvaliduser)
            {
                StudentLoginViewForm r = new StudentLoginViewForm();
                this.Hide();
                r.Show();
            }
            else
            {
                MessageBox.Show("InValid User");
            }
        }
        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");
            }
        }
Ejemplo n.º 17
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.");
            }
        }
Ejemplo n.º 18
0
        private void btnShowReport_Click(object sender, EventArgs e)
        {
            localhost.Service1 ser = new localhost.Service1();
            bool Validstu;
            bool ValidStudent;

            ser.isValidStudent(txtusername.Text, out Validstu, out ValidStudent);
            BindingSource source = new BindingSource();

            if (Validstu)
            {
                source.DataSource = ser.StudentViewReport(txtusername.Text);
                ser.StudentViewReport(txtusername.Text);
                dataGridView1.DataSource = source;
            }
            else
            {
                MessageBox.Show("Invalid Student");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            localhost.Service1 service = new localhost.Service1();
            bool isvalidSub;
            bool isvalidsubject;

            service.isValidSubject(cmbsubject.Text, out isvalidsubject, out isvalidSub);
            BindingSource source = new BindingSource();

            if (isvalidsubject)
            {
                service.ShowBySubject(cmbsubject.Text);
                source.DataSource        = service.ShowBySubject(cmbsubject.Text);
                dataGridView1.DataSource = source;
            }
            else
            {
                MessageBox.Show("Subject Not Registered");
            }
        }
Ejemplo n.º 20
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");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            localhost.Service1 ser = new localhost.Service1();
            bool isalreadyexist;
            bool isalreadyexistpassed;

            ser.IsTeacherAlreadyExists(txtusername.Text, txtpassword.Text, out isalreadyexist, out isalreadyexistpassed);
            if (isalreadyexist)
            {
                MessageBox.Show("Teacher already exists");
                txtemail.Text           = "";
                txtusername.Text        = "";
                txtpassword.Text        = "";
                txtconfirmpassword.Text = "";
                txtsecretcode.Text      = "";
            }
            else
            {
                if (txtpassword.Text == txtconfirmpassword.Text && txtpassword.Text.Length >= 6)
                {
                    if (txtsecretcode.Text.Length >= 4 && txtsecretcode.Text.Length <= 7)
                    {
                        ser.RegisterTeacher(txtusername.Text, txtpassword.Text, txtsecretcode.Text);
                        MessageBox.Show("Teacher Has Been Registered");
                        txtemail.Text           = "";
                        txtusername.Text        = "";
                        txtpassword.Text        = "";
                        txtconfirmpassword.Text = "";
                        txtsecretcode.Text      = "";
                    }
                    else
                    {
                        MessageBox.Show("Invalid Secret code ");
                    }
                }
                else
                {
                    MessageBox.Show("Invalid Password Length or mismatch password");
                }
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            localhost.Service1 ser = new localhost.Service1();
            bool isalreadyexist;
            bool isalreadyexistpassed;

            ser.IsAlreadyExist(txtusername.Text, txtpassword.Text, cmbtxt.Text, txtanswer.Text, out isalreadyexist, out isalreadyexistpassed);
            if (isalreadyexist)
            {
                MessageBox.Show("User already exits");
                txtemail.Text    = "";
                txtusername.Text = "";
                txtpassword.Text = "";
                txtconfirm.Text  = "";
                txtanswer.Text   = "";
                cmbtxt.Text      = "";
            }
            else
            {
                if (txtpassword.Text == txtconfirm.Text && txtpassword.Text.Length >= 6)
                {
                    ser.RegisterStd(txtusername.Text, txtpassword.Text, cmbtxt.Text, txtanswer.Text);
                    MessageBox.Show("User has been Registered");
                    txtemail.Text    = "";
                    txtusername.Text = "";
                    txtpassword.Text = "";
                    txtconfirm.Text  = "";
                    txtanswer.Text   = "";
                    cmbtxt.Text      = "";
                }
                else
                {
                    MessageBox.Show("Invalid Password Length or mismatch password");
                }
            }
        }
Ejemplo n.º 23
0
 private void button1_Click(object sender, EventArgs e)
 {
     localhost.Service1 server = new localhost.Service1();
     server.resetPass(textBox1.Text, textBox2.Text);
     MessageBox.Show("password has been reset");
 }
        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");
                }
            }
        }
Ejemplo n.º 25
0
        private void button1_Click(object sender, EventArgs e)
        {
            localhost.Service1 service = new localhost.Service1();
            bool isalreadyexist;
            bool isalreadyexistpassed;
            bool isValidStudentResult;
            bool isValidStudentResultSpecified;

            service.IsSubjectAlreadyExist(txtUserName.Text, cmbSubject.Text, cmbCode.Text, out isalreadyexist, out isalreadyexistpassed);
            service.isValidStudent(txtUserName.Text, out isValidStudentResult, out isValidStudentResultSpecified);
            if (isalreadyexist && isValidStudentResult)
            {
                MessageBox.Show("Subject has been already registered");
                cmbSubject.Text    = "";
                cmbCode.Text       = "";
                txtCreditHour.Text = "";
            }
            else
            {
                if (isValidStudentResult)
                {
                    if (cmbSubject.Text == sub1.Text && cmbCode.Text == code1.Text && txtCreditHour.Text == label6.Text)
                    {
                        service.AddSubject(txtUserName.Text, cmbSubject.Text, cmbCode.Text, txtCreditHour.Text);
                        MessageBox.Show("Subject has been added");
                        cmbSubject.Text    = "";
                        cmbCode.Text       = "";
                        txtCreditHour.Text = "";
                    }
                    else if (cmbSubject.Text == sub2.Text && cmbCode.Text == code2.Text && txtCreditHour.Text == label6.Text)
                    {
                        service.AddSubject(txtUserName.Text, cmbSubject.Text, cmbCode.Text, txtCreditHour.Text);
                        MessageBox.Show("Subject has been added");
                        cmbSubject.Text    = "";
                        cmbCode.Text       = "";
                        txtCreditHour.Text = "";
                    }
                    else if (cmbSubject.Text == sub3.Text && cmbCode.Text == code3.Text && txtCreditHour.Text == label6.Text)
                    {
                        service.AddSubject(txtUserName.Text, cmbSubject.Text, cmbCode.Text, txtCreditHour.Text);
                        MessageBox.Show("Subject has been added");
                        cmbSubject.Text    = "";
                        cmbCode.Text       = "";
                        txtCreditHour.Text = "";
                    }
                    else if (cmbSubject.Text == label4.Text && cmbCode.Text == code4.Text && txtCreditHour.Text == label6.Text)
                    {
                        service.AddSubject(txtUserName.Text, cmbSubject.Text, cmbCode.Text, txtCreditHour.Text);
                        MessageBox.Show("Subject has been added");
                        cmbSubject.Text    = "";
                        cmbCode.Text       = "";
                        txtCreditHour.Text = "";
                    }
                    else if (cmbSubject.Text == sub5.Text && cmbCode.Text == code5.Text && txtCreditHour.Text == label6.Text)
                    {
                        service.AddSubject(txtUserName.Text, cmbSubject.Text, cmbCode.Text, txtCreditHour.Text);
                        MessageBox.Show("Subject has been added");
                        cmbSubject.Text    = "";
                        cmbCode.Text       = "";
                        txtCreditHour.Text = "";
                    }
                    else
                    {
                        MessageBox.Show("Invalid Subject i.e. either SubjectName or SubjectCode or CreditHour doesn't match.Please select a suitable one");
                    }
                }
                else
                {
                    MessageBox.Show("Invalid Student");
                }
            }
        }