Пример #1
0
 //handles create faculty button
 private void btnCreateFaculty_Click(object sender, EventArgs e)
 {
     MessageBox.Show("Please enter a 9 digit ID, at least a first and last name, birthdate, an all letter department and " +
                     "select a rank from the drop down box", "Please Enter Info");
     FormController.deactivateAddButtons(this);
     btnClickhereToEnterID.Enabled = false;
     FormController.activateFaculty(this);
     owlMemberSelected             = 3;
     txtOwlMemberID.Enabled        = true;
     txtOwlMemberName.Enabled      = true;
     txtOwlMemberBirthDate.Enabled = true;
     txtFacultyRank.Enabled        = true;
     txtFacultyDepartment.Enabled  = true;
 }
Пример #2
0
        }     // end displayDbInformation

        // Checks if Owl List is empty and, if not, copies the data for the
        // ith OwlMember to the appropriate group textboxes using the display method+.
        // Also checks to determine if the next button should be enabled.
        private void btnEdit_Click_1(object sender, EventArgs e)
        {
            btnFind.Enabled   = false;
            btnDelete.Enabled = false;
            btnEdit.Enabled   = false;

            if (Validation.IDValidation(txtOwlMemberID.Text) == true)
            {
                if (txtMemberType.Text == "Undergraduate Student")
                {
                    FormController.activateUndergraduateStudent(this);
                    FormController.deactivateFaculty(this);
                    FormController.deactivateGraduateStudent(this);
                    FormController.deactivateChairperson(this);
                    FormController.deactivateAddButtons(this);
                    displayDbInformation();
                    txtOwlMemberID.Enabled                 = false;
                    txtMemberType.Enabled                  = false;
                    txtOwlMemberName.Enabled               = true;
                    txtOwlMemberBirthDate.Enabled          = true;
                    txtStudentGPA.Enabled                  = true;
                    txtStudentMajor.Enabled                = true;
                    txtUndergraduateStudentCredits.Enabled = true;
                    txtUndergraduateStudentTuition.Enabled = true;
                    txtUndergraduateStudentYear.Enabled    = true;
                    btnSaveUpdates.Enabled                 = true;
                }

                else if (txtMemberType.Text == "Graduate Student")
                {
                    FormController.activateGraduateStudent(this);
                    FormController.deactivateFaculty(this);
                    FormController.deactivateUndergraduateStudent(this);
                    FormController.deactivateChairperson(this);
                    FormController.deactivateAddButtons(this);
                    displayDbInformation();
                    txtOwlMemberID.Enabled                  = false;
                    txtMemberType.Enabled                   = false;
                    txtOwlMemberName.Enabled                = true;
                    txtOwlMemberBirthDate.Enabled           = true;
                    txtStudentGPA.Enabled                   = true;
                    txtStudentMajor.Enabled                 = true;
                    txtGraduateStudentStipend.Enabled       = true;
                    txtGraduateStudentDegreeProgram.Enabled = true;
                    btnSaveUpdates.Enabled                  = true;
                }
                else if (txtMemberType.Text == "Faculty Member")
                {
                    FormController.deactivateGraduateStudent(this);
                    FormController.activateFaculty(this);
                    FormController.deactivateUndergraduateStudent(this);
                    FormController.deactivateChairperson(this);
                    FormController.deactivateAddButtons(this);
                    displayDbInformation();
                    txtOwlMemberID.Enabled        = false;
                    txtMemberType.Enabled         = false;
                    txtOwlMemberName.Enabled      = true;
                    txtOwlMemberBirthDate.Enabled = true;
                    txtFacultyRank.Enabled        = true;
                    txtFacultyDepartment.Enabled  = true;
                    btnSaveUpdates.Enabled        = true;
                }
                else if (txtMemberType.Text == "Faculty Chairperson")
                {
                    FormController.deactivateGraduateStudent(this);
                    FormController.activateFaculty(this);
                    FormController.deactivateUndergraduateStudent(this);
                    FormController.activateChairperson(this);
                    FormController.deactivateAddButtons(this);
                    displayDbInformation();
                    txtOwlMemberID.Enabled        = false;
                    txtMemberType.Enabled         = false;
                    txtOwlMemberName.Enabled      = true;
                    txtOwlMemberBirthDate.Enabled = true;
                    txtFacultyRank.Enabled        = true;
                    txtFacultyDepartment.Enabled  = true;
                    txtChairpersonStipend.Enabled = true;
                    btnSaveUpdates.Enabled        = true;
                }
            }  // end multiple alternative if
            else
            {
                MessageBox.Show("Fatal error. Data type not Faculty, Undergrad, GradStudent, or Chairperson.  Program     ",
                                "Mis-typed Object", MessageBoxButtons.OK);
                this.Close();
            } // end multiple alternative if
        }     // end if on success