//handles the enter ID button on form private void btnClickhereToEnterID_Click_1(object sender, EventArgs e) { MessageBox.Show("Please enter a 9 digit ID and select a member type"); btnClickhereToEnterID.Enabled = false; FormController.clear(this); FormController.deactivateAddButtons(this); txtOwlMemberID.Enabled = true; txtMemberType.Visible = true; txtMemberType.Enabled = true; lblSelectMemberType.Visible = true; btnEnterMember.Enabled = false; }
//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; }
//handles create chairperson button private void btnCreateChairperson_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," + "select a rank from the drop down box, and input a stipend either with or without a decimal point", "Please Enter Info"); btnClickhereToEnterID.Enabled = false; FormController.deactivateAddButtons(this); FormController.activateChairperson(this); owlMemberSelected = 4; txtOwlMemberID.Enabled = true; txtOwlMemberName.Enabled = true; txtOwlMemberBirthDate.Enabled = true; txtFacultyRank.Enabled = true; txtFacultyDepartment.Enabled = true; txtChairpersonStipend.Enabled = true; }
//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; }
//handles create undergrad button private void btnCreateUndergraduateStudent_Click_1(object sender, EventArgs e) { MessageBox.Show("Please enter a 9 digit ID, at least a first and last name, birthdate, a valid all letter Major, " + "a 4 scale gpa in the form of 4.00, A tuition with or without decimal points, integer credit amount and your academic " + "year based off credit count(Freshman(0 to 29 credits),Sophomore(30 to 59 credits),Junior(60 to 89 credits),Senior(90 or more credits) ", "Please Enter Info"); FormController.deactivateAddButtons(this); btnClickhereToEnterID.Enabled = false; FormController.activateUndergraduateStudent(this); owlMemberSelected = 1; txtOwlMemberID.Enabled = true; txtOwlMemberName.Enabled = true; txtOwlMemberBirthDate.Enabled = true; txtStudentGPA.Enabled = true; txtStudentMajor.Enabled = true; txtUndergraduateStudentCredits.Enabled = true; txtUndergraduateStudentTuition.Enabled = true; txtUndergraduateStudentYear.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