//Populates textboxes
        private void Delete_Existing_Dropdown_SelectionChangeCommitted(object sender, EventArgs e)
        {
            Reffering_GP_Database.RefferingGPSelectedDelete(Delete_Existing_Dropdown, Input_1, Input_2,
                                                            Input_3, Input_4, Input_5, Input_6, Input_7);

            //Allows user to delete record
            Delete.Enabled = true;
        }
        //When a user clicks a selection from the dropdown box all the values of the selected Reffering GP will
        //populate the fields.  The program will also know that this is an edit session and not a new Reffering GP
        private void Dropdown_1_SelectionChangeCommitted(object sender, EventArgs e)
        {
            Reffering_GP_Database.RefferingGPSelectedAddEdit(Dropdown_1, Input_1, Input_2, Input_3, Input_4,
                                                             Input_5, Input_6, Dropdown_2);
            AddOrEditFields(true);

            //Allows user to save record
            Save.Enabled = true;
        }
        //Saves changes to new Reffering GP or existing Reffering GP
        private void Save_Click(object sender, EventArgs e)
        {
            bool saveSuccess = Reffering_GP_Database.SaveRefferingGP(Dropdown_1, Input_1, Input_2, Input_3, Input_4,
                                                                     Input_5, Input_6, Dropdown_2);

            if (saveSuccess == true)
            {
                AddOrEditFields(false);     //Changes fields to read only.  User needs to select
                                            //add new Reffering GP or edit existing if they want to continue
                Add_Dropdown_1.Focus();
            }
        }
 //Deletes Reffering GP
 private void Delete_Click(object sender, EventArgs e)
 {
     Reffering_GP_Database.DeleteRefferingGP(Delete_Existing_Dropdown, Input_1);
     if (Delete_Existing_Dropdown.DataSource == null)
     {
         Input_1.Clear();
         Input_2.Clear();
         Input_3.Clear();
         Input_4.Clear();
         Input_5.Clear();
         Input_6.Clear();
         Input_7.Clear();
     }
 }
        //Views all of the records determined by the dropdown1 selection
        private void View_All_Click(object sender, EventArgs e)
        {
            switch (Global.view)
            {
            case "View Patients":
                Patient_Database.ViewAllRecords(Dropdown_1, Records_Gridview);
                break;

            case "View Consultations":
                Consultation_Database.ViewAllRecords(Dropdown_1, Records_Gridview);
                break;

            case "View Reffering GPs":
                Reffering_GP_Database.ViewAllRecords(Records_Gridview);
                break;

            case "View Practices":
                Practice_Database.ViewAllRecords(Records_Gridview);
                break;
            }
            Total_Records.Text = Records_Gridview.Rows.Count.ToString();
        }
        private void Search_Click(object sender, EventArgs e)
        {
            switch (Global.view)
            {
            case "View Patients":
                Patient_Database.ViewSearchedRecords(Records_Gridview, Input_1, Dropdown_1, Dropdown_2,
                                                     Dropdown_3, Date_1, Date_2);
                break;

            case "View Consultations":
                Consultation_Database.ViewSearchedRecords(Records_Gridview, Input_1, Dropdown_1, Dropdown_2,
                                                          Dropdown_3, Date_1, Date_2);
                break;

            case "View Reffering GPs":
                Reffering_GP_Database.ViewSearchedRecords(Records_Gridview, Input_1, Dropdown_2);
                break;

            case "View Practices":
                Practice_Database.ViewSearchedRecords(Records_Gridview, Input_1, Dropdown_2);
                break;
            }
            Total_Records.Text = Records_Gridview.Rows.Count.ToString();
        }
        //Sets the search input box and labels
        private void Dropdown_2_SelectionChangeCommitted(object sender, EventArgs e)
        {
            Search.Enabled = true;          //Allows user to search once a selection is made
            switch (Global.view)
            {
            case "View Patients":
                Patient_Database.Show_HideSearchOptions(Dropdown_2, Dropdown_3, Input_1, Date_1,
                                                        Date_2, Search_Label, Search_Label2);
                break;

            case "View Consultations":
                Consultation_Database.Show_HideSearchOptions(Dropdown_2, Dropdown_3, Input_1, Date_1,
                                                             Date_2, Search_Label, Search_Label2);
                break;

            case "View Reffering GPs":
                Reffering_GP_Database.Show_HideSearchOptions(Dropdown_2, Input_1, Search_Label);
                break;

            case "View Practices":
                Practice_Database.Show_HideSearchOptions(Dropdown_2, Input_1, Search_Label);
                break;
            }
        }
 //Shows list of patients to delete
 private void Delete_Existing_Dropdown_DropDown(object sender, EventArgs e)
 {
     Reffering_GP_Database.PopulateRefferingGPDropdown(Delete_Existing_Dropdown);
 }
 //When dropdown occurs a list of GPS from the Reffering GP Table will populate
 //Reffering_GP_Dropdown
 private void Dropdown_2_DropDown(object sender, EventArgs e)
 {
     Reffering_GP_Database.PopulateRefferingGPDropdown(Dropdown_3);
 }