Beispiel #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Teachers t = new Teachers();

            t.imageLocation = imgLocation;

            if (lblUMessage.Text != "Update")
            {
                if (txtATName.Text != "" && cmbATPosition.Text == "Head Teacher" && cmbATGender.Text != "" && txtATPhone.Text != "")
                {
                    t.JoinHeadTeacher(txtATName.Text, txtATQualification.Text, dateTimePickerATJ.Text, txtATPhone.Text, txtATEmail.Text, txtATAddress.Text);

                    txtATName.Text          = "";
                    txtATQualification.Text = "";
                    txtATPhone.Text         = "";
                    txtATEmail.Text         = "";
                    txtATAddress.Text       = "";
                }
                else if (txtATName.Text != "" && cmbATPosition.Text != "" && cmbATGender.Text != "" && txtATPhone.Text != "")
                {
                    t.JoinAssistantTeachers(txtATName.Text, cmbATPosition.Text, txtATQualification.Text, dateTimePickerATB.Text, dateTimePickerATJ.Text, cmbATGender.Text, txtATPhone.Text, txtATEmail.Text, txtATAddress.Text);

                    txtATName.Text          = "";
                    cmbATPosition.Text      = "";
                    txtATQualification.Text = "";
                    cmbATGender.Text        = "";
                    txtATPhone.Text         = "";
                    txtATEmail.Text         = "";
                    txtATAddress.Text       = "";
                }
                else
                {
                    MessageBox.Show("Please fillup all information");
                }
            }
            else
            {
                if (lblUTMessage.Text == "HeadTeacher" && cmbATPosition.Text == "Head Teacher")
                {
                    t.UpdateHeadTeacher(txtATName.Text, txtATQualification.Text, dateTimePickerATJ.Text, txtATPhone.Text, txtATEmail.Text, txtATAddress.Text);
                    this.Hide();
                    View_Teachers vt = new View_Teachers();
                    vt.Show();
                }
                else if (lblUTMessage.Text == "AssistantTeacher" && cmbATPosition.Text == "Assistant Teacher")
                {
                    t.UpdateAssistantTeachers(txtATName.Text, cmbATPosition.Text, txtATQualification.Text, dateTimePickerATB.Text, dateTimePickerATJ.Text, cmbATGender.Text, txtATPhone.Text, txtATEmail.Text, txtATAddress.Text, Id);
                    this.Hide();
                    View_Teachers vt = new View_Teachers();
                    vt.Show();
                }
                else
                {
                    MessageBox.Show("You input wrong position");
                }
            }
        }
Beispiel #2
0
        private void assistantTeacherToolStripMenuItem_Click(object sender, EventArgs e)
        {
            View_Teachers VT = new View_Teachers();

            VT.Show();
        }