private void AddingPractitionerOptionsForm()
 {
     if (dataGridViewPractitioners.SelectedRows.Count != 1)
     {
         MessageBox.Show("Please Select a Practitioner to View their Options");
     }
     else
     {
         int practitionerIdToView = Convert.ToInt32(dataGridViewPractitioners.SelectedRows[0].Cells[0].Value);
         MedicalCentrePractitionerOptionsMainForm practitionerOptionsMainForm = new MedicalCentrePractitionerOptionsMainForm(practitionerIdToView);
         var result = practitionerOptionsMainForm.ShowDialog();
         if (result == DialogResult.OK)
         {
             // reload the datagridview
             InitializePractitionersRecordsView(dataGridViewPractitioners);
             dataGridViewPatients.Refresh();
         }
         // hide the child form
         practitionerOptionsMainForm.Hide();
     }
 }
        /// <summary>
        /// Method to load practitioner options into a child form
        /// </summary>
        private void AddingPractitionerOptionsForm()
        {
            // check that one practitioner is checked- if not error message
            if (dataGridViewPractitioners.SelectedRows.Count != 1)
            {
                MessageBox.Show("Please Select a Practitioner to View their Options");
                return;
            }
            // get the practitioner id
            int practitionerIdToView = Convert.ToInt32(dataGridViewPractitioners.SelectedRows[0].Cells[0].Value);
            // load and show practitioners options form passing the id
            MedicalCentrePractitionerOptionsMainForm practitionerOptionsMainForm = new MedicalCentrePractitionerOptionsMainForm(practitionerIdToView);

            practitionerOptionsMainForm.ShowDialog();

            // reload the datagridview- once child is closed
            ReloadPractitionersRecordsView(dataGridViewPractitioners);
            dataGridViewPractitioners.Refresh();
            // hide the child form
            practitionerOptionsMainForm.Hide();
        }