Beispiel #1
0
        //this method initiates read only mode
        // and creates the faculty object to be displayed
        private void showFacultyContact(int index)
        {
            AddEditFaculty aef = new AddEditFaculty();

            aef.ReadOnlyMode = true;

            Faculty F = (Faculty)educationPeople[index];

            aef.FirstName      = F.FirstName;
            aef.LastName       = F.LastName;
            aef.Department     = F.Department;
            aef.EmailAddress   = F.CI.EmailAddress;
            aef.OfficeLocation = F.CI.OfficeLocation;

            DialogResult result = aef.ShowDialog();

            if (result != DialogResult.OK)
            {
                return;
            }

            ContactInformation contact = new ContactInformation();

            contact.EmailAddress   = aef.EmailAddress;
            contact.OfficeLocation = aef.OfficeLocation;
            EducationPerson person = new Faculty(aef.FirstName,
                                                 aef.LastName,
                                                 aef.Department,
                                                 contact);
        }
Beispiel #2
0
        //this method is used to edit faculty individuals or persons
        //pop the faculty dialogue and configure it
        private void editFaculty(int index)
        {
            AddEditFaculty aef = new AddEditFaculty();

            aef.EditMode = true;

            Faculty F = (Faculty)educationPeople[index];

            aef.FirstName      = F.FirstName;
            aef.LastName       = F.LastName;
            aef.Department     = F.Department;
            aef.EmailAddress   = F.CI.EmailAddress;
            aef.OfficeLocation = F.CI.OfficeLocation;

            DialogResult result = aef.ShowDialog();


            if (result != DialogResult.OK)
            {
                return;
            }

            ContactInformation contact = new ContactInformation();

            contact.EmailAddress   = aef.EmailAddress;
            contact.OfficeLocation = aef.OfficeLocation;
            EducationPerson person = new Faculty(aef.FirstName,
                                                 aef.LastName,
                                                 aef.Department,
                                                 contact);

            result = MessageBox.Show($"Are you sure you like to update {person.FirstName}'s details?",
                                     "Confirmation", MessageBoxButtons.YesNo);
            if (result == DialogResult.Yes)
            {
                educationPeople[index]             = person;
                ContactDisplayListBoz.Items[index] = person.ToFormattedString();
            }
            else
            {
                return;
            }
        }
Beispiel #3
0
        //this method creates a faculty object reference
        private Faculty createFacultyPerson()
        {
            AddEditFaculty aef = new AddEditFaculty();

            DialogResult result;

            result = aef.ShowDialog();
            if (result != DialogResult.OK)
            {
                return(null);
            }

            ContactInformation contact = new ContactInformation();

            contact.EmailAddress   = aef.EmailAddress;
            contact.OfficeLocation = aef.OfficeLocation;

            Faculty F = new Faculty(aef.FirstName,
                                    aef.LastName,
                                    aef.Department,
                                    contact);

            return(F);
        }