} // end deactivateOwlMember // Disables Student textboxes and highlights the Student groupbox public static void deactivateStudent(frmOwlCommunity f) { deactivateUndergraduateStudent(f); // Must deactivate UG Student too deactivateGraduateStudent(f); // Must deactivate Grad Student too f.grpStudent.Enabled = false; f.grpStudent.BackColor = Color.Red; } // end deactivateStudent
//saves base and sets class attributes to form values internal override void Save(frmOwlCommunity f) { base.Save(f); tuition = f.txtUndergraduateStudentTuition.Text; credits = f.txtUndergraduateStudentCredits.Text; year = f.txtUndergraduateStudentYear.Text; } // end Save
} // end activateGraduateStudent // Enables Chairperson textboxes and highlights the Chairperson groupbox public static void activateChairperson(frmOwlCommunity f) { activateFaculty(f); // Faculty must be activated too f.grpChairperson.Enabled = true; f.grpChairperson.BackColor = Color.LimeGreen; f.btnEnterMember.Enabled = true; } // end activateChairperson
} // end activateChairperson // Disables OwlMember textboxes and highlights the OwlMember groupbox public static void deactivateOwlMember(frmOwlCommunity f) { deactivateStudent(f); deactivateFaculty(f); f.grpOwlMember.Enabled = false; f.grpOwlMember.BackColor = Color.Red; } // end deactivateOwlMember
} // end resetForm // Activates and deactivates necessary form buttons // when in add mode public static void formAddMode(frmOwlCommunity f) { f.btnClear.Enabled = true; f.btnDelete.Enabled = false; f.btnEdit.Enabled = false; f.btnFind.Enabled = false; } // end formAddMode
} // end activateAddButtons // Enable/disable buttons when not in edit mode public static void deactivateAddButtons(frmOwlCommunity f) { f.btnCreateGraduateStudent.Enabled = false; f.btnCreateChairperson.Enabled = false; f.btnCreateUndergraduateStudent.Enabled = false; f.btnCreateFaculty.Enabled = false; } // end deactivateAddButtons
} // end Save // Display data in object on form internal override void Display(frmOwlCommunity f) { base.Display(f); f.txtUndergraduateStudentTuition.Text = tuition.ToString(); f.txtUndergraduateStudentCredits.Text = credits.ToString(); f.txtUndergraduateStudentYear.Text = year.ToString(); } // end Display
} // end activateUndergraduateStudent // Enables Worker textboxes and highlights the Graduate Student groupbox public static void activateGraduateStudent(frmOwlCommunity f) { activateStudent(f); // Student must be activated too f.grpGraduateStudent.Enabled = true; f.grpGraduateStudent.BackColor = Color.LimeGreen; f.btnEnterMember.Enabled = true; } // end activateGraduateStudent
} // end ActivateStudent // Enables Faculty textboxes and highlights the Faculty groupbox public static void activateFaculty(frmOwlCommunity f) { activateOwlMember(f); f.grpFaculty.Enabled = true; f.grpFaculty.BackColor = Color.LimeGreen; f.grpStudent.BackColor = Color.Red; f.btnEnterMember.Enabled = true; } // end activateFaculty
} // end Clear public static void disableAll(frmOwlCommunity f) { f.txtOwlMemberName.Enabled = false; f.txtOwlMemberBirthDate.Enabled = false; f.txtOwlMemberID.Enabled = false; f.txtOwlMemberID.Focus(); f.txtFacultyDepartment.Enabled = false; f.txtFacultyRank.Enabled = false; f.txtStudentMajor.Enabled = false; f.txtStudentGPA.Enabled = false; f.txtUndergraduateStudentTuition.Enabled = false; f.txtUndergraduateStudentYear.Enabled = false; f.txtUndergraduateStudentCredits.Enabled = false; f.txtGraduateStudentStipend.Enabled = false; f.txtGraduateStudentDegreeProgram.Enabled = false; f.txtChairpersonStipend.Enabled = false; }
// Resets form to initial state after form is loaded or // an add Employee operation is performed public static void resetForm(frmOwlCommunity f) { // Reset button components f.btnCreateFaculty.Enabled = true; f.btnCreateFaculty.Text = "Create Faculty"; f.btnCreateChairperson.Enabled = true; f.btnCreateChairperson.Text = "Create Chairperson"; f.btnCreateGraduateStudent.Enabled = true; f.btnCreateGraduateStudent.Text = "Create Graduate Student"; f.btnCreateUndergraduateStudent.Enabled = true; f.btnCreateUndergraduateStudent.Text = "Create Undergraduate"; // Reset group components f.grpOwlMember.Enabled = true; f.grpOwlMember.BackColor = Color.Gainsboro; f.grpStudent.Enabled = false; f.grpStudent.BackColor = Color.Gainsboro; f.grpFaculty.Enabled = false; f.grpFaculty.BackColor = Color.Gainsboro; f.grpUndergraduateStudent.Enabled = false; f.grpUndergraduateStudent.BackColor = Color.Gainsboro; f.grpGraduateStudent.Enabled = false; f.grpGraduateStudent.BackColor = Color.Gainsboro; f.grpChairperson.BackColor = Color.Gainsboro; f.grpChairperson.Enabled = false; // Reset Text boxes f.txtOwlMemberID.Enabled = false; f.txtOwlMemberName.Enabled = false; f.txtOwlMemberBirthDate.Enabled = false; f.txtFacultyDepartment.Enabled = false; f.txtFacultyRank.Enabled = false; f.txtStudentMajor.Enabled = false; f.txtStudentMajor.Enabled = false; f.txtUndergraduateStudentTuition.Enabled = false; f.txtUndergraduateStudentYear.Enabled = false; f.txtUndergraduateStudentCredits.Enabled = false; f.txtGraduateStudentDegreeProgram.Enabled = false; f.txtGraduateStudentStipend.Enabled = false; f.txtFacultyDepartment.Enabled = false; f.txtFacultyRank.Enabled = false; } // end resetForm
//Freshman(0 to 29 credits) //Sophomore(30 to 59 credits) //Junior(60 to 89 credits) //Senior(90 or more credits) //validates undergraduate student credit amounts public static Boolean UndergraduateStudentCredits(string credits, frmOwlCommunity f) { try { string year = Convert.ToString(f.txtUndergraduateStudentYear.Text); int cred = Int32.Parse(credits); int Num; bool isValid = int.TryParse(credits, out Num); if (isValid) { if (year == "Freshman" && (cred >= 0 && cred <= 29)) { return(true); } else if (year == "Sophomore" && (cred >= 30 && cred <= 59)) { return(true); } else if (year == "Junior" && (cred >= 60 && cred <= 89)) { return(true); } else if (year == "Senior" && (cred >= 90)) { return(true); } else { return(false); } } else { return(false); } } catch { return(false); } }
} // end deativateChairperson // Clear all textboxes on the form public static void clear(frmOwlCommunity f) { f.txtOwlMemberName.Text = ""; f.txtOwlMemberBirthDate.Text = ""; f.txtOwlMemberID.Text = ""; f.txtOwlMemberID.Focus(); f.txtFacultyDepartment.Text = ""; f.txtFacultyRank.Text = ""; f.txtStudentMajor.Text = ""; f.txtStudentGPA.Text = ""; f.txtUndergraduateStudentTuition.Text = ""; f.txtUndergraduateStudentYear.Text = ""; f.txtUndergraduateStudentCredits.Text = ""; f.txtGraduateStudentStipend.Text = ""; f.txtGraduateStudentDegreeProgram.Text = ""; f.txtChairpersonStipend.Text = ""; f.txtMemberType.Text = ""; f.txtMemberType.Enabled = false; resetForm(f); f.btnClickhereToEnterID.Enabled = true; } // end Clear
} // end Property //method used for saving base and setting chairperson stipend to the form entry value internal override void Save(frmOwlCommunity f) { base.Save(f); chairpersonStipend = f.txtChairpersonStipend.Text; } // end Save
} // end deactivateAddButtons // Enables OwlMember textboxes and highlights the OwlMember groupbox public static void activateOwlMember(frmOwlCommunity f) { f.grpOwlMember.Enabled = true; f.grpOwlMember.BackColor = Color.LimeGreen; } // end activateOwlMember
//saves base attributes and sets class attributes to form values internal override void Save(frmOwlCommunity f) { base.Save(f); stipend = f.txtGraduateStudentStipend.Text; degreeProgram = f.txtGraduateStudentDegreeProgram.Text; } // end Save
} // end Save // Display data in object on form internal override void Display(frmOwlCommunity f) { base.Display(f); f.txtGraduateStudentStipend.Text = stipend.ToString(); f.txtGraduateStudentDegreeProgram.Text = degreeProgram; } // end Display
} // end activateOwlMember // Enables Student textboxes and highlights the Student groupbox public static void activateStudent(frmOwlCommunity f) { activateOwlMember(f); f.grpStudent.Enabled = true; f.grpStudent.BackColor = Color.LimeGreen; } // end ActivateStudent
} // end Property // Save data from form to object internal override void Save(frmOwlCommunity f) { base.Save(f); hiddenStudentMajor = f.txtStudentMajor.Text; hiddenStudentGPA = f.txtStudentGPA.Text; } // end Save
} // end deativateGraduateStudent // Disables Chairperson textboxes and highlights the Chairperson groupbox public static void deactivateChairperson(frmOwlCommunity f) { f.grpFaculty.Enabled = false; f.grpChairperson.BackColor = Color.Red; } // end deativateChairperson
} // end Save // Display data in object on form internal override void Display(frmOwlCommunity f) { base.Display(f); f.txtFacultyDepartment.Text = department; f.txtFacultyRank.Text = rank; } // end Display
} // end Save // Display data in object on form internal override void Display(frmOwlCommunity f) { base.Display(f); f.txtStudentMajor.Text = hiddenStudentMajor; f.txtStudentGPA.Text = hiddenStudentGPA.ToString(); } // end Display
} // end Property //method used to save the base values and setting the class values to that of form entries internal override void Save(frmOwlCommunity f) { base.Save(f); department = f.txtFacultyDepartment.Text; rank = f.txtFacultyRank.Text; } // end Save
} // end Save // Display data in object on form internal override void Display(frmOwlCommunity f) { base.Display(f); f.txtChairpersonStipend.Text = chairpersonStipend.ToString(); } // end Display
} // end deactivateUndergraduateStudent // Disables Graduate Student textboxes and highlights the Grad Student groupbox public static void deactivateGraduateStudent(frmOwlCommunity f) { f.grpGraduateStudent.Enabled = false; f.grpGraduateStudent.BackColor = Color.Red; } // end deativateGraduateStudent