private void statusSwitch_Click(object sender, EventArgs e)
        {
            if (CheckIfPatientAlreadyinPatientDB() > 0)  // there is already an existing record in PatientDB
            {
                if (statusSwitch.Value == true)
                {
                    AppStatus = "COMPLETED";
                    changeStatus();
                    updatePatientTreatment_PatientID();
                    MessageBox.Show("Appointment Status changed to COMPLETE !");
                }
                else
                {
                    AppStatus = "PENDING";
                    changeStatus();
                    MessageBox.Show("Appointment Status changed to PENDING !");
                }
            }
            else
            {
                DialogResult result = MessageBox.Show("This Patient doesnt have record yet,\r\n Please complete Patient Information !"
                                                      , "Patient Record", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (result == DialogResult.OK)
                {
                    AddEditPatientRecord addEditPatientRecord = new AddEditPatientRecord();
                    GlobalVariable.isAddPatient = true;
                    GlobalVariable.isAppointmentPatientExist = true;
                    addEditPatientRecord.Show();
                    statusSwitch.Value = false;
                }
            }
            var main = Application.OpenForms.OfType <MainForm>().First();

            main.ChangeStatusIcon(statusSwitch.Value);
        }
        private void btn_CreateBilling_Click(object sender, EventArgs e)
        {
            //check if the name already exist in the patient database
            // if exist { proceed to payment }
            //          { change pending status to complete}

            // if not   { complete patient info }
            //          { proceed to payment }
            //          { change pending status to complete}


            if (GlobalVariable.AppointmentID > 0)
            {
                if (CheckIfPatientAlreadyinPatientDB() > 0)  // there is already an existing record in PatientDB
                {
                    //  GlobalVariable.TreatmentID = SelectedTreatmentID;

                    if (CheckifBillingStatementAlreadyExist())
                    {
                        MessageBox.Show("Billing Statement already Exist !", "Billing Statement"
                                        , MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        GlobalVariable.isBillingStatementExist = true;
                    }

                    AddBilling addBilling = new AddBilling();
                    addBilling.ShowDialog();
                }
                else
                {
                    MessageBox.Show("This Patient doesnt have record yet,\r\n Please complete Patient Information !"
                                    , "Patient Record", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    AddEditPatientRecord addEditPatientRecord = new AddEditPatientRecord();
                    GlobalVariable.isAddPatient = true;
                    GlobalVariable.isAppointmentPatientExist = true;
                    addEditPatientRecord.Show();
                }
            }
        }