//Deletes patient
        private void Delete_Click(object sender, EventArgs e)
        {
            Patient_Database.DeletePatient(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();
                Input_8.Clear();
                Input_9.Clear();
                Input_10.Clear();
                Input_11.Clear();
                Input_12.Clear();
                Input_13.Clear();
                Input_14.Clear();
                Input_15.Clear();
                Current_Patient.Checked = false;
                GP_Letter.Checked       = false;
            }
        }
 //When a user clicks a selection from the dropdown box all the values of the selected patient will
 //populate the fields.  The program will also know that this is an edit session and not a new patient
 private void Dropdown_1_SelectionChangeCommitted(object sender, EventArgs e)
 {
     Patient_Database.PatientSelectedAddEdit(Dropdown_1, Input_1, Date_1, Date_2, Dropdown_2, Input_2, Input_3, Input_4,
                                             Input_5, Input_6, Input_7, Input_8, Input_9, Input_10, Input_11, Dropdown_3, GP_Letter);
     AddOrEditFields(true);              //Changes read only on fields to false
     Current_Patient.Checked = true;     //Will alwasy be a current patient deemed by the sql statement
 }
        //Populates patient details in textboxes
        private void Dropdown_1_SelectionChangeCommitted(object sender, EventArgs e)
        {
            Patient_Database.patientSelectedGenerateLetter(Dropdown_1, Input_1, Input_2,
                                                           Input_3, Input_4, Input_5, GP_Letter);

            //Gets all initial consultations of patient
            DataTable initialConsultations =
                Consultation_Database.CheckInitialConsultations(Dropdown_1);
            int consCount = initialConsultations.Rows.Count;

            //Depending on how many initial consultations will depend on the text displayed
            if (consCount == 0)
            {
                Input_6.Text = "No Initial Consultation";
            }
            else if (consCount == 1)
            {
                Input_6.Text = Convert.ToString(initialConsultations.Rows[0]["Display Text"]);
            }
            else if (consCount > 1)
            {
                Input_6.Text = "More than one Initial Consultation";
            }

            //Enables controls to generate letters
            Initial_Letter.Enabled      = true;
            Initial_Letter_MHLP.Enabled = true;
            No_Contact_Letter.Enabled   = true;
            GP_Letter.Enabled           = true;
        }
        //Populates fields with patient details
        private void Delete_Existing_Dropdown_SelectionChangeCommitted(object sender, EventArgs e)
        {
            Patient_Database.PatientSelectedDelete(Delete_Existing_Dropdown, Input_1, Input_2, Input_3, Input_4,
                                                   Input_5, Input_6, Input_7, Input_8, Input_9, Input_10, Input_11, Input_12, Input_13, Input_14, Input_15, Current_Patient, GP_Letter);

            //Allows user to delete record
            Delete.Enabled = true;
        }
 //Saves changes to new patient or existing patient
 private void Save_Click(object sender, EventArgs e)
 {
     if (Patient_Database.SavePatient(Dropdown_1, Input_1, Date_1, Date_2, Dropdown_2, Input_2, Input_3, Input_4,
                                      Input_5, Input_6, Input_7, Input_8, Input_9, Input_10, Input_11, Dropdown_3, Current_Patient, GP_Letter) == true)
     {
         AddOrEditFields(false);
         Add_Dropdown_1.Focus();
     }
 }
Пример #6
0
 //When a user clicks a selection from the dropdown box all the values of the selected patient will
 //populate the fields.
 private void Dropdown_1_SelectionChangeCommitted(object sender, EventArgs e)
 {
     Patient_Database.PatientSelectedConsultation1(Dropdown_1, Input_1, Input_2, Input_3,
                                                   Input_4, Input_5);
     Consultation_Database.PopulateConsultationDataGridView(Dropdown_1, Existing_Consultations); //Poplulates existing consultations if any
     Dropdown_2.Enabled = true;                                                                  //Allows user to choose time period
     if (Dropdown_2.SelectedIndex != -1)
     {
         Add_Consultation.Enabled = true;
     }
 }
Пример #7
0
 //Once user exits cell from editing saves all rows of mark attendance
 private void PatientsClassDGV_CellEndEdit(object sender, DataGridViewCellEventArgs e)
 {
     //If a number then save
     if (cellEditFail == true)
     {
         this.PatientsClassDGV[e.ColumnIndex, e.RowIndex].Value = cellBeforeEdit;
     }
     else
     {
         Patient_Database.SaveAttendance(PatientsClassDGV);
     }
 }
        //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;
            }
        }
Пример #11
0
        //********************Database Event Methods********************

        //Shows list of all existing patients
        private void Dropdown_1_DropDown(object sender, EventArgs e)
        {
            Patient_Database.PopulatePatientDropdown(Dropdown_1);
        }
Пример #12
0
 //Saves changes to current/noncurrent patient
 private void Save_Click(object sender, EventArgs e)
 {
     Patient_Database.UpdateCurrentPatient(Dropdown_1, Current_Patient, Save);
 }
Пример #13
0
 //When a user clicks a selection from the dropdown box all the values of the selected patient will
 //populate the fields.  The program will also know that this is an edit session and not a new patient
 private void Dropdown_1_SelectionChangeCommitted(object sender, EventArgs e)
 {
     Patient_Database.PatientSelectedCurrentPatients(Dropdown_1, Input_1, Input_2, Input_3, Current_Patient, Save);
 }
        //********************Database Event Methods********************


        //Shows list of patients to delete
        private void Delete_Existing_Dropdown_DropDown(object sender, EventArgs e)
        {
            Patient_Database.PopulatePatientDropdown(Delete_Existing_Dropdown);
        }
 //Updates GP Letter Sent field of patient
 private void GP_Letter_Click(object sender, EventArgs e)
 {
     Patient_Database.UpdateGPLetterSent(GP_Letter, Dropdown_1);
 }