//enables correct text box entries for graduate students internal void btnCreateGraduateStudent_Click(object sender, EventArgs e) { MessageBox.Show("Please enter a valid 9 digit ID number, at least a first and last name, a birthdate," + "A major, a 4 scale GPA in the form of 4.00, A Stipend with or without a decimal point depending, " + "and select a degree program from the drop down window ", "Please Enter Data"); FormController.deactivateAddButtons(this); btnClickhereToEnterID.Enabled = false; FormController.activateGraduateStudent(this); owlMemberSelected = 2; txtOwlMemberID.Enabled = true; txtOwlMemberName.Enabled = true; txtOwlMemberBirthDate.Enabled = true; txtStudentGPA.Enabled = true; txtStudentMajor.Enabled = true; txtGraduateStudentDegreeProgram.Enabled = true; txtGraduateStudentStipend.Enabled = true; }
} // 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