Exemple #1
0
 //handles the save update button on the form
 private void btnSaveUpdates_Click_1(object sender, EventArgs e)
 {
     if (txtMemberType.Text == "Undergraduate Student")
     {
         dbFunctions.UpdateUndergraduateStudent(txtOwlMemberID.Text, txtOwlMemberName.Text, txtOwlMemberBirthDate.Text, txtStudentMajor.Text,
                                                txtStudentGPA.Text, txtUndergraduateStudentTuition.Text, txtUndergraduateStudentCredits.Text, txtUndergraduateStudentYear.Text);
         MessageBox.Show("Updates Saved", "Saved");
         FormController.clear(this);
     }
     else if (txtMemberType.Text == "Graduate Student")
     {
         dbFunctions.UpdateGraduateStudent(txtOwlMemberID.Text, txtOwlMemberName.Text, txtOwlMemberBirthDate.Text, txtStudentMajor.Text,
                                           txtStudentGPA.Text, txtGraduateStudentStipend.Text, txtGraduateStudentDegreeProgram.Text);
         MessageBox.Show("Updates Saved", "Saved");
         FormController.clear(this);
     }
     else if (txtMemberType.Text == "Faculty Member")
     {
         dbFunctions.UpdateFaculty(txtOwlMemberID.Text, txtOwlMemberName.Text, txtOwlMemberBirthDate.Text, txtFacultyDepartment.Text, txtFacultyRank.Text);
         MessageBox.Show("Updates Saved", "Saved");
         FormController.clear(this);
     }
     else if (txtMemberType.Text == "Faculty Chairperson")
     {
         dbFunctions.UpdateChairperson(txtOwlMemberID.Text, txtOwlMemberName.Text, txtOwlMemberBirthDate.Text, txtFacultyDepartment.Text,
                                       txtFacultyRank.Text, txtFacultyRank.Text);
         MessageBox.Show("Updates Saved", "Saved");
         FormController.clear(this);
     }
     else if (txtMemberType.Text != "Undergraduate Student" || txtMemberType.Text != "Graduate Student" || txtMemberType.Text != "Faculty Member" || txtMemberType.Text != "Faculty Chairperson")
     {
         MessageBox.Show("Please select a member type from the drop down box and then proceed", "Error");
     }
 }
Exemple #2
0
 //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;
 }
Exemple #3
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;
 }
Exemple #4
0
        //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;
        }
Exemple #5
0
 //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;
 }
Exemple #6
0
        //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;
        }
Exemple #7
0
 //handles the no delete button to the form
 private void btnNO_Click(object sender, EventArgs e)
 {
     FormController.activateAddButtons(this);
     MessageBox.Show("Please begin new function", "Delete Cancelled");
 }
Exemple #8
0
 //clear button on the form to clear the form data
 private void btnClear_Click_1(object sender, EventArgs e)
 {
     FormController.clear(this);
     btnSaveUpdates.Enabled = false;
 }
Exemple #9
0
        }     // end if on success

        //Enters a member into the database depending on member type selected
        private void btnEnterMember_Click(object sender, EventArgs e)
        {
            if (owlMemberSelected == 1)
            {
                UndergraduateStudentValidation();
                if (inputValidity == true)
                {
                    UndergraduateStudent undergraduateStudent = new UndergraduateStudent(txtUndergraduateStudentTuition.Text, txtUndergraduateStudentCredits.Text,
                                                                                         txtUndergraduateStudentYear.Text, txtOwlMemberName.Text, txtOwlMemberID.Text, txtOwlMemberBirthDate.Text,
                                                                                         txtStudentMajor.Text, txtStudentGPA.Text);
                    dbFunctions.InsertUndergraduateStudent(txtOwlMemberID.Text, txtOwlMemberName.Text, txtOwlMemberBirthDate.Text, txtStudentMajor.Text,
                                                           txtStudentGPA.Text, txtUndergraduateStudentTuition.Text,
                                                           txtUndergraduateStudentYear.Text, txtUndergraduateStudentCredits.Text);
                    FormController.resetForm(this);
                    MessageBox.Show("Member Entered", "Entry Complete");
                }
                else
                {
                    MessageBox.Show("Please Correct Data Input style to provided examples", "Input Invalid");
                }
            }
            if (owlMemberSelected == 2)
            {
                GraduateStudentValidation();
                if (inputValidity == true)
                {
                    GraduateStudent graduateStudent = new GraduateStudent(txtGraduateStudentStipend.Text, txtGraduateStudentDegreeProgram.Text,
                                                                          txtOwlMemberName.Text, txtOwlMemberID.Text, txtOwlMemberBirthDate.Text,
                                                                          txtStudentMajor.Text, txtStudentGPA.Text);
                    dbFunctions.InsertGraduateStudent(txtOwlMemberID.Text, txtOwlMemberName.Text, txtOwlMemberBirthDate.Text, txtStudentMajor.Text, txtStudentGPA.Text,
                                                      txtGraduateStudentDegreeProgram.Text, txtGraduateStudentStipend.Text);
                    FormController.resetForm(this);
                    MessageBox.Show("Member Entered", "Entry Complete");
                }
                else
                {
                    MessageBox.Show("Please Correct Data Input style to provided examples", "Input Invalid");
                }
            }
            if (owlMemberSelected == 3)
            {
                FacultyValidation();
                if (inputValidity == true)
                {
                    FacultyClass faculty = new FacultyClass(txtFacultyDepartment.Text, txtFacultyRank.Text, txtOwlMemberID.Text,
                                                            txtOwlMemberName.Text, txtOwlMemberBirthDate.Text);
                    dbFunctions.InsertFaculty(txtOwlMemberID.Text, txtOwlMemberName.Text, txtOwlMemberBirthDate.Text, txtFacultyDepartment.Text, txtFacultyRank.Text);
                    FormController.resetForm(this);
                    MessageBox.Show("Member Entered", "Entry Complete");
                }
                else
                {
                    MessageBox.Show("Please Correct Data Input style to provided examples", "Input Invalid");
                }
            }
            if (owlMemberSelected == 4)
            {
                ChairpersonValidation();
                if (inputValidity == true)
                {
                    ChairpersonClass chairperson = new ChairpersonClass(txtChairpersonStipend.Text, txtFacultyDepartment.Text, txtFacultyRank.Text,
                                                                        txtOwlMemberID.Text, txtOwlMemberName.Text, txtOwlMemberBirthDate.Text);
                    dbFunctions.InsertChairperson(txtOwlMemberID.Text, txtOwlMemberName.Text, txtOwlMemberBirthDate.Text, txtChairpersonStipend.Text,
                                                  txtFacultyDepartment.Text, txtFacultyRank.Text);
                    FormController.resetForm(this);
                    MessageBox.Show("Member Entered", "Entry Complete");
                }
                else
                {
                    MessageBox.Show("Please Correct Data Input style to provided examples", "Input Invalid");
                }
            }
        }
Exemple #10
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